test(segmented): drive the control in a real browser

Roving focus, Home/End, wrap, toggle mode, disabled and the chosen
segment's fill are now asserted through key presses and computed styles
instead of markup greps. The static render test is deleted; its two
source sweeps move to segmented-single-implementation.test.ts.

The browser setup sets the default theme class so colour tokens
resolve, and pre-bundles the browser files' dependencies so a cold
cache does not reload the page mid-run.
This commit is contained in:
Marc-André Bombeck committed 2026-10-23 12:54:24 +02:00
1 parent 3d1692204b
commit ca1cceb3a9
7 files changed
+305 -243

No files matched your search

+5 -1
View File
@@ -2,7 +2,9 @@
* Setup for the `browser` project (`*.browser.test.tsx`, headless Chromium).
*
* - The app stylesheet, compiled by Vite through the project's PostCSS
* config, so components lay out and hide as they do in the app.
* config, so components lay out and hide as they do in the app, under the
* theme class the boot script sets for a first visit (`dark`, see
* `src/lib/pwa/theme-color.ts`); without one no colour token resolves.
* - The EN catalog, the fallback floor of every `t()` chain, loaded through
* the production loader. `renderWithApp` loads any other locale it is
* asked for.
@@ -19,6 +21,8 @@ import { loadMessages } from "@/lib/i18n/load-locale";
import { restoreFetch } from "./fetch-stub";
import { rememberAddress, restoreAddress } from "./url";
document.documentElement.classList.add("dark");
beforeAll(async () => {
await loadMessages("en");
});