Skip to content

Commit a2bb718

Browse files
committed
fix(e2e): disambiguate Close Tab locator in subagent-child-navigation.spec.ts
The e2e (linux) job on this PR's CI failed with a strict-mode violation: getByRole('button', { name: 'Close Tab' }) resolves to two elements whenever a tab is open and showing the not-found fallback, because Playwright's getByRole name matching is case-insensitive by default and two different i18n keys produce near-identical accessible names (common.closeTab -> "Close tab", session.error.notFound.closeTab -> "Close Tab"). Confirmed this is not caused by this PR's diff (which doesn't touch packages/app at all): the same failure reproduces identically on dev HEAD (9ef686e) and on unrelated PRs #190/#191. A fix already exists as open PR #196 (closes tracking issue #195), verified there by reproducing the failure and the fix locally. Ported the same one-line change (adding exact: true) into this PR so CI goes green here without waiting on #196 to merge first. Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01AGh7o4NA8jUjwakDzZo12e
1 parent df180b5 commit a2bb718

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎packages/app/e2e/regression/subagent-child-navigation.spec.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@ test("shows the not found fallback when the viewed session is deleted", async ({
3939
})
4040

4141
await expect(page.getByText("This session cannot be found")).toBeVisible()
42-
await expect(page.getByRole("button", { name: "Close Tab" })).toBeVisible()
42+
// Exact match required: the tab strip's own "Close tab" icon button (a
43+
// different control, common.closeTab) is also on screen at this point, and
44+
// Playwright's getByRole name matching is case-insensitive by default — an
45+
// inexact match here resolves to both buttons (strict mode violation).
46+
await expect(page.getByRole("button", { name: "Close Tab", exact: true })).toBeVisible()
4347
await expect(page.getByRole("heading", { name: taskDescription })).toHaveCount(0)
4448
})
4549

0 commit comments

Comments
 (0)