aboutsummaryrefslogtreecommitdiffstats
path: root/src/api/dashboard/mod.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-05 20:26:42 +0100
committertv <tv@krebsco.de>2026-11-05 20:51:21 +0100
commit7d7c83616cc434f11a30b3e7f4577a55206cc76d (patch)
tree24f3a7b1b2a82cb9d43809b681d41832b497de71 /src/api/dashboard/mod.rs
parentc9065ee56c6e857f6ceddb78c4663bf9d82f0ac8 (diff)
dashboard: browser checks
Diffstat (limited to 'src/api/dashboard/mod.rs')
-rw-r--r--src/api/dashboard/mod.rs27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/api/dashboard/mod.rs b/src/api/dashboard/mod.rs
index 4ba25c7..bea5493 100644
--- a/src/api/dashboard/mod.rs
+++ b/src/api/dashboard/mod.rs
@@ -760,6 +760,33 @@ fn snapshot_event(published: &Published) -> Event {
mod tests {
use super::*;
+ /// The page in a browser (`check.js`): it loads without errors, the peers table and
+ /// the map draw what the state says, and a large map doesn't hold the page up.
+ /// Needs Node.js with Playwright's library and its Chromium (`check.nix` gives them),
+ /// so only when asked: `cargo test --features dashboard dashboard_in_a_browser --
+ /// --ignored`.
+ #[test]
+ #[ignore]
+ fn dashboard_in_a_browser() {
+ let file =
+ std::env::temp_dir().join(format!("continuum-dashboard-{}.html", std::process::id()));
+ std::fs::write(&file, &page().1).expect("page written");
+ let check =
+ std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join("src/api/dashboard/check.js");
+ let status = std::process::Command::new("node")
+ .arg(&check)
+ .arg(&file)
+ .status()
+ .unwrap_or_else(|error| {
+ panic!(
+ "Node.js doesn't run ({error}): the browser checks need `node` on the \
+ PATH, with Playwright's library and its Chromium (check.nix)"
+ )
+ });
+ let _ = std::fs::remove_file(&file);
+ assert!(status.success(), "the browser checks failed");
+ }
+
#[test]
fn merge_patches() {
let old = json!({ "a": 1, "b": { "c": 2, "d": [1, 2] }, "gone": true });