Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
huozhi committed Aug 15, 2021
1 parent 020ad64 commit 5d1dd0b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/acceptance/ReactRefreshLogBox.dev.test.js
Expand Up @@ -1130,6 +1130,16 @@ test('<Link> with multiple children', async () => {
expect(await session.getRedboxDescription()).toMatchInlineSnapshot(
`"Error: Multiple children were passed to <Link> with \`href\` of \`/\` but only one child is supported https://nextjs.org/docs/messages/link-multiple-children"`
)
expect(
await session.evaluate(
() =>
document
.querySelector('body > nextjs-portal')
.shadowRoot.querySelector(
'#nextjs__container_errors_desc a:nth-of-type(1)'
).href
)
).toMatch('https://nextjs.org/docs/messages/link-multiple-children')

await cleanup()
})
Expand Down
1 change: 1 addition & 0 deletions test/integration/link-ref/pages/class.js
Expand Up @@ -10,5 +10,6 @@ class MyLink extends React.Component {
export default () => (
<Link href="/" passHref>
<MyLink />
<a>no</a>
</Link>
)

0 comments on commit 5d1dd0b

Please sign in to comment.