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
...@@ -78,10 +78,10 @@ describe('Error overlay for hydration errors in Pages router', () => { ...@@ -78,10 +78,10 @@ describe('Error overlay for hydration errors in Pages router', () => {
[ [
{ {
"componentStack": "<Mismatch> "componentStack": "<Mismatch>
<div> <div>
<main> <main>
+ "server" + "server"
- "client"", - "client"",
"description": "Text content did not match. Server: "server" Client: "client"", "description": "Text content did not match. Server: "server" Client: "client"",
"environmentLabel": null, "environmentLabel": null,
"label": "Recoverable Error", "label": "Recoverable Error",
...@@ -167,8 +167,8 @@ describe('Error overlay for hydration errors in Pages router', () => { ...@@ -167,8 +167,8 @@ describe('Error overlay for hydration errors in Pages router', () => {
[ [
{ {
"componentStack": "<Mismatch> "componentStack": "<Mismatch>
> <div> > <div>
> <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,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -177,8 +177,8 @@ describe('Error overlay for hydration errors in Pages router', () => { ...@@ -177,8 +177,8 @@ describe('Error overlay for hydration errors in Pages router', () => {
}, },
{ {
"componentStack": "<Mismatch> "componentStack": "<Mismatch>
> <div> > <div>
> <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,
"label": "Recoverable Error", "label": "Recoverable Error",
...@@ -246,10 +246,9 @@ describe('Error overlay for hydration errors in Pages router', () => { ...@@ -246,10 +246,9 @@ 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>.",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -257,10 +256,9 @@ describe('Error overlay for hydration errors in Pages router', () => { ...@@ -257,10 +256,9 @@ 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>.",
"environmentLabel": null, "environmentLabel": null,
"label": "Recoverable Error", "label": "Recoverable Error",
...@@ -325,7 +323,7 @@ describe('Error overlay for hydration errors in Pages router', () => { ...@@ -325,7 +323,7 @@ describe('Error overlay for hydration errors in Pages router', () => {
[ [
{ {
"componentStack": "<Mismatch> "componentStack": "<Mismatch>
> <div>", > <div>",
"description": "Did not expect server HTML to contain a <main> in <div>.", "description": "Did not expect server HTML to contain a <main> in <div>.",
"environmentLabel": null, "environmentLabel": null,
"label": "Recoverable Error", "label": "Recoverable Error",
...@@ -383,10 +381,9 @@ describe('Error overlay for hydration errors in Pages router', () => { ...@@ -383,10 +381,9 @@ 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>.",
"environmentLabel": null, "environmentLabel": null,
"label": "Recoverable Error", "label": "Recoverable Error",
...@@ -459,7 +456,7 @@ describe('Error overlay for hydration errors in Pages router', () => { ...@@ -459,7 +456,7 @@ describe('Error overlay for hydration errors in Pages router', () => {
[ [
{ {
"componentStack": "<Page> "componentStack": "<Page>
> <table>", > <table>",
"description": "Expected server HTML to contain a matching <table> in <div>.", "description": "Expected server HTML to contain a matching <table> in <div>.",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -468,7 +465,7 @@ describe('Error overlay for hydration errors in Pages router', () => { ...@@ -468,7 +465,7 @@ describe('Error overlay for hydration errors in Pages router', () => {
}, },
{ {
"componentStack": "<Page> "componentStack": "<Page>
> <table>", > <table>",
"description": "Expected server HTML to contain a matching <table> in <div>.", "description": "Expected server HTML to contain a matching <table> in <div>.",
"environmentLabel": null, "environmentLabel": null,
"label": "Recoverable Error", "label": "Recoverable Error",
...@@ -535,7 +532,7 @@ describe('Error overlay for hydration errors in Pages router', () => { ...@@ -535,7 +532,7 @@ describe('Error overlay for hydration errors in Pages router', () => {
[ [
{ {
"componentStack": "<Page> "componentStack": "<Page>
> <table>", > <table>",
"description": "Expected server HTML to contain a matching <table> in <div>.", "description": "Expected server HTML to contain a matching <table> in <div>.",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -544,7 +541,7 @@ describe('Error overlay for hydration errors in Pages router', () => { ...@@ -544,7 +541,7 @@ describe('Error overlay for hydration errors in Pages router', () => {
}, },
{ {
"componentStack": "<Page> "componentStack": "<Page>
> <table>", > <table>",
"description": "Expected server HTML to contain a matching <table> in <div>.", "description": "Expected server HTML to contain a matching <table> in <div>.",
"environmentLabel": null, "environmentLabel": null,
"label": "Recoverable Error", "label": "Recoverable Error",
...@@ -617,9 +614,8 @@ describe('Error overlay for hydration errors in Pages router', () => { ...@@ -617,9 +614,8 @@ 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,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -628,9 +624,8 @@ describe('Error overlay for hydration errors in Pages router', () => { ...@@ -628,9 +624,8 @@ 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,
"label": "Recoverable Error", "label": "Recoverable Error",
...@@ -730,8 +725,8 @@ describe('Error overlay for hydration errors in Pages router', () => { ...@@ -730,8 +725,8 @@ describe('Error overlay for hydration errors in Pages router', () => {
[ [
{ {
"componentStack": "<Page> "componentStack": "<Page>
> <p> > <p>
> <p>", > <p>",
"description": "Expected server HTML to contain a matching <p> in <p>.", "description": "Expected server HTML to contain a matching <p> in <p>.",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -740,8 +735,8 @@ describe('Error overlay for hydration errors in Pages router', () => { ...@@ -740,8 +735,8 @@ describe('Error overlay for hydration errors in Pages router', () => {
}, },
{ {
"componentStack": "<Page> "componentStack": "<Page>
> <p> > <p>
> <p>", > <p>",
"description": "Expected server HTML to contain a matching <p> in <p>.", "description": "Expected server HTML to contain a matching <p> in <p>.",
"environmentLabel": null, "environmentLabel": null,
"label": "Recoverable Error", "label": "Recoverable Error",
...@@ -811,11 +806,9 @@ describe('Error overlay for hydration errors in Pages router', () => { ...@@ -811,11 +806,9 @@ describe('Error overlay for hydration errors in Pages router', () => {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
[ [
{ {
"componentStack": "<Page> "componentStack": "<div>
<div> > <p>
<div> > <div>",
> <p>
> <div>",
"description": "Expected server HTML to contain a matching <div> in <p>.", "description": "Expected server HTML to contain a matching <div> in <p>.",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -823,11 +816,9 @@ describe('Error overlay for hydration errors in Pages router', () => { ...@@ -823,11 +816,9 @@ describe('Error overlay for hydration errors in Pages router', () => {
"stack": [], "stack": [],
}, },
{ {
"componentStack": "<Page> "componentStack": "<div>
<div> > <p>
<div> > <div>",
> <p>
> <div>",
"description": "Expected server HTML to contain a matching <div> in <p>.", "description": "Expected server HTML to contain a matching <div> in <p>.",
"environmentLabel": null, "environmentLabel": null,
"label": "Recoverable Error", "label": "Recoverable Error",
...@@ -890,8 +881,8 @@ describe('Error overlay for hydration errors in Pages router', () => { ...@@ -890,8 +881,8 @@ describe('Error overlay for hydration errors in Pages router', () => {
[ [
{ {
"componentStack": "<Page> "componentStack": "<Page>
> <div> > <div>
> <tr>", > <tr>",
"description": "Expected server HTML to contain a matching <tr> in <div>.", "description": "Expected server HTML to contain a matching <tr> in <div>.",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -900,8 +891,8 @@ describe('Error overlay for hydration errors in Pages router', () => { ...@@ -900,8 +891,8 @@ describe('Error overlay for hydration errors in Pages router', () => {
}, },
{ {
"componentStack": "<Page> "componentStack": "<Page>
> <div> > <div>
> <tr>", > <tr>",
"description": "Expected server HTML to contain a matching <tr> in <div>.", "description": "Expected server HTML to contain a matching <tr> in <div>.",
"environmentLabel": null, "environmentLabel": null,
"label": "Recoverable Error", "label": "Recoverable Error",
...@@ -965,13 +956,9 @@ describe('Error overlay for hydration errors in Pages router', () => { ...@@ -965,13 +956,9 @@ describe('Error overlay for hydration errors in Pages router', () => {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
[ [
{ {
"componentStack": "<Page> "componentStack": "<span>
<p> > <span>
<span> > <p>",
<span>
<span>
> <span>
> <p>",
"description": "Expected server HTML to contain a matching <p> in <span>.", "description": "Expected server HTML to contain a matching <p> in <span>.",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
...@@ -979,13 +966,9 @@ describe('Error overlay for hydration errors in Pages router', () => { ...@@ -979,13 +966,9 @@ describe('Error overlay for hydration errors in Pages router', () => {
"stack": [], "stack": [],
}, },
{ {
"componentStack": "<Page> "componentStack": "<span>
<p> > <span>
<span> > <p>",
<span>
<span>
> <span>
> <p>",
"description": "Expected server HTML to contain a matching <p> in <span>.", "description": "Expected server HTML to contain a matching <p> in <span>.",
"environmentLabel": null, "environmentLabel": null,
"label": "Recoverable Error", "label": "Recoverable Error",
......
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