addhost-pill-stream.spec.ts:26 fails on dev: a negated toast assertion needs a toast element #408

Open
opened 2026-11-06 19:14:50 +00:00 by kayg · 0 comments
Owner

Found by J307 (#398) and confirmed by J321's review. apps/tracer/test/addhost-pill-stream.spec.ts:26 ("a failure after the prompt is explained in the pill, and Try again finishes into the system icon") fails on unmodified dev.

Evidence: J307 ran it 2/2 on origin/dev 37c93637e and 2/2 on addhost-sudo-consent b1cbe2f4f (--repeat-each=2, production build, 1 worker). Log: claude@compute01:~/j307/pill.log.

✘ test/addhost-pill-stream.spec.ts:26:1 › a failure after the prompt is explained in the pill, and Try again finishes into the system icon (16.1s)
Error: expect(locator).not.toContainText(expected) failed   (element(s) not found)

Likely cause: the test, not the product. Line 34:

// The wizard's own "ready" toast would contradict the failure: it is not shown.
await expect(page.locator(".ui-toast")).not.toContainText(/ready|added/i);

The negated toContainText still needs a matching element. Once no .ui-toast node is mounted, it fails with "element(s) not found" even though the behaviour it checks for (no "ready" toast) holds. The product intent is met. The assertion needs to be expect(page.locator(".ui-toast", { hasText: /ready|added/i })).toHaveCount(0). I didn't bisect which dev change stopped mounting an idle toast node.

Why its own issue: it's red on dev for every add-host browser run. Each job has to prove it's pre-existing again (J307 spent a slot doing that), and a real regression in this spec would go unnoticed.

Related: #398.

Found by J307 (#398) and confirmed by J321's review. `apps/tracer/test/addhost-pill-stream.spec.ts:26` ("a failure after the prompt is explained in the pill, and Try again finishes into the system icon") fails on unmodified dev. **Evidence:** J307 ran it 2/2 on origin/dev `37c93637e` and 2/2 on `addhost-sudo-consent` `b1cbe2f4f` (`--repeat-each=2`, production build, 1 worker). Log: `claude@compute01:~/j307/pill.log`. ``` ✘ test/addhost-pill-stream.spec.ts:26:1 › a failure after the prompt is explained in the pill, and Try again finishes into the system icon (16.1s) Error: expect(locator).not.toContainText(expected) failed (element(s) not found) ``` **Likely cause: the test, not the product.** Line 34: ```ts // The wizard's own "ready" toast would contradict the failure: it is not shown. await expect(page.locator(".ui-toast")).not.toContainText(/ready|added/i); ``` The negated `toContainText` still needs a matching element. Once no `.ui-toast` node is mounted, it fails with "element(s) not found" even though the behaviour it checks for (no "ready" toast) holds. The product intent is met. The assertion needs to be `expect(page.locator(".ui-toast", { hasText: /ready|added/i })).toHaveCount(0)`. I didn't bisect which dev change stopped mounting an idle toast node. **Why its own issue:** it's red on dev for every add-host browser run. Each job has to prove it's pre-existing again (J307 spent a slot doing that), and a real regression in this spec would go unnoticed. Related: #398.
Sign in to join this conversation.
No labels
launch-qa
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/infraternal#408
No description provided.