commit 24fde721258a10e98eda9faba1bb43f7b08fa3d1
parent d39f4a1855e27bc6501cae0fac255b6b5c2725ac
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Tue, 17 Nov 2026 17:46:34 -0500
reads-find.spec: a filtered view re-reads only its rows (review 1, MUST 1)
One character's stale reads, re-read from their view: one step, the stale card and the other speaker's
screen line never queued nor synthesized.
Co-Authored-By: Claude <noreply@anthropic.com>
Diffstat:
1 file changed, 25 insertions(+), 0 deletions(-)
diff --git a/umtool/e2e/reads-find.spec.ts b/umtool/e2e/reads-find.spec.ts
@@ -203,6 +203,31 @@ test("Everywhere, from now on: a pronunciation entry previewed, applied (the rea
expect(JSON.parse(readFileSync(path.join(DIR, "narration", "lexicon.json"), "utf8"))).toEqual([]);
});
+test("MUST 1: a filtered view (one character's stale reads) re-reads ONLY its rows", async ({ page }) => {
+ const asksBefore = ttsAsks().length;
+ await page.goto(urls.readsHref(P));
+ const panel = page.locator(`[data-reads="${P}"]`);
+ await expect(panel.locator("[data-reads-rows]")).toHaveAttribute("data-reads-rows", "8", { timeout: 30_000 });
+ await panel.getByLabel("Find in spoken text").fill("north pier");
+ await panel.getByLabel("Replace with").fill("northern pier");
+ await panel.getByRole("button", { name: "Replace in these reads" }).click();
+ await panel.getByRole("button", { name: "Apply the replace" }).click();
+ await expect(panel.locator('[data-reads-undo="reads"]')).toBeVisible();
+ // Three stale reads now: p-1 (the ferry's), p-4's screen line (said by the pier's account: no character) and the
+ // card (no one's). The ferry's view counts one.
+ await page.goto(urls.readsHref(P, { state: "stale", character: "ferry" }));
+ await expect(panel.locator("[data-reads-rows]")).toHaveAttribute("data-reads-rows", "1", { timeout: 30_000 });
+ await expect(panel.locator('[data-read="c-1"]')).toHaveCount(0);
+ await panel.getByRole("button", { name: "Re-read 1 changed line" }).click();
+ await expect(panel.locator("[data-reads-queue-row]")).toHaveCount(1, { timeout: 20_000 });
+ await expect(panel.locator('[data-reads-queue-row="p-1"]')).toHaveAttribute("data-state", "done", { timeout: 120_000 });
+ // The card and the screen line were never asked: still stale, never synthesized.
+ const card = (await (await page.request.get(`/api/report/reads?project=${encodeURIComponent(P)}`)).json()) as { reads: Array<{ id: string; state: string }> };
+ expect(card.reads.find((r) => r.id === "c-1")?.state).toBe("stale");
+ expect(card.reads.find((r) => r.id === "p-4/screen:s1:0")?.state).toBe("stale");
+ expect(ttsAsks().slice(asksBefore).some((a) => /pier reopened/.test(a.text ?? ""))).toBe(false);
+});
+
test("the bench links here: the Voices page and a post's bench", async ({ page }) => {
await page.goto(urls.voicesHref(P));
await expect(page.locator("[data-voices-reads]").first()).toHaveAttribute("href", urls.readsHref(P));