diff --git a/packages/junior-dashboard/e2e/inbox/conversation-inbox-items.spec.ts b/packages/junior-dashboard/e2e/inbox/conversation-inbox-items.spec.ts index 0980d2ac398..cbaf8f323b6 100644 --- a/packages/junior-dashboard/e2e/inbox/conversation-inbox-items.spec.ts +++ b/packages/junior-dashboard/e2e/inbox/conversation-inbox-items.spec.ts @@ -178,6 +178,11 @@ test.describe("new UI", () => { // The question came from the second page, and its card in the // transcript holds the form. const card = page.getByRole("region", { name: `Asked ${migration.title}` }); + // The card shows below the latest message, and the transcript follows + // it a frame later. A click in that frame finds a moving option, and + // Playwright's retry scrolls the option to the bottom edge, which also + // leaves the latest message. + await expect(card).toBeInViewport({ ratio: 1 }); const approve = card.getByRole("radio", { name: "Approve" }); await approve.click(); await expect(card.getByText("1 of 2 answered")).toBeVisible(); diff --git a/packages/junior-dashboard/e2e/question-cards.spec.ts b/packages/junior-dashboard/e2e/question-cards.spec.ts index 35d5323d563..722afb4a3f5 100644 --- a/packages/junior-dashboard/e2e/question-cards.spec.ts +++ b/packages/junior-dashboard/e2e/question-cards.spec.ts @@ -36,6 +36,16 @@ for (const view of [desktop, mobile]) { name: "Asked Approve the payments-v42 rollout", }); await expect(card).toContainText("Waiting on you"); + if (view === desktop) { + // The answered question above reads its closed item after the list, + // and its row then grows. A click while the transcript follows that + // growth finds a moving button, and Playwright's retry scrolls the + // button to the bottom edge, which leaves the latest message. A phone + // shows the form in a sheet, out of the transcript. + await expect( + page.getByRole("region", { name: "Asked Pick the canary region" }), + ).toBeVisible(); + } // Nothing docks over the message box, and nothing takes the focus. await expect(page.getByRole("region", { name: /^Question:/ })).toHaveCount( 0,