Skip to content

Commit 574d900

Browse files
committed
update tests
1 parent dd7b85b commit 574d900

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

test/integration/react-18/prerelease/components/bar.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ const Foo = dynamic(() => import('./foo'), {
1010
})
1111

1212
export default function Bar() {
13+
if (typeof window === 'undefined') {
14+
throw new Promise((resolve) => setTimeout(resolve, 300))
15+
}
1316
return (
1417
<div>
1518
bar

test/integration/react-18/test/dynamic.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ export default (context, render) => {
4343
const $ = await get$('/suspense/thrown')
4444
const html = $('body').html()
4545
expect(html).toContain('loading')
46-
expect(JSON.parse($('#__NEXT_DATA__').html()).dynamicIds).toContain(
47-
'./components/hello.js'
48-
)
46+
expect(
47+
JSON.parse($('#__NEXT_DATA__').text()).dynamicIds
48+
).toBeUndefined()
4949
})
5050

5151
it('should hydrate suspenses on client side', async () => {
@@ -86,7 +86,7 @@ export default (context, render) => {
8686
beforeAll(() => writeDynamicTestComponent({ suspense: false, ssr: false }))
8787
afterAll(() => page.restore())
8888

89-
it('should render nothing on server side', async () => {
89+
it('should render nothing on server side under Suspense', async () => {
9090
const $ = await get$('/suspense/thrown')
9191
const text = $('#__next').text()
9292
expect(text).toBe('')

0 commit comments

Comments
 (0)