From 1e54efcc33670e77833cc13a90ac1e75cf17b877 Mon Sep 17 00:00:00 2001 From: Sam Catlow Date: Fri, 25 Sep 2026 01:35:26 +1000 Subject: [PATCH] test: remove events-page source-string test It asserted on text in the router, nav and Events page sources rather than on behaviour. --- ui/test/events-page.test.ts | 77 ------------------------------------- 1 file changed, 77 deletions(-) delete mode 100644 ui/test/events-page.test.ts diff --git a/ui/test/events-page.test.ts b/ui/test/events-page.test.ts deleted file mode 100644 index ecc53cda4..000000000 --- a/ui/test/events-page.test.ts +++ /dev/null @@ -1,77 +0,0 @@ -import assert from "node:assert/strict"; -import { readFile } from "node:fs/promises"; -import test from "node:test"; - -/** - * The Events surfaces are one page with three tabs, and the navigation entry is - * always live (Sam's call): the tabs behind it prune themselves per capability, - * so an operator on a composition that can only back some of them still reaches - * the ones it can. What must not come back is three sibling destinations. - */ -const router = await readFile( - new URL("../src/router/index.ts", import.meta.url), - "utf8", -); -const nav = await readFile( - new URL("../src/lib/nav.ts", import.meta.url), - "utf8", -); -const page = await readFile( - new URL("../src/events/EventsPage.vue", import.meta.url), - "utf8", -); -const registry = await readFile( - new URL("../../internal/gateway/dashboard_tools.go", import.meta.url), - "utf8", -); - -test("the Events page is the tab host, and the old paths are gone", () => { - assert.match(page, /Tabs/, "the page composes tabs"); - assert.match( - page, - /CapturesPage/, - "the Inspector tab is the captures surface", - ); - assert.match( - page, - /BindingsPage/, - "the Bindings tab is the bindings surface", - ); - assert.match( - page, - /MappingsPage/, - "the Mappings tab is the mappings surface", - ); - - for (const path of ["/captures", "/mappings", "/bindings"]) { - assert.ok( - !router.includes(`path: "${path}"`), - `${path} is routed again; the Events tabs replaced it`, - ); - } -}); - -test("Events is one live navigation entry, not a group of three", () => { - const entry = nav.split("\n").find((l) => l.includes('"/events"')); - assert.ok(entry, "the navigation model does not reference /events"); - assert.doesNotMatch( - nav, - /label:\s*"Events",\s*paths:/, - "Events is still a three-item group", - ); -}); - -test("the page registry and the route table still agree", () => { - assert.match( - registry, - /Path: "\/events"/, - "the agent's page registry does not know /events", - ); - for (const path of ["/captures", "/mappings", "/bindings"]) { - assert.doesNotMatch( - registry, - new RegExp(`Path: "${path}"`), - `${path} is still a registered page`, - ); - } -});