Implement the main dashboard / projects list page for Syndarix as the landing page after login. The implementation includes: Dashboard Components: - QuickStats: Overview cards showing active projects, agents, issues, approvals - ProjectsSection: Grid/list view with filtering and sorting controls - ProjectCardGrid: Rich project cards for grid view - ProjectRowList: Compact rows for list view - ActivityFeed: Real-time activity sidebar with connection status - PerformanceCard: Performance metrics display - EmptyState: Call-to-action for new users - ProjectStatusBadge: Status indicator with icons - ComplexityIndicator: Visual complexity dots - ProgressBar: Accessible progress bar component Features: - Projects grid/list view with view mode toggle - Filter by status (all, active, paused, completed, archived) - Sort by recent, name, progress, or issues - Quick stats overview with counts - Real-time activity feed sidebar with live/reconnecting status - Performance metrics card - Create project button linking to wizard - Responsive layout for mobile/desktop - Loading skeleton states - Empty state for new users API Integration: - useProjects hook for fetching projects (mock data until backend ready) - useDashboardStats hook for statistics - TanStack Query for caching and data fetching Testing: - 37 unit tests covering all dashboard components - E2E test suite for dashboard functionality - Accessibility tests (keyboard nav, aria attributes, heading hierarchy) Technical: - TypeScript strict mode compliance - ESLint passing - WCAG AA accessibility compliance - Mobile-first responsive design - Dark mode support via semantic tokens - Follows design system guidelines 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
E2E Testing with Playwright
Overview
This directory contains end-to-end (E2E) tests for the authentication system using Playwright. These tests verify the complete user flows in a real browser environment.
Test Coverage
-
Login Flow (
auth-login.spec.ts)- Form validation
- Invalid credentials handling
- Successful login
- Navigation between auth pages
- Password visibility toggle
- Loading states
-
Registration Flow (
auth-register.spec.ts)- Form validation (email, first_name, password, confirmPassword)
- Field-specific validation errors
- Duplicate email handling
- Successful registration
- Navigation and UI interactions
-
Password Reset Flow (
auth-password-reset.spec.ts)- Request reset email validation
- Success message display
- Confirm with token validation
- Missing/invalid token handling
- Password strength validation
- Password mismatch validation
-
AuthGuard Protection (
auth-guard.spec.ts)- Route protection
- Public route access
- Token persistence
- Logout behavior
- Expired token handling
- Intended destination preservation
Running Tests
# Run all E2E tests
npm run test:e2e
# Run tests in specific browser
npm run test:e2e -- --project=chromium
npm run test:e2e -- --project=firefox
npm run test:e2e -- --project=webkit
# Run tests in headed mode (see browser)
npm run test:e2e -- --headed
# Run specific test file
npm run test:e2e -- auth-login.spec.ts
# Debug mode
npm run test:e2e -- --debug
Current Status
Comprehensive E2E test coverage across all authentication flows. Tests are designed to be non-flaky with proper waits and selectors.
Run npm run test:e2e to verify current status.
Prerequisites
- Dev Server: Must be running on
localhost:3000 - Backend API: Should be running on
localhost:8000(optional for some tests) - Playwright Browsers: Auto-installed via
npx playwright install
Configuration
See playwright.config.ts for:
- Browser targets (Chromium, Firefox, WebKit)
- Base URL configuration
- Screenshot and video settings
- Parallel execution settings
Test Structure
Each test file follows this pattern:
test.describe('Feature Name', () => {
test.beforeEach(async ({ page }) => {
// Setup before each test
await page.goto('/route');
});
test('should do something', async ({ page }) => {
// Test implementation
await expect(page.locator('selector')).toBeVisible();
});
});
Best Practices
- Wait for elements - Use
await expect().toBeVisible()instead ofpage.waitForSelector() - Unique selectors - Prefer
data-testid,role, or specific text over generic CSS - Avoid hardcoded delays - Use Playwright's auto-waiting instead of
waitForTimeout() - Test independence - Each test should be able to run in isolation
- Clean state - Clear cookies and storage before each test
Debugging
# Run with UI mode
npx playwright test --ui
# Generate trace
npm run test:e2e -- --trace on
# View test report
npx playwright show-report
Future Enhancements
- Add API mocking for consistent test data
- Add visual regression testing
- Add accessibility testing (axe-core)
- Add performance testing
- Integrate with CI/CD pipeline
- Add test data fixtures
- Add page object models for better maintainability