commit 9c4f9220d0c12ea88ac06cffaa37d2be80fcb4ac
parent b741e41b251b98d326a8f2154b95db35b99727ab
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Thu, 24 Sep 2026 22:27:02 -0400
export: e2e — heal a leftover transcriptDownloads at config load, not in the spec
The spec's beforeAll ran 36th of 37 files, so after a killed run
player-control-bar went red first. playwright.config.ts now strips the key
from the served fixture before any spec runs, next to the fixture staging it
already does.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Diffstat:
2 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/export/e2e/transcript-downloads.spec.ts b/export/e2e/transcript-downloads.spec.ts
@@ -8,8 +8,8 @@ import { expectModalOpen, installRoutes } from "./helpers";
// export controls. The suite serves ONE site (SITE_ID=testsite, SITES_DIR =
// e2e/fixtures/sites) and currentSite() re-reads site.json on every dev render,
// so the off case flips the key in the fixture for the duration of one test and
-// puts the file back. A run killed mid-test leaves the key behind; beforeAll
-// strips it, so the next run starts from the committed fixture either way.
+// puts the file back. A run killed mid-test leaves the key behind;
+// playwright.config.ts strips it at load, before any spec runs.
const SITE_FILE = path.resolve(
process.cwd(),
"e2e",
@@ -29,12 +29,6 @@ test.describe.configure({ mode: "serial" });
test.beforeAll(() => {
pristine = fs.readFileSync(SITE_FILE, "utf8");
- const parsed = JSON.parse(pristine) as Record<string, unknown>;
- if ("transcriptDownloads" in parsed) {
- delete parsed.transcriptDownloads;
- writeSiteFile(parsed);
- pristine = fs.readFileSync(SITE_FILE, "utf8");
- }
});
test.afterEach(() => {
diff --git a/export/playwright.config.ts b/export/playwright.config.ts
@@ -27,6 +27,20 @@ buildFixtureSettings(TEST_SETTINGS_FILE);
// step, so pwa.spec's `GET /sw.js` would depend on a stale build artifact being
// left on disk. Stage it here (mirroring compose) so the service-worker test is
// deterministic on a clean checkout, exactly like the committed public/icons/*.
+// transcript-downloads.spec flips `transcriptDownloads: false` into the served
+// fixture site for one test and restores it afterwards. A run killed inside that
+// test leaves the key behind, and every modal spec before it would then fail on
+// the missing controls — so strip it here, before any spec runs.
+const FIXTURE_SITE = path.join(TEST_SITES_DIR, "testsite", "site.json");
+{
+ const raw = fs.readFileSync(FIXTURE_SITE, "utf8");
+ const site = JSON.parse(raw) as Record<string, unknown>;
+ if ("transcriptDownloads" in site) {
+ delete site.transcriptDownloads;
+ fs.writeFileSync(FIXTURE_SITE, `${JSON.stringify(site, null, 2)}\n`);
+ }
+}
+
const SW_SRC = path.resolve(process.cwd(), "service-worker", "site-sw.js");
const SW_DEST = path.resolve(process.cwd(), "public", "sw.js");
if (fs.existsSync(SW_SRC)) fs.copyFileSync(SW_SRC, SW_DEST);