From 7152b936599c76748a5461b32ca54251d7f40769 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Almeida?= Date: Fri, 24 Apr 2026 11:41:53 +0100 Subject: [PATCH] fix(web): fold description into opts to keep seedTask under param limit `seedTask` had 6 parameters, violating the repo's 5-parameter cap and failing CI lint. Fold `description` into the existing `opts` object and update all callsites. --- .../tests/search/panel-focus-routing.spec.ts | 30 +++------ .../tests/search/panel-search-shared.spec.ts | 40 ++++-------- apps/web/e2e/tests/search/plan-search.spec.ts | 40 ++++-------- .../e2e/tests/search/session-search.spec.ts | 64 ++++++------------- apps/web/e2e/tests/search/shared.ts | 5 +- .../e2e/tests/search/terminal-search.spec.ts | 50 +++++---------- 6 files changed, 71 insertions(+), 158 deletions(-) diff --git a/apps/web/e2e/tests/search/panel-focus-routing.spec.ts b/apps/web/e2e/tests/search/panel-focus-routing.spec.ts index 54f0a35bbe..06b3558385 100644 --- a/apps/web/e2e/tests/search/panel-focus-routing.spec.ts +++ b/apps/web/e2e/tests/search/panel-focus-routing.spec.ts @@ -12,13 +12,9 @@ test.describe("@search panel-focus routing", () => { seedData, }) => { test.setTimeout(120_000); - const { session } = await seedTask( - testPage, - apiClient, - seedData, - "focus-routing-session", - seedMessagesDescription(["alpha"]), - ); + const { session } = await seedTask(testPage, apiClient, seedData, "focus-routing-session", { + description: seedMessagesDescription(["alpha"]), + }); await expect(session.chat.getByText("alpha", { exact: false }).first()).toBeVisible({ timeout: 30_000, }); @@ -37,13 +33,9 @@ test.describe("@search panel-focus routing", () => { seedData, }) => { test.setTimeout(120_000); - await seedTask( - testPage, - apiClient, - seedData, - "focus-routing-terminal", - seedMessagesDescription(["alpha"]), - ); + await seedTask(testPage, apiClient, seedData, "focus-routing-terminal", { + description: seedMessagesDescription(["alpha"]), + }); // Ensure terminal panel is mounted await expect(testPage.getByTestId("terminal-panel")).toBeVisible({ timeout: 15_000 }); @@ -63,13 +55,9 @@ test.describe("@search panel-focus routing", () => { seedData, }) => { test.setTimeout(120_000); - const { session } = await seedTask( - testPage, - apiClient, - seedData, - "focus-routing-plan", - planScript("## Plan\nsome content here"), - ); + const { session } = await seedTask(testPage, apiClient, seedData, "focus-routing-plan", { + description: planScript("## Plan\nsome content here"), + }); await session.togglePlanMode(); await expect(session.planPanel.locator(".ProseMirror")).toBeVisible({ timeout: 15_000 }); diff --git a/apps/web/e2e/tests/search/panel-search-shared.spec.ts b/apps/web/e2e/tests/search/panel-search-shared.spec.ts index ab53ed8f42..0b956dcfbb 100644 --- a/apps/web/e2e/tests/search/panel-search-shared.spec.ts +++ b/apps/web/e2e/tests/search/panel-search-shared.spec.ts @@ -32,13 +32,9 @@ test.describe("@search panel search bar — shared contract", () => { kind === "plan" ? planScript("## Scratch\nnothing special here") : seedMessagesDescription(["hello world alpha", "hello world beta"]); - const { session } = await seedTask( - testPage, - apiClient, - seedData, - `shared-${kind}-S1`, - description, - ); + const { session } = await seedTask(testPage, apiClient, seedData, `shared-${kind}-S1`, { + description: description, + }); await preparePanel(session, kind, testPage); await openPanelSearch(testPage, kind); @@ -53,13 +49,9 @@ test.describe("@search panel search bar — shared contract", () => { test.setTimeout(90_000); const description = kind === "plan" ? planScript("## Scratch\nnothing") : seedMessagesDescription(["hello"]); - const { session } = await seedTask( - testPage, - apiClient, - seedData, - `shared-${kind}-S3`, - description, - ); + const { session } = await seedTask(testPage, apiClient, seedData, `shared-${kind}-S3`, { + description: description, + }); await preparePanel(session, kind, testPage); await openPanelSearch(testPage, kind); @@ -71,13 +63,9 @@ test.describe("@search panel search bar — shared contract", () => { test.setTimeout(90_000); const description = kind === "plan" ? planScript("## Scratch\ntext") : seedMessagesDescription(["foo"]); - const { session } = await seedTask( - testPage, - apiClient, - seedData, - `shared-${kind}-S4`, - description, - ); + const { session } = await seedTask(testPage, apiClient, seedData, `shared-${kind}-S4`, { + description: description, + }); await preparePanel(session, kind, testPage); await openPanelSearch(testPage, kind); @@ -93,13 +81,9 @@ test.describe("@search panel search bar — shared contract", () => { kind === "plan" ? planScript("## Sample\nAlphaBetaGamma") : seedMessagesDescription(["AlphaBetaGamma"]); - const { session } = await seedTask( - testPage, - apiClient, - seedData, - `shared-${kind}-S5`, - description, - ); + const { session } = await seedTask(testPage, apiClient, seedData, `shared-${kind}-S5`, { + description: description, + }); await preparePanel(session, kind, testPage); await openPanelSearch(testPage, kind); diff --git a/apps/web/e2e/tests/search/plan-search.spec.ts b/apps/web/e2e/tests/search/plan-search.spec.ts index f7d7e68f5a..33b9a27523 100644 --- a/apps/web/e2e/tests/search/plan-search.spec.ts +++ b/apps/web/e2e/tests/search/plan-search.spec.ts @@ -45,13 +45,9 @@ test.describe("@search plan panel search", () => { prCapture, }) => { test.setTimeout(120_000); - const { session } = await seedTask( - testPage, - apiClient, - seedData, - "plan-search-basic", - planScript(PLAN_CONTENT), - ); + const { session } = await seedTask(testPage, apiClient, seedData, "plan-search-basic", { + description: planScript(PLAN_CONTENT), + }); await openPlanPanel(testPage, session); await openPanelSearch(testPage, "plan"); @@ -80,13 +76,9 @@ test.describe("@search plan panel search", () => { seedData, }) => { test.setTimeout(120_000); - const { session } = await seedTask( - testPage, - apiClient, - seedData, - "plan-search-nav", - planScript(PLAN_CONTENT), - ); + const { session } = await seedTask(testPage, apiClient, seedData, "plan-search-nav", { + description: planScript(PLAN_CONTENT), + }); await openPlanPanel(testPage, session); await openPanelSearch(testPage, "plan"); @@ -129,13 +121,9 @@ test.describe("@search plan panel search", () => { test("P9 Close removes all highlights", async ({ testPage, apiClient, seedData }) => { test.setTimeout(120_000); - const { session } = await seedTask( - testPage, - apiClient, - seedData, - "plan-search-close", - planScript(PLAN_CONTENT), - ); + const { session } = await seedTask(testPage, apiClient, seedData, "plan-search-close", { + description: planScript(PLAN_CONTENT), + }); await openPlanPanel(testPage, session); await openPanelSearch(testPage, "plan"); @@ -157,13 +145,9 @@ test.describe("@search plan panel search", () => { seedData, }) => { test.setTimeout(120_000); - const { session } = await seedTask( - testPage, - apiClient, - seedData, - "plan-search-toggles", - planScript(PLAN_CONTENT), - ); + const { session } = await seedTask(testPage, apiClient, seedData, "plan-search-toggles", { + description: planScript(PLAN_CONTENT), + }); await openPlanPanel(testPage, session); await openPanelSearch(testPage, "plan"); diff --git a/apps/web/e2e/tests/search/session-search.spec.ts b/apps/web/e2e/tests/search/session-search.spec.ts index aa4fd02210..7afc6af7fc 100644 --- a/apps/web/e2e/tests/search/session-search.spec.ts +++ b/apps/web/e2e/tests/search/session-search.spec.ts @@ -21,13 +21,9 @@ test.describe("@search session chat panel search", () => { "this line has no match", "third fox appearance here", ]; - const { session } = await seedTask( - testPage, - apiClient, - seedData, - "session-search-hits", - seedMessagesDescription(messages), - ); + const { session } = await seedTask(testPage, apiClient, seedData, "session-search-hits", { + description: seedMessagesDescription(messages), + }); // Wait for at least one agent message to have rendered await expect(session.chat.getByText("fox", { exact: false }).first()).toBeVisible({ timeout: 30_000, @@ -50,13 +46,9 @@ test.describe("@search session chat panel search", () => { test("C2 unmatched query shows No matches", async ({ testPage, apiClient, seedData }) => { test.setTimeout(120_000); - const { session } = await seedTask( - testPage, - apiClient, - seedData, - "session-search-nomatch", - seedMessagesDescription(["hello world"]), - ); + const { session } = await seedTask(testPage, apiClient, seedData, "session-search-nomatch", { + description: seedMessagesDescription(["hello world"]), + }); await expect(session.chat.getByText("hello world", { exact: false }).first()).toBeVisible({ timeout: 30_000, }); @@ -83,13 +75,9 @@ test.describe("@search session chat panel search", () => { lines.push(`line ${i} padding text`); } - const { session } = await seedTask( - testPage, - apiClient, - seedData, - "session-search-scroll", - seedMessagesDescription(lines), - ); + const { session } = await seedTask(testPage, apiClient, seedData, "session-search-scroll", { + description: seedMessagesDescription(lines), + }); await expect(session.chat.getByText("padding text", { exact: false }).first()).toBeVisible({ timeout: 60_000, }); @@ -148,13 +136,9 @@ test.describe("@search session chat panel search", () => { .toBe(true); // Now open task A and search for B's marker — should return no hits. - const { session } = await seedTask( - testPage, - apiClient, - seedData, - "session-search-iso-A", - seedMessagesDescription([`hello with ${uniqueA} embedded`]), - ); + const { session } = await seedTask(testPage, apiClient, seedData, "session-search-iso-A", { + description: seedMessagesDescription([`hello with ${uniqueA} embedded`]), + }); await expect(session.chat.getByText(uniqueA, { exact: false }).first()).toBeVisible({ timeout: 30_000, }); @@ -171,13 +155,9 @@ test.describe("@search session chat panel search", () => { test("C10 close button clears the bar", async ({ testPage, apiClient, seedData }) => { test.setTimeout(120_000); - const { session } = await seedTask( - testPage, - apiClient, - seedData, - "session-search-close", - seedMessagesDescription(["foo"]), - ); + const { session } = await seedTask(testPage, apiClient, seedData, "session-search-close", { + description: seedMessagesDescription(["foo"]), + }); await expect(session.chat.getByText("foo", { exact: false }).first()).toBeVisible({ timeout: 30_000, }); @@ -195,14 +175,12 @@ test.describe("@search session chat panel search", () => { seedData, }) => { test.setTimeout(120_000); - const { session } = await seedTask( - testPage, - apiClient, - seedData, - "session-search-virtuoso", - seedMessagesDescription(["virtuoso fox alpha", "virtuoso fox beta"]), - { rendererOverride: "virtuoso" }, - ); + const { session } = await seedTask(testPage, apiClient, seedData, "session-search-virtuoso", { + description: { + description: seedMessagesDescription(["virtuoso fox alpha", "virtuoso fox beta"]), + rendererOverride: "virtuoso", + }, + }); await expect(session.chat.getByText("virtuoso", { exact: false }).first()).toBeVisible({ timeout: 30_000, }); diff --git a/apps/web/e2e/tests/search/shared.ts b/apps/web/e2e/tests/search/shared.ts index d2e4d89d08..d9c716a8ce 100644 --- a/apps/web/e2e/tests/search/shared.ts +++ b/apps/web/e2e/tests/search/shared.ts @@ -13,15 +13,14 @@ export async function seedTask( apiClient: ApiClient, seedData: SeedData, title: string, - description: string, - opts: { rendererOverride?: "native" | "virtuoso" } = {}, + opts: { description: string; rendererOverride?: "native" | "virtuoso" }, ): Promise<{ session: SessionPage; taskId: string; sessionId: string }> { const task = await apiClient.createTaskWithAgent( seedData.workspaceId, title, seedData.agentProfileId, { - description, + description: opts.description, workflow_id: seedData.workflowId, workflow_step_id: seedData.startStepId, repository_ids: [seedData.repositoryId], diff --git a/apps/web/e2e/tests/search/terminal-search.spec.ts b/apps/web/e2e/tests/search/terminal-search.spec.ts index 29df2903b6..c2f8da89fc 100644 --- a/apps/web/e2e/tests/search/terminal-search.spec.ts +++ b/apps/web/e2e/tests/search/terminal-search.spec.ts @@ -64,13 +64,9 @@ test.describe("@search terminal panel search", () => { prCapture, }) => { test.setTimeout(120_000); - await seedTask( - testPage, - apiClient, - seedData, - "terminal-search-basic", - seedMessagesDescription(["idle"]), - ); + await seedTask(testPage, apiClient, seedData, "terminal-search-basic", { + description: seedMessagesDescription(["idle"]), + }); await seedTerminalOutput(testPage); const bufferBefore = await testPage.evaluate(() => { @@ -106,13 +102,9 @@ test.describe("@search terminal panel search", () => { test("T4 case sensitivity toggle affects matches", async ({ testPage, apiClient, seedData }) => { test.setTimeout(120_000); - await seedTask( - testPage, - apiClient, - seedData, - "terminal-search-case", - seedMessagesDescription(["idle"]), - ); + await seedTask(testPage, apiClient, seedData, "terminal-search-case", { + description: seedMessagesDescription(["idle"]), + }); await seedTerminalOutput(testPage); await openPanelSearch(testPage, "terminal"); @@ -138,13 +130,9 @@ test.describe("@search terminal panel search", () => { seedData, }) => { test.setTimeout(120_000); - await seedTask( - testPage, - apiClient, - seedData, - "terminal-search-regex", - seedMessagesDescription(["idle"]), - ); + await seedTask(testPage, apiClient, seedData, "terminal-search-regex", { + description: seedMessagesDescription(["idle"]), + }); await seedTerminalOutput(testPage); await openPanelSearch(testPage, "terminal"); @@ -170,13 +158,9 @@ test.describe("@search terminal panel search", () => { seedData, }) => { test.setTimeout(120_000); - await seedTask( - testPage, - apiClient, - seedData, - "terminal-search-esc", - seedMessagesDescription(["idle"]), - ); + await seedTask(testPage, apiClient, seedData, "terminal-search-esc", { + description: seedMessagesDescription(["idle"]), + }); await seedTerminalOutput(testPage); // Capture buffer snapshot before opening search @@ -202,13 +186,9 @@ test.describe("@search terminal panel search", () => { seedData, }) => { test.setTimeout(120_000); - await seedTask( - testPage, - apiClient, - seedData, - "terminal-search-backspace", - seedMessagesDescription(["idle"]), - ); + await seedTask(testPage, apiClient, seedData, "terminal-search-backspace", { + description: seedMessagesDescription(["idle"]), + }); await seedTerminalOutput(testPage); await openPanelSearch(testPage, "terminal");