Unverified Commit de3d0305 authored by Josh Story's avatar Josh Story Committed by GitHub

test: update React 18 hydration error snapshots (#99073)

## What

Updates the React 18 Pages Router hydration-error inline snapshots to
match the compact rendered-tree excerpts introduced by #99008.

This is a test-only change. The runtime output is already intentional
and is shared by webpack and Turbopack.

## Why this was missed

React 18 jobs are opt-in for pull requests through the
run-react-18-tests label. #99008 did not have that label, so its React
18 snapshot branches were not exercised before merge.

## Verification

- NEXT_TEST_REACT_VERSION=18.3.1 pnpm test-dev-webpack
test/development/acceptance/hydration-error.test.ts — 15 passed, 12
snapshots passed
- NEXT_TEST_REACT_VERSION=18.3.1 pnpm test-dev-turbo
test/development/acceptance/hydration-error.test.ts — 15 passed, 12
snapshots passed
- Prettier and git diff --check
parent 14ddf68e
...@@ -246,8 +246,7 @@ describe('Error overlay for hydration errors in Pages router', () => { ...@@ -246,8 +246,7 @@ describe('Error overlay for hydration errors in Pages router', () => {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
[ [
{ {
"componentStack": "<Mismatch> "componentStack": "<div>
<div>
> <div> > <div>
> "second"", > "second"",
"description": "Expected server HTML to contain a matching text node for "second" in <div>.", "description": "Expected server HTML to contain a matching text node for "second" in <div>.",
...@@ -257,8 +256,7 @@ describe('Error overlay for hydration errors in Pages router', () => { ...@@ -257,8 +256,7 @@ describe('Error overlay for hydration errors in Pages router', () => {
"stack": [], "stack": [],
}, },
{ {
"componentStack": "<Mismatch> "componentStack": "<div>
<div>
> <div> > <div>
> "second"", > "second"",
"description": "Expected server HTML to contain a matching text node for "second" in <div>.", "description": "Expected server HTML to contain a matching text node for "second" in <div>.",
...@@ -383,8 +381,7 @@ describe('Error overlay for hydration errors in Pages router', () => { ...@@ -383,8 +381,7 @@ describe('Error overlay for hydration errors in Pages router', () => {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
[ [
{ {
"componentStack": "<Mismatch> "componentStack": "<div>
<div>
> <div> > <div>
> "only"", > "only"",
"description": "Did not expect server HTML to contain the text node "only" in <div>.", "description": "Did not expect server HTML to contain the text node "only" in <div>.",
...@@ -618,7 +615,6 @@ describe('Error overlay for hydration errors in Pages router', () => { ...@@ -618,7 +615,6 @@ describe('Error overlay for hydration errors in Pages router', () => {
{ {
"componentStack": "<Mismatch> "componentStack": "<Mismatch>
> <div> > <div>
<Suspense>
> <main>", > <main>",
"description": "Expected server HTML to contain a matching <main> in <div>.", "description": "Expected server HTML to contain a matching <main> in <div>.",
"environmentLabel": null, "environmentLabel": null,
...@@ -629,7 +625,6 @@ describe('Error overlay for hydration errors in Pages router', () => { ...@@ -629,7 +625,6 @@ describe('Error overlay for hydration errors in Pages router', () => {
{ {
"componentStack": "<Mismatch> "componentStack": "<Mismatch>
> <div> > <div>
<Suspense>
> <main>", > <main>",
"description": "Expected server HTML to contain a matching <main> in <div>.", "description": "Expected server HTML to contain a matching <main> in <div>.",
"environmentLabel": null, "environmentLabel": null,
...@@ -811,9 +806,7 @@ describe('Error overlay for hydration errors in Pages router', () => { ...@@ -811,9 +806,7 @@ describe('Error overlay for hydration errors in Pages router', () => {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
[ [
{ {
"componentStack": "<Page> "componentStack": "<div>
<div>
<div>
> <p> > <p>
> <div>", > <div>",
"description": "Expected server HTML to contain a matching <div> in <p>.", "description": "Expected server HTML to contain a matching <div> in <p>.",
...@@ -823,9 +816,7 @@ describe('Error overlay for hydration errors in Pages router', () => { ...@@ -823,9 +816,7 @@ describe('Error overlay for hydration errors in Pages router', () => {
"stack": [], "stack": [],
}, },
{ {
"componentStack": "<Page> "componentStack": "<div>
<div>
<div>
> <p> > <p>
> <div>", > <div>",
"description": "Expected server HTML to contain a matching <div> in <p>.", "description": "Expected server HTML to contain a matching <div> in <p>.",
...@@ -965,11 +956,7 @@ describe('Error overlay for hydration errors in Pages router', () => { ...@@ -965,11 +956,7 @@ describe('Error overlay for hydration errors in Pages router', () => {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
[ [
{ {
"componentStack": "<Page> "componentStack": "<span>
<p>
<span>
<span>
<span>
> <span> > <span>
> <p>", > <p>",
"description": "Expected server HTML to contain a matching <p> in <span>.", "description": "Expected server HTML to contain a matching <p> in <span>.",
...@@ -979,11 +966,7 @@ describe('Error overlay for hydration errors in Pages router', () => { ...@@ -979,11 +966,7 @@ describe('Error overlay for hydration errors in Pages router', () => {
"stack": [], "stack": [],
}, },
{ {
"componentStack": "<Page> "componentStack": "<span>
<p>
<span>
<span>
<span>
> <span> > <span>
> <p>", > <p>",
"description": "Expected server HTML to contain a matching <p> in <span>.", "description": "Expected server HTML to contain a matching <p> in <span>.",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment