From f2d8c997ba5219acdca63e120deb86122a1bd8db Mon Sep 17 00:00:00 2001 From: Sam Catlow Date: Sun, 8 Nov 2026 12:34:26 +0000 Subject: [PATCH] test: failing repro Refs #1664 --- ui/test/events-page-navigation.test.ts | 198 +++++++++++++++++++++++++ 1 file changed, 198 insertions(+) create mode 100644 ui/test/events-page-navigation.test.ts diff --git a/ui/test/events-page-navigation.test.ts b/ui/test/events-page-navigation.test.ts new file mode 100644 index 000000000..9f7b3477c --- /dev/null +++ b/ui/test/events-page-navigation.test.ts @@ -0,0 +1,198 @@ +import assert from "node:assert/strict"; +import { readFileSync } from "node:fs"; +import test from "node:test"; + +import { + availableTabs, + stepsFor, + type EventsStep, +} from "../src/events/tab-selection.ts"; +import { + loadEventCounts, + type EventsCountReaders, + type EventsCounts, +} from "../src/events/counts.ts"; + +/** + * The Events page's one navigation control, as the browser would render it. + * + * There is no DOM in this harness, so the page is read as source and the + * expressions the template binds are evaluated against real values from + * counts.ts and tab-selection.ts. That keeps the assertions about what an + * operator sees -- the label, the chip, the tooltip -- rather than about the + * shape of the markup, as far as the missing renderer allows. + * + * archie-core-xt6b (#1664, #1240): the page used to draw the Capture/Map/Bind + * chain twice, as a numbered `
    ` strip and again as a `Tabs` list, both + * writing `?tab=`. The strip is gone; what survives is the tab list wearing + * the strip's words. The first two tests below hold that shape still -- one + * control set, one vocabulary -- so a second affordance cannot come back + * unnoticed. The last two cover the count the surviving control shows, which + * counts.ts says is blank rather than zero when its read failed. + */ + +const pageSource = readFileSync( + new URL("../src/events/EventsPage.vue", import.meta.url), + "utf8", +); + +/** The template half of the page: everything the browser renders. */ +function templateOf(source: string): string { + const start = source.indexOf("\n