Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
huozhi committed Aug 4, 2021
1 parent 4af3acc commit 18e6a60
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions test/integration/react-18/prerelease/components/bar.js
Expand Up @@ -10,6 +10,9 @@ const Foo = dynamic(() => import('./foo'), {
})

export default function Bar() {
if (typeof window === 'undefined') {
throw new Promise((resolve) => setTimeout(resolve, 300))
}
return (
<div>
bar
Expand Down
8 changes: 4 additions & 4 deletions test/integration/react-18/test/dynamic.js
Expand Up @@ -43,9 +43,9 @@ export default (context, render) => {
const $ = await get$('/suspense/thrown')
const html = $('body').html()
expect(html).toContain('loading')
expect(JSON.parse($('#__NEXT_DATA__').html()).dynamicIds).toContain(
'./components/hello.js'
)
expect(
JSON.parse($('#__NEXT_DATA__').text()).dynamicIds
).toBeUndefined()
})

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

it('should render nothing on server side', async () => {
it('should render nothing on server side under Suspense', async () => {
const $ = await get$('/suspense/thrown')
const text = $('#__next').text()
expect(text).toBe('')
Expand Down

0 comments on commit 18e6a60

Please sign in to comment.