yukey

testkit: move gallery.ts into packages/e2e

commit 1fba87a472f7a73e501c316c97b7d9e5331f14e4 · parent f2166ce42f · browse this tree
Ximianth, 2026-10-10 05:41:04 UTC

openGallery hard-codes gallery.html and the readiness pattern of yukey's own
gallery.  That's a fact about packages/yukey/static, not about yukey apps,
so it doesn't belong in the published package.  Only the four e2e scenarios
call it.
diff --git a/packages/yukey-testkit/src/gallery.ts b/packages/e2e/gallery.ts
similarity index 91%
rename from packages/yukey-testkit/src/gallery.ts
rename to packages/e2e/gallery.ts
index 517708c..847bdab 100644
--- a/packages/yukey-testkit/src/gallery.ts
+++ b/packages/e2e/gallery.ts
@@ -2,8 +2,8 @@
 // This is the setup etiquette every gallery scenario shared as a long-lived-browser
 // convention; here it is explicit and self-contained per scenario.
 
-import type { ScenarioContext } from "./checks.ts";
-import { sleep } from "./sleep.ts";
+import type { ScenarioContext } from "yukey-testkit/checks";
+import { sleep } from "yukey-testkit/sleep";
 
 export async function openGallery(
 	ctx: ScenarioContext,
diff --git a/packages/e2e/scenarios/ip-drive.ts b/packages/e2e/scenarios/ip-drive.ts
index cfb64b0..7f6f764 100644
--- a/packages/e2e/scenarios/ip-drive.ts
+++ b/packages/e2e/scenarios/ip-drive.ts
@@ -10,8 +10,8 @@
 // Ported from the Python original (demoscene.meta screenshots, stage-infopop).
 
 import { type Scenario, type ScenarioContext, shot } from "yukey-testkit/checks";
-import { openGallery } from "yukey-testkit/gallery";
 import { sleep } from "yukey-testkit/sleep";
+import { openGallery } from "../gallery.ts";
 
 // State through the shadow roots: the popup's mode/content/position, the demo
 // column's focused row and log, and the aria reflection on the current anchor.
diff --git a/packages/e2e/scenarios/lc-drive.ts b/packages/e2e/scenarios/lc-drive.ts
index 1cd0c1c..5b2eb68 100644
--- a/packages/e2e/scenarios/lc-drive.ts
+++ b/packages/e2e/scenarios/lc-drive.ts
@@ -29,8 +29,8 @@
 // updated in place by stage-list-component).
 
 import { type Scenario, type ScenarioContext, shot } from "yukey-testkit/checks";
-import { openGallery } from "yukey-testkit/gallery";
 import { sleep } from "yukey-testkit/sleep";
+import { openGallery } from "../gallery.ts";
 
 // demo(i): the i-th swg-livecolumn-demo (0 = refill, 1 = drain).
 const demo = (i: number) =>
diff --git a/packages/e2e/scenarios/mc-drive.ts b/packages/e2e/scenarios/mc-drive.ts
index c89aa70..619e060 100644
--- a/packages/e2e/scenarios/mc-drive.ts
+++ b/packages/e2e/scenarios/mc-drive.ts
@@ -4,8 +4,8 @@
 // Ported from the Python original (demoscene.meta screenshots, stage-focus-model).
 
 import type { Scenario, ScenarioContext } from "yukey-testkit/checks";
-import { openGallery } from "yukey-testkit/gallery";
 import { sleep } from "yukey-testkit/sleep";
+import { openGallery } from "../gallery.ts";
 
 // Reads the interesting state through the shadow roots: which demo element holds
 // real focus, its aria-activedescendant, ring positions, text mode, and the log line.
diff --git a/packages/e2e/scenarios/sw-drive.ts b/packages/e2e/scenarios/sw-drive.ts
index 8ede259..76ac4e7 100644
--- a/packages/e2e/scenarios/sw-drive.ts
+++ b/packages/e2e/scenarios/sw-drive.ts
@@ -8,8 +8,8 @@
 // Ported from the Python original (demoscene.meta screenshots, stage-button).
 
 import { type Scenario, type ScenarioContext, shot } from "yukey-testkit/checks";
-import { openGallery } from "yukey-testkit/gallery";
 import { sleep } from "yukey-testkit/sleep";
+import { openGallery } from "../gallery.ts";
 
 // State through the shadow roots: which element holds real focus (host chain),
 // each demo's log line, and the columns' focused rows.
diff --git a/packages/yukey-testkit/README.md b/packages/yukey-testkit/README.md
index 5f83238..a97f3e7 100644
--- a/packages/yukey-testkit/README.md
+++ b/packages/yukey-testkit/README.md
@@ -23,7 +23,6 @@ What's in it
 - `yukey-testkit/checks`: the `Checks` collector (a PASS/FAIL line protocol with a summary),
   the `Scenario` and `ScenarioContext` shapes a suite runner can share, and `shot` for optional screenshot evidence
   (written only when `YUKEY_E2E_SHOTS_DIR` is set).
-- `yukey-testkit/gallery`: `openGallery`, the setup etiquette for landing on a yukey gallery entry in a fresh document.
 - `yukey-testkit/sleep`: a promise-returning sleep for polling loops.
 
 Launching Chrome and serving your page are yours to do; they vary too much per app to belong here.