4a7ab34baf
This updates our `yarn next` command to leverage react v18 by default and removes the need for the test require hook/config modifying when testing react 18. There are some fixtures we need to investigate react 18 support in follow-ups: - `test/integration/client-navigation-a11y` - `test/integration/critical-css` - `test/integration/custom-error-page-exception` - `test/integration/font-optimization` - AMP specific tests
20 lines
518 B
TypeScript
20 lines
518 B
TypeScript
/* eslint-env jest */
|
|
import React from 'react'
|
|
import ReactDOM from 'react-dom/server'
|
|
import Link from 'next/link'
|
|
|
|
describe('Link rendering', () => {
|
|
it('should render Link on its own', async () => {
|
|
const element = React.createElement(
|
|
Link,
|
|
{
|
|
href: '/my-path',
|
|
},
|
|
React.createElement('a', {}, 'to another page')
|
|
)
|
|
const html = ReactDOM.renderToString(element)
|
|
expect(html).toMatchInlineSnapshot(
|
|
`"<a href=\\"/my-path\\">to another page</a>"`
|
|
)
|
|
})
|
|
})
|