Skip to content

Commit

Permalink
Fix Prerender Test Cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Timer committed Mar 6, 2020
1 parent 49369d7 commit 2092c65
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/integration/prerender/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -377,21 +377,21 @@ const runTests = (dev = false, looseMode = false) => {

it('should reload page on failed data request', async () => {
const browser = await webdriver(appPort, '/')
await browser.eval('window.beforeClick = true')
await browser.eval('window.beforeClick = "abc"')
await browser.elementByCss('#broken-post').click()
await waitFor(1000)
expect(await browser.eval('window.beforeClick')).not.toBe('true')
expect(await browser.eval('window.beforeClick')).not.toBe('abc')
})

// TODO: dev currently renders this page as blocking, meaning it shows the
// server error instead of continously retrying. Do we want to change this?
if (!dev) {
it('should reload page on failed data request, and retry', async () => {
const browser = await webdriver(appPort, '/')
await browser.eval('window.beforeClick = true')
await browser.eval('window.beforeClick = "abc"')
await browser.elementByCss('#broken-at-first-post').click()
await waitFor(3000)
expect(await browser.eval('window.beforeClick')).not.toBe('true')
expect(await browser.eval('window.beforeClick')).not.toBe('abc')

const text = await browser.elementByCss('#params').text()
expect(text).toMatch(/post.*?post-999/)
Expand Down

0 comments on commit 2092c65

Please sign in to comment.