Skip to content

Commit

Permalink
Merge branch 'vercel:canary' into typo-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
hugo-syn authored Jan 11, 2024
2 parents 600ae40 + 5836a49 commit 8dd9274
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 2 deletions.
20 changes: 19 additions & 1 deletion test/development/acceptance-app/hydration-error.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe('Error overlay for hydration errors', () => {
})

it('should show correct hydration error when client and server render different text', async () => {
const { cleanup, session } = await sandbox(
const { cleanup, session, browser } = await sandbox(
next,
new Map([
[
Expand Down Expand Up @@ -47,6 +47,24 @@ describe('Error overlay for hydration errors', () => {
See more info here: https://nextjs.org/docs/messages/react-hydration-error"
`)

await session.patch(
'app/page.js',
outdent`
'use client'
export default function Mismatch() {
return (
<div className="parent">
<main className="child">Value</main>
</div>
);
}
`
)

expect(await session.hasRedbox()).toBe(false)

expect(await browser.elementByCss('.child').text()).toBe('Value')

await cleanup()
})

Expand Down
19 changes: 18 additions & 1 deletion test/development/acceptance/hydration-error.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe('Error overlay for hydration errors', () => {
})

it('should show correct hydration error when client and server render different text', async () => {
const { cleanup, session } = await sandbox(
const { cleanup, session, browser } = await sandbox(
next,
new Map([
[
Expand Down Expand Up @@ -44,6 +44,23 @@ describe('Error overlay for hydration errors', () => {
See more info here: https://nextjs.org/docs/messages/react-hydration-error"
`)

await session.patch(
'index.js',
outdent`
export default function Mismatch() {
return (
<div className="parent">
<main className="child">Value</main>
</div>
);
}
`
)

expect(await session.hasRedbox()).toBe(false)

expect(await browser.elementByCss('.child').text()).toBe('Value')

await cleanup()
})
})

0 comments on commit 8dd9274

Please sign in to comment.