Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Janpot committed Jul 19, 2020
1 parent 6b31288 commit fe0d6c4
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions test/integration/basepath/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ const runTests = (context, dev = false) => {
}
})

it('should use urls without basepath in router events', async () => {
it('should use urls with basepath in router events', async () => {
const browser = await webdriver(context.appPort, '/docs/hello')
try {
await browser.eval('window._clearEventLog()')
Expand All @@ -519,32 +519,32 @@ const runTests = (context, dev = false) => {

const eventLog = await browser.eval('window._getEventLog()')
expect(eventLog).toEqual([
['routeChangeStart', '/other-page'],
['beforeHistoryChange', '/other-page'],
['routeChangeComplete', '/other-page'],
['routeChangeStart', '/docs/other-page'],
['beforeHistoryChange', '/docs/other-page'],
['routeChangeComplete', '/docs/other-page'],
])
} finally {
await browser.close()
}
})

it('should use urls without basepath in router events for hash changes', async () => {
it('should use urls with basepath in router events for hash changes', async () => {
const browser = await webdriver(context.appPort, '/docs/hello')
try {
await browser.eval('window._clearEventLog()')
await browser.elementByCss('#hash-change').click()

const eventLog = await browser.eval('window._getEventLog()')
expect(eventLog).toEqual([
['hashChangeStart', '/hello#some-hash'],
['hashChangeComplete', '/hello#some-hash'],
['hashChangeStart', '/docs/hello#some-hash'],
['hashChangeComplete', '/docs/hello#some-hash'],
])
} finally {
await browser.close()
}
})

it('should use urls without basepath in router events for cancelled routes', async () => {
it('should use urls with basepath in router events for cancelled routes', async () => {
const browser = await webdriver(context.appPort, '/docs/hello')
try {
await browser.eval('window._clearEventLog()')
Expand All @@ -557,18 +557,18 @@ const runTests = (context, dev = false) => {

const eventLog = await browser.eval('window._getEventLog()')
expect(eventLog).toEqual([
['routeChangeStart', '/slow-route'],
['routeChangeError', 'Route Cancelled', true, '/slow-route'],
['routeChangeStart', '/other-page'],
['beforeHistoryChange', '/other-page'],
['routeChangeComplete', '/other-page'],
['routeChangeStart', '/docs/slow-route'],
['routeChangeError', 'Route Cancelled', true, '/docs/slow-route'],
['routeChangeStart', '/docs/other-page'],
['beforeHistoryChange', '/docs/other-page'],
['routeChangeComplete', '/docs/other-page'],
])
} finally {
await browser.close()
}
})

it('should use urls without basepath in router events for failed route change', async () => {
it('should use urls with basepath in router events for failed route change', async () => {
const browser = await webdriver(context.appPort, '/docs/hello')
try {
await browser.eval('window._clearEventLog()')
Expand All @@ -578,12 +578,12 @@ const runTests = (context, dev = false) => {

const eventLog = await browser.eval('window._getEventLog()')
expect(eventLog).toEqual([
['routeChangeStart', '/error-route'],
['routeChangeStart', '/docs/error-route'],
[
'routeChangeError',
'Failed to load static props',
null,
'/error-route',
'/docs/error-route',
],
])
} finally {
Expand Down

0 comments on commit fe0d6c4

Please sign in to comment.