test: update project view tests for dashboard integration

- Modified tests to navigate directly to the dashboard instead of the welcome view, ensuring a smoother project selection process.
- Updated project name verification to check against the sidebar button instead of multiple elements.
- Added logic to expand the sidebar if collapsed, improving visibility for project names during tests.
- Adjusted test assertions to reflect changes in the UI structure, including the introduction of the dashboard view.
This commit is contained in:
webdevcody
2026-01-12 21:23:33 -05:00
parent 0c68fcc8c8
commit c796adbae8
8 changed files with 104 additions and 49 deletions

View File

@@ -152,7 +152,8 @@ export async function navigateToSetup(page: Page): Promise<void> {
}
/**
* Navigate to the welcome view (clear project selection)
* Navigate to the welcome/dashboard view (clear project selection)
* Note: The app redirects from / to /dashboard when no project is selected
*/
export async function navigateToWelcome(page: Page): Promise<void> {
// Authenticate before navigating
@@ -167,7 +168,11 @@ export async function navigateToWelcome(page: Page): Promise<void> {
// Handle login redirect if needed
await handleLoginScreenIfPresent(page);
await waitForElement(page, 'welcome-view', { timeout: 10000 });
// Wait for either welcome-view or dashboard-view (app redirects to /dashboard when no project)
await page
.locator('[data-testid="welcome-view"], [data-testid="dashboard-view"]')
.first()
.waitFor({ state: 'visible', timeout: 10000 });
}
/**