Skip to content

Commit 3ff5d95

Browse files
bjohansebasclaude
andcommitted
test: assert the dismiss hint where it is acted on
The Escape e2e now checks the card advertises the dismissal it is about to perform; the jsdom hint test is removed. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent eaff5d2 commit 3ff5d95

2 files changed

Lines changed: 6 additions & 8 deletions

File tree

test/e2e/overlay.test.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,12 @@ describe("error overlay (browser)", () => {
9898
await page.goto(hotApp.url);
9999

100100
hotApp.edit("also broken {{{");
101-
await waitForOverlay(page);
101+
const frame = await waitForOverlay(page);
102+
103+
// The card advertises exactly what this test is about to do.
104+
expect(await frame.evaluate(() => document.body.textContent)).toContain(
105+
"Click outside, press Esc, or fix the code to dismiss.",
106+
);
102107

103108
await page.keyboard.press("Escape");
104109
await waitForNoOverlay(page);

test/overlay.test.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,6 @@ describe("overlay", () => {
9393
expect(getCard().textContent).toContain("https://example.com/a.");
9494
});
9595

96-
it("shows a dismiss hint", () => {
97-
showProblems("errors", ["boom"]);
98-
expect(getCard().textContent).toContain(
99-
"Click outside, press Esc, or fix the code to dismiss.",
100-
);
101-
});
102-
10396
it("re-mounts the overlay when the iframe was removed without clear()", () => {
10497
showProblems("errors", ["boom"]);
10598
// A framework wiping `document.body` removes the iframe behind our back.

0 commit comments

Comments
 (0)