Files
Nathan Nguyen 357092873f test(e2e): gate clicks that can land before hydration commits (#2717)
* test(e2e): gate the dev-overlay soft-nav click on hydration

The soft-nav canary test waited only for the navigation runtime to publish
functions.navigate before clicking the Link. That happens before React
commits the hydrated tree — a probe measures a 12-30ms window locally, wider
on a loaded runner — so a click can land on an anchor with no listener
attached, the browser follows the href, and the reload canary the test
asserts on is lost.

Use waitForAppRouterHydration, which also requires __VINEXT_HYDRATED_AT (an
App Router post-commit effect) and settles two frames. It is what the file's
six other tests and the sibling app-with-src spec covering the same contract
already use.

Closes #2716. Recurrence of #1769; same race as #2409.

* test(e2e): gate use-params-app-pages clicks on hydration

The 12 clicks in tests/e2e/use-params-app-pages/ were dispatched with no
hydration gate. App Router publishes the navigation runtime 3-6 rAF ticks
before __VINEXT_HYDRATED_AT, and hydration is complete neither when goto()
resolves nor after one visibility assertion, so a click can land before
React attaches its delegated listeners and be dropped.

Gate each click on the helper the clicked element's router actually owns:
waitForAppRouterHydration for the App Router page at /, waitForHydration
for the Pages Router page at /form-source.

The prefetch test additionally asserted zero RSC requests, which passes
vacuously when the handler never runs. Add a positive control: the button
now also prefetches an App-owned /prefetch-control, whose RSC request only
appears if the handler fired. Its request filter also matched a literal
".rsc" path suffix, which this project never emits (_rsc is a query
param), so switch to the shared isAppRouterRscRequestForPath helper.

Refs #2716.
2026-07-27 13:05:47 +01:00
..