Skip to content

Conversation

@joshunrau
Copy link
Collaborator

@joshunrau joshunrau commented Jan 21, 2026

Summary by CodeRabbit

  • Tests

    • Added end-to-end tests verifying authentication redirects and dashboard functionality.
    • Enhanced test setup with automated creation of test groups and users.
  • Chores

    • Refactored test infrastructure to support improved page model routing.
    • Removed Safari from browser testing matrix; maintained Chrome and Firefox support.
    • Updated TypeScript and testing configurations for enhanced type safety.

✏️ Tip: You can customize this high-level summary in your review settings.

@joshunrau joshunrau merged commit c8a7147 into DouglasNeuroInformatics:main Jan 21, 2026
0 of 2 checks passed
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 21, 2026

Caution

Review failed

The pull request is closed.

Walkthrough

End-to-end test infrastructure refactored with type-safe page object patterns and fixtures. Vite type declarations moved from config to declaration file. E2E tests restructured to use page models with generic navigation, new login and dashboard page objects added, and Safari browser support removed from test configuration.

Changes

Cohort / File(s) Summary
Vite Configuration
apps/web/src/vite-env.d.ts, apps/web/tsconfig.json
Added Vite client type reference directive to vite-env.d.ts; removed duplicate "vite/client" types entry from tsconfig.json compilerOptions
E2E Test Configuration
testing/e2e/package.json, testing/e2e/playwright.config.ts, testing/e2e/tsconfig.json
Added test:chrome npm script and type-fest dependency; removed Safari project from Playwright config, enabled Firefox headless mode; added DOM lib to TypeScript config
E2E Type System & Helpers
testing/e2e/src/helpers/types.ts, testing/e2e/src/helpers/data.ts, testing/e2e/src/helpers/fixtures.ts
Removed Safari from BrowserTarget; introduced routing types (ExtractParams, NavigateArgs, RouteTo, RouteParams); added TestDataMap utility; refactored fixtures with generic pageModels router, login workflow, and getProjectMetadata worker; replaced setupPage with getPageModel and login helpers
E2E Page Objects
testing/e2e/src/pages/__root.page.ts, testing/e2e/src/pages/_app.page.ts, testing/e2e/src/pages/auth/login.page.ts, testing/e2e/src/pages/dashboard.page.ts, testing/e2e/src/pages/datahub/subject-data-table.page.ts, testing/e2e/src/pages/setup.page.ts
Replaced RootPage.goto() with generic typed variant using NavigateArgs; removed defaultUrl abstract property; added AppPage base class with sidebar locator; new LoginPage with fillLoginForm method; new DashboardPage extending AppPage; new SubjectDataTablePage; removed defaultUrl from SetupPage
E2E Test Specs
testing/e2e/src/1.1-auth.spec.ts, testing/e2e/src/1.2-dashboard.spec.ts, testing/e2e/src/global/global.setup.spec.ts
New auth redirect test (/ → /auth/login); new dashboard test with header visibility check; global setup enhanced to create groups and users via API before tests

Sequence Diagram(s)

sequenceDiagram
    participant Test as E2E Test
    participant Fixtures as Fixture Setup
    participant Login as LoginPage
    participant API as App API
    participant Dashboard as DashboardPage
    
    Test->>Fixtures: call login()
    Fixtures->>Fixtures: getProjectMetadata(browserTarget)
    Fixtures->>Login: getPageModel('/auth/login')
    Fixtures->>Login: goto('/auth/login')
    Fixtures->>Login: fillLoginForm(credentials)
    Login->>Login: fill username & password fields
    Login->>Login: click Submit button
    Login->>API: POST login credentials
    API-->>Login: 200 OK, redirect
    Fixtures->>API: assert navigation to /dashboard
    Fixtures-->>Test: login complete
    Test->>Dashboard: getPageModel('/dashboard')
    Test->>Dashboard: pageHeader locator
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • PR #1226: Type renaming of LoginCredentials to $LoginCredentials and related schema/type updates align with this PR's introduction of $LoginCredentials usage in new login page objects and fixtures
✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant