/* eslint-env jest */
import { sandbox } from './helpers'
jest.setTimeout(1000 * 60 * 5)
// https://github.com/zeit/next.js/issues/12422
test('styled-components hydration mismatch', async () => {
const files = new Map()
files.set(
'pages/_document.js',
`
import Document from 'next/document'
import { ServerStyleSheet } from 'styled-components'
export default class MyDocument extends Document {
static async getInitialProps(ctx) {
const sheet = new ServerStyleSheet()
const originalRenderPage = ctx.renderPage
try {
ctx.renderPage = () =>
originalRenderPage({
enhanceApp: App => props => sheet.collectStyles(