Skip to content

chore: await web-first assertions in basics client tests#16068

Merged
elliott-with-the-longest-name-on-github merged 1 commit into
sveltejs:mainfrom
voidmatcha:fix/e2e-non-asserting-checks
Jun 17, 2026
Merged

chore: await web-first assertions in basics client tests#16068
elliott-with-the-longest-name-on-github merged 1 commit into
sveltejs:mainfrom
voidmatcha:fix/e2e-non-asserting-checks

Conversation

@voidmatcha

Copy link
Copy Markdown
Contributor

Several Playwright assertions in packages/kit/test/apps/basics/test/client.test.js use web-first matchers without awaiting them, so the returned promise floats and the assertion never actually runs. The affected tests pass regardless of the real page URL or text content, which means they provide no coverage today.

Affected assertions:

  • expect(page).toHaveURL(...) in "data-sveltekit-preload-data network failure does not trigger navigation" (sole assertion of the test).
  • two expect(page).toHaveURL(...) calls in "data-sveltekit-preload-data error does not block user navigation" (the only assertions of the test).
  • expect(page).toHaveURL(...) in "data-sveltekit-preload does not abort ongoing navigation" (sole assertion).
  • expect(page).toHaveURL(...) in "data-sveltekit-preload does not abort ongoing navigation add create-svelte package #2".
  • expect(await page.locator('h2')).toHaveText(...) in "uses correct dynamic env when navigating from prerendered page". Here the await is on the locator (a no-op) rather than on the assertion, so the matcher still floats. Sole assertion of the test.

The fix adds the missing await (and moves it outside expect() for the h2 case) so each matcher runs and can fail. No test titles, selectors, or expected values are changed; this only makes the existing assertions effective.

Tests

  • I was not able to run the full Playwright e2e suite locally (the demo apps require a build/dev server in my environment). The change is a mechanical addition of missing awaits to existing assertions, with no behavior, selector, or expected-value change.

Changesets

  • No changeset: this is a test-only change under packages/kit/test/ with no published-package changelog impact.

Edits

  • Allow edits from maintainers is enabled.

Found while reviewing the test suite with e2e-skills/e2e-reviewer.

@changeset-bot

changeset-bot Bot commented Jun 17, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 2a1eb9c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@elliott-with-the-longest-name-on-github
elliott-with-the-longest-name-on-github merged commit 0d8ef59 into sveltejs:main Jun 17, 2026
23 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants