mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #752] [MERGED] test: E2E verification for layout persistence flat payload pipeline #816
Labels
No labels
enhancement
enhancement
good first issue
help wanted
nextjs-tracking
nextjs-tracking
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vinext#816
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/cloudflare/vinext/pull/752
Author: @NathanDrake2406
Created: 4/2/2026
Status: ✅ Merged
Merged: 4/10/2026
Merged by: @james-elicx
Base:
main← Head:feat/layout-persistence-pr-3-verification📝 Commits (6)
ef318c2test: add E2E verification for layout persistence flat payload pipelinea04bf15test: harden layout persistence hydration assertionse32ebfbtest: address layout-persistence spec gaps92be4cftest: tighten not.toBeAttached() assertions for absent elements7a73a1dchore: trigger CI3bb92cdtest: address review feedback on layout-persistence spec📊 Changes
8 files changed (+379 additions, -0 deletions)
View changed files
➕
tests/e2e/app-router/layout-persistence.spec.ts(+311 -0)➕
tests/fixtures/app-basic/app/components/layout-counter.tsx(+21 -0)➕
tests/fixtures/app-basic/app/components/template-counter.tsx(+22 -0)📝
tests/fixtures/app-basic/app/dashboard/layout.tsx(+9 -0)📝
tests/fixtures/app-basic/app/dashboard/page.tsx(+5 -0)📝
tests/fixtures/app-basic/app/error-test/error.tsx(+5 -0)📝
tests/fixtures/app-basic/app/page.tsx(+3 -0)📝
tests/fixtures/app-basic/app/template.tsx(+3 -0)📄 Description
Summary
Part of #726 (PR 3). Pure test code — zero production changes. Proves the flat keyed map payload pipeline from PR 2c actually works end-to-end in a real browser.
Every test answers: "would a real user notice if this broke?" Layout state surviving navigation, template state resetting on segment change, errors clearing on re-navigation — these are observable user behaviors, not implementation details.
What's tested
page.goto()resets counter vs Link click preserving it/→/about(segment changes)/dashboard→/dashboard/settings(same top-level segment)goBack()/goForward()through dashboard history@teamand@analyticsslot content survives/dashboard→/dashboard/settings/dashboard/settingsrendersdefault.tsxinstead of page slot contentWhat's NOT tested here (and why)
shouldHardNavigateintests/app-browser-entry.test.tsFixture changes
Minimal additions to
tests/fixtures/app-basic/to make behaviors observable:app/components/layout-counter.tsx—"use client"counter proving layout persistenceapp/components/template-counter.tsx—"use client"counter proving template remountapp/dashboard/layout.tsx— added LayoutCounter + nav links between dashboard pagesapp/template.tsx— added TemplateCounterapp/error-test/error.tsx— added "Go home" Link for error recovery navigationapp/page.tsx— added "Error Test" LinkAll existing E2E tests (navigation, error-handling, navigation-flows — 25 tests) still pass with these fixture changes.
Test plan
tests/e2e/app-router/layout-persistence.spec.ts— 8 E2E tests, all passingtests/app-router.test.ts -t "not-found|forbidden|unauthorized"— 5 SSR integration tests, all passingvp check— 0 lint/type errors🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.