Skip to content

test(qwik-e2e): assert non-asserting e2e checks#8777

Merged
wmertens merged 1 commit into
QwikDev:build/v2from
voidmatcha:fix/e2e-non-asserting-checks-v2
Jun 28, 2026
Merged

test(qwik-e2e): assert non-asserting e2e checks#8777
wmertens merged 1 commit into
QwikDev:build/v2from
voidmatcha:fix/e2e-non-asserting-checks-v2

Conversation

@voidmatcha

@voidmatcha voidmatcha commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

What is it?

  • Docs / tests / types / typos

Description

Two e2e checks in the qwik-e2e suite silently always pass, so they cannot catch a regression:

  • sync-qrl.e2e.ts asserted expect(await input.getAttribute('prevented')).toBeDefined().
    getAttribute returns string | null and both pass toBeDefined(), so the check never fails.
    The sync-qrl app sets the attribute to String(e.defaultPrevented), and the test intent is to
    confirm the default was prevented, so this now asserts toHaveAttribute('prevented', 'true').
  • use-id.e2e.ts called await totalIdsLocator.isVisible() and discarded the boolean, asserting
    nothing. Replaced with the web-first await expect(totalIdsLocator).toBeVisible().

Both edits strengthen existing checks without changing test names or behavior. Test-only change,
no published package touched, so no changeset is needed.

This re-targets #8727 onto build/v2 at wmertens' request: that PR was approved on main
but closed because development is focused on build/v2 and merging would conflict. The same
anti-patterns are present in the restructured v2 suite, so the fix is reproduced here.

Testing

Verified statically: the new assertions use Playwright matchers valid for this suite, and the
sync-qrl change matches the app component that sets the attribute to String(e.defaultPrevented).
The e2e specs were not run locally, since the run needs pnpm install plus a core build and a
browser download. This is disclosed rather than claimed.


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

Replace an always-true toBeDefined on a getAttribute result and a bare
isVisible call with web-first assertions so the checks can actually fail.

Re-targets QwikDev#8727 onto build/v2 at wmertens' request.
@voidmatcha
voidmatcha requested a review from a team as a code owner June 26, 2026 15:51
@changeset-bot

changeset-bot Bot commented Jun 26, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: b41c1e8

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

@pkg-pr-new

pkg-pr-new Bot commented Jun 28, 2026

Copy link
Copy Markdown

Open in StackBlitz

@qwik.dev/core

npm i https://pkg.pr.new/QwikDev/qwik/@qwik.dev/core@8777

@qwik.dev/router

npm i https://pkg.pr.new/QwikDev/qwik/@qwik.dev/router@8777

eslint-plugin-qwik

npm i https://pkg.pr.new/QwikDev/qwik/eslint-plugin-qwik@8777

create-qwik

npm i https://pkg.pr.new/QwikDev/qwik/create-qwik@8777

@qwik.dev/optimizer

npm i https://pkg.pr.new/QwikDev/qwik/@qwik.dev/optimizer@8777

commit: b41c1e8

@wmertens wmertens left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@wmertens
wmertens enabled auto-merge June 28, 2026 20:35
@wmertens
wmertens merged commit efd00bc into QwikDev:build/v2 Jun 28, 2026
47 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