Skip to content

Commit 7c73df7

Browse files
Programcodeclaude
andcommitted
test(e2e): answer the motion dialog in model-matrix and the prod canary
Generate now asks "Start a debate with this motion?" before it sends the request. Neither spec answered it, so every model-matrix case and the canary's "generates a case" test waited out their response timeouts with the dialog open and no request sent. Both now choose "use it once": model-matrix through the existing chooseForMotion helper, the canary inline because it does not load the full-stack helpers. Using it once also keeps the production canary account from accumulating debates. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HyWuBiDEMvVnjmguH9CwCZ
1 parent 918b58d commit 7c73df7

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

‎e2e/model-matrix/generate.spec.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { MODEL_CATALOG } from "../../supabase/functions/_shared/model-catalog";
2-
import { expect, fake, stackReady, test } from "../full-stack/stack";
2+
import { chooseForMotion, expect, fake, stackReady, test } from "../full-stack/stack";
33
import { aiResponse, LIVE_TIMEOUT } from "../live/live";
44

55
// Every model a user can pick must generate a case. The regular live suite pins
@@ -16,6 +16,7 @@ for (const model of MODEL_CATALOG) {
1616
await page.getByRole("textbox", { name: "Motion / Topic *" }).fill("This House would make public transport free at the point of use");
1717
const response = aiResponse(page, "generate");
1818
await page.getByRole("button", { name: "Generate Debate Case" }).click();
19+
await chooseForMotion(page, "once");
1920
const body = await response;
2021
expect(body.output.contentions).toHaveLength(3);
2122

‎e2e/production/canary.spec.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,10 @@ test("the canary account generates a case", async ({ page }) => {
115115
await page.getByRole("textbox", { name: "Motion / Topic *" }).fill("This House would make public transport free");
116116
const generated = page.waitForResponse((response) => response.url().endsWith("/functions/v1/ai") && response.request().method() === "POST", { timeout: 150_000 });
117117
await page.getByRole("button", { name: "Generate Debate Case" }).click();
118+
// Use the motion once so the canary account does not collect production debates.
119+
await page.getByRole("dialog", { name: /^(Start a debate with this motion\?|This is a different motion)$/ })
120+
.getByRole("button", { name: /^(Not now, use it once|Use once without saving to a debate)$/ })
121+
.click();
118122
const response = await generated;
119123
expect(response.status(), "ai generate status").toBe(200);
120124
const body = await response.json() as { output: { contentions?: unknown[] } };

0 commit comments

Comments
 (0)