forked from vercel/next.js
/
back-button-download-bug.test.ts
42 lines (35 loc) · 1.1 KB
/
back-button-download-bug.test.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import { createNext, FileRef } from 'e2e-utils'
import { NextInstance } from 'test/lib/next-modes/base'
import path from 'path'
import webdriver from 'next-webdriver'
// TODO-APP: fix test as it's failing randomly
describe.skip('app-dir back button download bug', () => {
if ((global as any).isNextDeploy) {
it('should skip next deploy for now', () => {})
return
}
let next: NextInstance
beforeAll(async () => {
next = await createNext({
files: new FileRef(path.join(__dirname, 'back-button-download-bug')),
dependencies: {
react: 'latest',
'react-dom': 'latest',
},
skipStart: true,
})
await next.start()
})
afterAll(() => next.destroy())
it('should redirect route when clicking link', async () => {
const browser = await webdriver(next.url, '/')
const text = await browser
.elementByCss('#to-post-1')
.click()
.waitForElementByCss('#post-page')
.text()
expect(text).toBe('This is the post page')
await browser.back()
expect(await browser.waitForElementByCss('#home-page').text()).toBe('Home!')
})
})