test: expand sidebar

This commit is contained in:
EnixCoda 2021-08-01 16:02:53 +08:00
parent 3439808d63
commit 77a0e866dd

View file

@ -0,0 +1,25 @@
import {
expectToFind,
selectFileTreeItem,
sleep,
waitForLegacyPJAXRedirect
} from '../utils'
describe(`in Gitako project page`, () => {
beforeAll(() => page.goto('https://github.com/EnixCoda/Gitako/tree/develop/src'))
it('expand to target on load and after PJAX', async () => {
await sleep(3000)
// Expect Gitako sidebar to have expanded src to see contents
await expectToFind(selectFileTreeItem('src/components'))
await page.click(
`.js-details-container div[role="row"] div[role="rowheader"] [title="components"]`,
)
await waitForLegacyPJAXRedirect()
// Expect Gitako sidebar to have expanded components and see contents
await expectToFind(selectFileTreeItem('src/components/Gitako.tsx'))
})
})