Skip to content

test: repair the Playwright suite - #6

Merged
soyuka merged 2 commits into
api-platform:mainfrom
BySplashGm:fix/test-suite-rot
Sep 8, 2026
Merged

test: repair the Playwright suite#6
soyuka merged 2 commits into
api-platform:mainfrom
BySplashGm:fix/test-suite-rot

Conversation

@BySplashGm

@BySplashGm BySplashGm commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

The Playwright suite was failing before any of the Mercure 1.0 work, for reasons that
have nothing to do with Mercure. This restores it, and is mergeable on its own.

Import maps no longer resolve the JSX runtime

react.html, swr.html, tanstack-query.html, mercure.html and github.html
declared @jsxImportSource and react in their import map, but not react/.
esm.sh/run now compiles JSX with the automatic runtime and emits
import { jsx } from "react/jsx-runtime", which the map cannot resolve — so those
pages threw before issuing a single request. Adding
"react/": "https://esm.sh/react@18.2.0/" fixes all five.

swr pulled a second React

swr.html mapped swr unpinned. esm.sh now serves swr 2.5.1, which depends on
react 19, next to the page's react-dom 18: two React copies, so hooks read a null
dispatcher. Pinned to https://esm.sh/swr@2.2.5?deps=react@18.2.0, which is what
tanstack-query.html already did.

Lockfile held @playwright/test 1.44.0

Regenerated to 1.62.1. package.json already declared ^1.44.0, which permits it,
so the manifest is untouched. 1.62.1 raises engines.node to >=20; every workflow
here runs node-version: lts/*, so nothing is left behind.

An author fixture claimed to be another author

tests-server/fixtures/authors/3.jsonld returned {"@id": "/authors/2"}. Nothing
asserted the wrong value and the Author 3 button in mercure.html is never clicked,
so it went unnoticed. Nothing in this PR reads it either — the fix is here because the
data is wrong on its own terms, and it unblocks a later test that does dispatch on
@id.


Verification. These fixes were validated as part of the full Mercure 1.0 stack
(6/6), not in isolation against a 0.x hub.

esm.sh/run now compiles JSX with the automatic runtime and emits
`import { jsx } from "react/jsx-runtime"`. The import maps declared `react`
but not `react/`, so react, swr, tanstack-query, mercure and github threw
before issuing a single request.

swr was mapped unpinned; esm.sh serves 2.5.1, which pulls react 19 next to
the pages react-dom 18 — two React copies, null hook dispatcher. Pinned to
swr@2.2.5?deps=react@18.2.0, matching tanstack-query.html.

The lock also held @playwright/test 1.44.0; regenerated to 1.62.1. The
manifest already declared ^1.44.0, which permits it, so it is untouched.
/authors/3 returned {"@id": "/authors/2"}. No test asserted the wrong value,
and mercure.html has an Author 3 button nothing ever clicks, so it went
unnoticed.
@BySplashGm
BySplashGm marked this pull request as ready for review September 4, 2026 12:43
@soyuka soyuka changed the title fix(tests): repair the Playwright suite test: repair the Playwright suite Sep 8, 2026
@soyuka
soyuka merged commit f6d6432 into api-platform:main Sep 8, 2026
1 of 2 checks passed
@soyuka

soyuka commented Sep 8, 2026

Copy link
Copy Markdown
Member

I renamed fix => test scope (conventional commits)

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