Testing Architecture
Overview
The Equa platform uses a layered testing strategy across frontend and backend.
Test Frameworks
| Layer | Framework | Repository | Command |
|---|
| Frontend unit tests | Jest | equa-web | yarn test |
| Frontend E2E tests | Playwright | equa-web | yarn test:e2e |
| Backend unit tests | (colocated) | equa-server | yarn test |
| Command Center E2E | Playwright | command-center-so | npx playwright test |
| Pattern library | Storybook interaction tests | equa-patternlib-nextjs | npm run storybook |
Frontend Testing (equa-web)
Unit Tests (Jest)
Source: equa-web/package.json (jest configuration)
- Location: Colocated
*.test.ts / *.test.tsx files alongside source
- Mock pattern: Pattern library mocked via
equa-web/src/shared/mocks/patternlibMock.js
- Coverage: No explicit thresholds configured
E2E Tests (Playwright)
Source: equa-web/e2e/
| Test File | Coverage |
|---|
auth-modal-security.spec.ts | Authentication modal security flows |
regression-fixed-issues.spec.ts | Regression tests for resolved bugs |
agreements.spec.ts | Agreements feature workflows |
google-auth-smoke.spec.ts | Google authentication smoke test |
Running Tests
# Unit tests
cd ~/Documents/repos/equa-web
yarn test
# E2E tests (requires frontend + backend running)
yarn test:e2e
E2E tests require both the frontend (localhost:8080) and backend (localhost:3000) to be running.
Backend Testing (equa-server)
Source: equa-server/modules/ (colocated test files)
- Framework: Varies by module (some use Jest, some use native Node test runner)
- S3Client mocking: Documented in
equa-server/modules/api/README.md
- Database: Tests run against a test database (requires PostgreSQL)
Command Center Testing
Source: command-center-so/e2e/
- Framework: Playwright
- Config:
command-center-so/playwright.config.ts
- Scope: Chat interface, gateway connection, settings, error reporting
CI Pipeline
Backend (Google Cloud Build)
Source: equa-server/cloudbuild.yaml
1. Build Docker image
2. Run tests (inside container)
3. Push to GCR
4. Deploy to Cloud Run
Frontend (Railway)
Source: equa-web/railway.toml
1. nixpacks detects Node.js
2. yarn install
3. yarn build (webpack production build)
4. Deploy
Test Data Management
- Development: Schema sync enabled (
DATABASE_SYNC !== 'false' in development)
- Production: Schema migrations managed via TypeORM
- Seed data: No automated seed scripts found
Coverage Gaps
The following areas have limited or no test coverage:
- No explicit coverage thresholds in any repository
- No automated seed data for local development testing
- No integration test suite for cross-module interactions
- No performance/load testing infrastructure
- Limited E2E coverage (4 test files for 24 frontend modules)
Recommended Improvements
- Add coverage thresholds to Jest config (target: 70% lines/branches)
- Create seed data scripts for consistent local testing
- Expand E2E test coverage to all major user flows
- Add API integration tests for endpoint validation
- Implement performance benchmarks for critical paths