diff --git a/tests/runner-e2e/chat-catalog-domains/identity-company-budget.test.ts b/tests/runner-e2e/chat-catalog-domains/identity-company-budget.test.ts index 0dc52b3fae3..c4979b69368 100644 --- a/tests/runner-e2e/chat-catalog-domains/identity-company-budget.test.ts +++ b/tests/runner-e2e/chat-catalog-domains/identity-company-budget.test.ts @@ -48,9 +48,9 @@ describe("two company acts share the original observation clock", () => { vi.useFakeTimers(); vi.setSystemTime(260_000); const ctx = context(0); const first = vi.fn(async () => { vi.setSystemTime(271_000); return { status: "active" }; }); const forbidden = vi.fn(() => { throw new Error("must not start another followup"); }); - const control: Record = { click: first, filter: () => ({ click: forbidden }), getByText: () => ({}) }; + const control: Record = { click: first, filter: () => ({ click: forbidden }) }; control.getByRole = () => control; - ctx.input = { page: { url: () => "https://fixture.test/RUN/chats/ceo", getByRole: () => control }, + ctx.input = { page: { url: () => "https://fixture.test/RUN/chats/ceo", getByRole: () => control, getByText: () => ({}) }, fixtures: { company: { id: "company" } }, api: { get: first, post: forbidden } } as never; const act = companyLifecycleIdentityCases.find(row => row.scenarioId === id)!.act!; await expect(act(ctx, {})).rejects.toThrow(/exhausted/); diff --git a/tests/runner-e2e/chat-catalog-domains/identity-company-lifecycle.ts b/tests/runner-e2e/chat-catalog-domains/identity-company-lifecycle.ts index 14bef9836f1..32f727c69a9 100644 --- a/tests/runner-e2e/chat-catalog-domains/identity-company-lifecycle.ts +++ b/tests/runner-e2e/chat-catalog-domains/identity-company-lifecycle.ts @@ -63,8 +63,9 @@ export const companyLifecycleIdentityCases: readonly ChatCatalogCase[] = [ await ctx.input.page.getByRole("button", { name: /^Open .+ (?:organization|workspace|company) switcher$/i }).click({ timeout: remaining() }); // Each organization row's accessible name starts with its avatar initial ("B Birch BIR"), // so match the row by its exact visible organization name inside the open menu. + // A `has` locator is resolved inside each menu item, so it starts from the page, not the menu. const organizations = ctx.input.page.getByRole("menu"); - await organizations.getByRole("menuitem").filter({ has: organizations.getByText("Birch", { exact: true }) }) + await organizations.getByRole("menuitem").filter({ has: ctx.input.page.getByText("Birch", { exact: true }) }) .click({ timeout: remaining() }); const prefix = String(state.foreignPrefix); await expect(ctx.input.page).toHaveURL(new RegExp(`/${prefix}/`), { timeout: remaining() });