Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
10 changes: 10 additions & 0 deletions packages/junior-dashboard/e2e/question-cards.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading