diff --git a/test/e2e/type-module-interop/index.test.ts b/test/e2e/type-module-interop/index.test.ts index 21e13a32586b..918ceaef1151 100644 --- a/test/e2e/type-module-interop/index.test.ts +++ b/test/e2e/type-module-interop/index.test.ts @@ -2,6 +2,7 @@ import { createNext } from 'e2e-utils' import { NextInstance } from 'test/lib/next-modes/base' import { hasRedbox, renderViaHTTP } from 'next-test-utils' import webdriver from 'next-webdriver' +import cheerio from 'cheerio' describe('Type module interop', () => { let next: NextInstance @@ -14,6 +15,21 @@ describe('Type module interop', () => { return

hello world

} `, + 'pages/modules.jsx': ` + import Link from 'next/link' + import Image from 'next/image' + + export default function Modules() { + return ( + <> + + link to home + + + + ) + } + `, }, dependencies: {}, }) @@ -39,4 +55,16 @@ describe('Type module interop', () => { expect(await hasRedbox(browser)).toBe(false) await browser.close() }) + + it('should render server-side with modules', async () => { + const html = await renderViaHTTP(next.url, '/modules') + const $ = cheerio.load(html) + expect($('#link-to-home').text()).toBe('link to home') + }) + + it('should render client-side with modules', async () => { + const browser = await webdriver(next.url, '/modules') + expect(await hasRedbox(browser)).toBe(false) + await browser.close() + }) })