Commit 792f2f8c authored by JJ Kasper's avatar JJ Kasper Committed by Joe Haddad

Add test for forward nav after reload (#9452)

parent 57fa38a3
...@@ -78,14 +78,29 @@ describe('Client Navigation', () => { ...@@ -78,14 +78,29 @@ describe('Client Navigation', () => {
const browser = await webdriver(context.appPort, '/nav') const browser = await webdriver(context.appPort, '/nav')
await browser.elementByCss('#about-link').click() await browser.elementByCss('#about-link').click()
await browser.waitForElementByCss('.nav-about') await browser.waitForElementByCss('.nav-about')
await browser.eval(`window.location.href = window.location.href`) await browser.refresh()
await waitFor(5000) await waitFor(3000)
await browser.eval(`window.history.back()`) await browser.back()
await waitFor(3000) await waitFor(3000)
const text = await browser.elementsByCss('#about-link').text() const text = await browser.elementsByCss('#about-link').text()
if (browser) await browser.close()
expect(text).toMatch(/About/) expect(text).toMatch(/About/)
}) })
it('should navigate forwards after reload', async () => {
const browser = await webdriver(context.appPort, '/nav')
await browser.elementByCss('#about-link').click()
await browser.waitForElementByCss('.nav-about')
await browser.back()
await browser.refresh()
await waitFor(3000)
await browser.forward()
await waitFor(3000)
const text = await browser.elementsByCss('p').text()
if (browser) await browser.close()
expect(text).toMatch(/this is the about page/i)
})
it('should navigate via the client side', async () => { it('should navigate via the client side', async () => {
const browser = await webdriver(context.appPort, '/nav') const browser = await webdriver(context.appPort, '/nav')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment