MCPcopy Index your code
hub / github.com/callumalpass/tasknotes / expandViewsFolderForRelationships

Function expandViewsFolderForRelationships

e2e/tasknotes.spec.ts:978–1003  ·  view source on GitHub ↗
(page: Page)

Source from the content-addressed store, hash-verified

976test.describe('Relationships View', () => {
977 // Helper to expand TaskNotes and Views folders
978 async function expandViewsFolderForRelationships(page: Page): Promise<void> {
979 // First ensure the sidebar is expanded
980 await ensureSidebarExpanded(page);
981
982 // First expand TaskNotes folder if collapsed
983 const tasknotesFolder = page.locator('.nav-folder-title').filter({ hasText: /^TaskNotes$/ }).first();
984 if (await tasknotesFolder.isVisible({ timeout: 5000 }).catch(() => false)) {
985 const parentFolder = tasknotesFolder.locator('xpath=ancestor::div[contains(@class, "nav-folder")][1]');
986 const isTasknotesCollapsed = await parentFolder.evaluate(el => el.classList.contains('is-collapsed')).catch(() => true);
987 if (isTasknotesCollapsed) {
988 await tasknotesFolder.click();
989 await page.waitForTimeout(500);
990 }
991 }
992
993 // Then expand Views folder if collapsed
994 const viewsFolder = page.locator('.nav-folder-title').filter({ hasText: /^Views$/ });
995 if (await viewsFolder.isVisible({ timeout: 5000 }).catch(() => false)) {
996 const parentFolder = viewsFolder.locator('xpath=ancestor::div[contains(@class, "nav-folder")][1]');
997 const isCollapsed = await parentFolder.evaluate(el => el.classList.contains('is-collapsed')).catch(() => true);
998 if (isCollapsed) {
999 await viewsFolder.click();
1000 await page.waitForTimeout(500);
1001 }
1002 }
1003 }
1004
1005 test('should open relationships view via sidebar', async () => {
1006 const page = getPage();

Callers 1

tasknotes.spec.tsFile · 0.85

Calls 2

ensureSidebarExpandedFunction · 0.85
containsMethod · 0.80

Tested by

no test coverage detected