diff --git a/__tests__/cases/expand-to-target.ts b/__tests__/cases/expand-to-target.ts new file mode 100644 index 0000000..bb55683 --- /dev/null +++ b/__tests__/cases/expand-to-target.ts @@ -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')) + }) +})