test: fix non-asserting e2e checks (missing awaits, no-op assertions)#8727
Open
voidmatcha wants to merge 1 commit into
Open
test: fix non-asserting e2e checks (missing awaits, no-op assertions)#8727voidmatcha wants to merge 1 commit into
voidmatcha wants to merge 1 commit into
Conversation
- prefix await on 7 floating expect(...).toHaveURL/.toHaveClass web-first
assertions (nav.spec.ts, navBarOnMobile.spec.ts) that were never enforced
- replace expect(await input.getAttribute("prevented")).toBeDefined() with
await expect(input).toHaveAttribute("prevented") - toBeDefined() passes
for null so the preventdefault behavior was never asserted
- replace a bare getByText() locator statement and a discarded isVisible()
boolean with web-first toBeVisible() assertions
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is it?
Description
This PR strengthens existing Playwright checks in the Qwik starter and docs E2E suites. It does not add product behavior or rename tests.
The fixes are focused on assertions that currently do not enforce the behavior they describe:
awaiton 7 web-first assertions whose promises were previously discarded (toHaveURLandtoHaveClass).expect(await input.getAttribute("prevented")).toBeDefined()with the repo's existing custom matcher idiom,await expect(input).hasAttribute("prevented"). The old form passes fornull, so it did not verify that the attribute exists.isVisible()boolean and a baregetByText()locator statement withawait expect(...).toBeVisible().Blame check:
Verification:
origin/mainon 2026-06-13.origin/mainand ran:bash scripts/pr-preflight.sh tmp/preflight-qwik e2e/docs-e2e/tests/Docs/navBarOnMobile.spec.ts starters/e2e/e2e.sync-qrl.spec.ts starters/e2e/e2e.use-id.spec.ts starters/e2e/qwikcity/nav.spec.ts starters/e2e/qwikcity/resource.spec.tsPREFLIGHT 0 fail(s)with scanner deltatotal from 16 to 9, p0 from 9 to 2, ast from 5 to 0; AST artifacts clean; diff hygiene clean; authoring clean with 0 added comments and no test renames.node_modules, and the Qwik E2E path requires the repo dependency and app setup. The preflight therefore skipped tsc, eslint, and Playwright because local repo binaries were absent.Checklist:
Found while reviewing the test suite with
e2e-skills/e2e-reviewer.