Skip to main content

Testing Architecture

Overview

The Equa platform uses a layered testing strategy across frontend and backend.

Test Frameworks

LayerFrameworkRepositoryCommand
Frontend unit testsJestequa-webyarn test
Frontend E2E testsPlaywrightequa-webyarn test:e2e
Backend unit tests(colocated)equa-serveryarn test
Command Center E2EPlaywrightcommand-center-sonpx playwright test
Pattern libraryStorybook interaction testsequa-patternlib-nextjsnpm 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 FileCoverage
auth-modal-security.spec.tsAuthentication modal security flows
regression-fixed-issues.spec.tsRegression tests for resolved bugs
agreements.spec.tsAgreements feature workflows
google-auth-smoke.spec.tsGoogle 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)
  1. Add coverage thresholds to Jest config (target: 70% lines/branches)
  2. Create seed data scripts for consistent local testing
  3. Expand E2E test coverage to all major user flows
  4. Add API integration tests for endpoint validation
  5. Implement performance benchmarks for critical paths