2020-07-29 08:56:33 +02:00
|
|
|
/* 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',
|
|
|
|
},
|
2022-12-01 05:01:29 +01:00
|
|
|
'to another page'
|
2020-07-29 08:56:33 +02:00
|
|
|
)
|
|
|
|
const html = ReactDOM.renderToString(element)
|
|
|
|
expect(html).toMatchInlineSnapshot(
|
2023-10-19 19:38:24 +02:00
|
|
|
`"<a href="/my-path">to another page</a>"`
|
2020-07-29 08:56:33 +02:00
|
|
|
)
|
|
|
|
})
|
|
|
|
})
|