rsnext/test/unit/link-rendering.test.ts
JJ Kasper 4a7ab34baf
Update repo to use react 18 by default (#35888)
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
2022-04-05 21:51:47 +00:00

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>"`
)
})
})