commit 45c07d54e1a192b6fd728350772e07e6dbb5b948
parent 5c877b01967c1338342230720ac6c4b78b8e3799
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Tue, 6 Oct 2026 11:50:16 -0400
e2e: a second BitChute import is clicked until refused, and BitChute is asked once
The first run's end refreshes the page, and a click landing during the refresh never reached the button's handler, so the spec failed on main as well (3 of 3 runs). The click now repeats until the notice shows, and the spec asserts a single import-one job for the video.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Diffstat:
1 file changed, 19 insertions(+), 6 deletions(-)
diff --git a/editor/e2e/import-video.spec.ts b/editor/e2e/import-video.spec.ts
@@ -113,11 +113,24 @@ test("a BitChute import runs on BitChute's queue and pace, and is never fetched
expect(queues).toEqual(["platform:bitchute"]);
}).toPass({ timeout: 15_000 });
- // Imported again: refused as already downloaded, nothing fetched.
+ // Imported again: refused as already downloaded, nothing fetched. The first
+ // run's end refreshes the page, and a click that lands during that refresh
+ // never reaches the button's handler — so click until the notice shows. An
+ // import that was NOT refused never shows it, and still fails here.
await expect(importBtn).toBeEnabled({ timeout: 30_000 });
- await importBtn.click();
- await expect(page.getByLabel("Import video notice")).toContainText(
- "Already downloaded",
- { timeout: 10_000 },
- );
+ await expect(async () => {
+ await importBtn.click();
+ await expect(page.getByLabel("Import video notice")).toContainText(
+ "Already downloaded",
+ { timeout: 3_000 },
+ );
+ }).toPass({ timeout: 30_000 });
+ // However many clicks that took, BitChute was asked once.
+ const imports: string[] = [];
+ for (const name of await readdir(resolvePath("test-transcripts/.jobs"))) {
+ if (!name.endsWith(".meta.json")) continue;
+ const m = JSON.parse(await readFile(resolvePath(`test-transcripts/.jobs/${name}`), "utf8"));
+ if (m.kind === "import-one" && m.videoId === id) imports.push(m.id);
+ }
+ expect(imports).toHaveLength(1);
});