Skip to content

Commit 19a9925

Browse files
committed
Bring three more never-run browser tests up to today's app
Their first CI run found them stale against changes that landed on main today: - routine-run-now-layout: a running run now reads "Running now" (#2704). - plan-notices-layout: the trial-used-up dialog says it in one sentence, "All 500 Bot runs in your free trial are used." (#2692), as the suite's plan-free-trial.test.tsx reads it. - artifacts-screens: Back's focus reaches the tile that opened the artifact a moment after the address changes, once the list is drawn again; the case read it at once, while it was still on Back. It waits for it now, up to 5 s, and fails when the list's focus call is taken out.
1 parent b906acf commit 19a9925

3 files changed

Lines changed: 16 additions & 11 deletions

File tree

‎app/tests/artifacts-screens.test.tsx‎

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -972,14 +972,16 @@ describe.skipIf(!asked)("the Artifacts page and full screen", () => {
972972
() => new URL(location.href).searchParams.get("artifact") === null,
973973
);
974974
expect(await scroller()).toBe(scrolled);
975-
expect(
976-
await page.evaluate(
977-
() =>
978-
document.activeElement
979-
?.closest("[data-slot=artifact-tile]")
980-
?.textContent?.includes("Launch countdown") ?? false,
981-
),
982-
).toBe(true);
975+
// Focus moves once the list is drawn again, a moment after the address changes: read the
976+
// moment the address changed, it was still on Back.
977+
await page.waitForFunction(
978+
() =>
979+
document.activeElement
980+
?.closest("[data-slot=artifact-tile]")
981+
?.textContent?.includes("Launch countdown") ?? false,
982+
undefined,
983+
{ timeout: 5_000 },
984+
);
983985
expect(await unanswered(page)).toEqual([]);
984986
} finally {
985987
await page.close();

‎app/tests/plan-notices-layout.test.tsx‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,8 +384,10 @@ describe.skipIf(!asked)(
384384
try {
385385
await shot(page, `dialog-${state.name}-${theme}-${width}`);
386386
const dialog = page.getByRole("dialog");
387+
// The dialog at the end says it in one sentence (#2692), as the suite's
388+
// plan-free-trial.test.tsx reads it.
387389
await expect(dialog.textContent()).resolves.toContain(
388-
"Your free trial was 500 Bot runs",
390+
"All 500 Bot runs in your free trial are used.",
389391
);
390392
const link = dialog.getByRole("link", { name: "Add a card" });
391393
if (state.admin)

‎app/tests/routine-run-now-layout.test.tsx‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,9 @@ describe.skipIf(!asked)("Run now on a routine's page", () => {
198198
expect(await sideways(page)).toBe(false);
199199

200200
await page.getByRole("button", { name: RUN_BUTTON }).click();
201-
// The run the server started shows in Runs, with or without the page saying so.
202-
await page.getByText("Running", { exact: true }).waitFor();
201+
// The run the server started shows in Runs, with or without the page saying so, as
202+
// "Running now" (#2704).
203+
await page.getByText("Running now", { exact: true }).waitFor();
203204
if (!before)
204205
await page
205206
.getByRole("status")

0 commit comments

Comments
 (0)