Gitako/__tests__/cases/pjax.internal.ts
2020-11-28 00:46:42 +08:00

29 lines
699 B
TypeScript

import {
expectToFind,
expectToNotFind,
patientClick,
selectFileTreeItem,
sleep,
waitForPJAXAPIRedirect,
} from '../utils'
describe(`in Gitako project page`, () => {
beforeAll(() => page.goto('https://github.com/EnixCoda/Gitako'))
it('should work with PJAX', async () => {
await sleep(3000)
await patientClick(page, selectFileTreeItem('.babelrc'))
await waitForPJAXAPIRedirect()
// The selector for file content
await expectToFind('table.js-file-line-container')
page.goBack()
await waitForPJAXAPIRedirect()
// The selector for file content
await expectToNotFind('table.js-file-line-container')
// await waitForPJAXAPIRedirect()
})
})