Skip to content

Commit

Permalink
Fix "should SSR SPR page correctly" test
Browse files Browse the repository at this point in the history
  • Loading branch information
Timer committed Feb 12, 2020
1 parent 2e1042b commit 6cb8fb0
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions test/integration/prerender/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,12 +254,9 @@ const runTests = (dev = false) => {
it('should SSR SPR page correctly', async () => {
const html = await renderViaHTTP(appPort, '/blog/post-1')

if (dev) {
const $ = cheerio.load(html)
expect(JSON.parse($('#__NEXT_DATA__').text()).isFallback).toBe(true)
} else {
expect(html).toMatch(/Post:.*?post-1/)
}
const $ = cheerio.load(html)
expect(JSON.parse($('#__NEXT_DATA__').text()).isFallback).toBe(false)
expect(html).toMatch(/Post:.*?post-1/)
})

it('should not supply query values to params or useRouter non-dynamic page SSR', async () => {
Expand Down

0 comments on commit 6cb8fb0

Please sign in to comment.