Skip to content

Testing Guide

This section covers testing strategies and best practices for the Hello World Co-Op platform.

Test Stack

LayerToolPurpose
Backend Unitcargo testRust canister logic
Backend IntegrationPocketICMulti-canister interactions
Frontend UnitVitestComponent logic, stores, services
Frontend ComponentReact Testing LibraryComponent rendering
E2EPlaywrightBrowser-based user flows
QAPlaywright MCPManual verification automation

Testing Guides

GuideDescription
Testing Pyramid GuidelinesWhat belongs at each test layer
PocketIC SetupHow to set up PocketIC for canister testing
Visualization TestingStrategy for charts and SVG components

Quick Start

Run Backend Tests

bash
cd <canister-repo>
cargo test

Run Frontend Tests

bash
cd foundery-os-suite
npm test              # Run all tests
npm test -- --watch   # Watch mode
npm test -- --coverage # With coverage

Run E2E Tests

bash
cd foundery-os-suite
npm run test:e2e      # Playwright tests

Test Naming Conventions

typescript
// Describe block: Component or module name
describe('BurndownChart', () => {

  // Nested describe: Feature or AC reference
  describe('rendering (AC-2.2.3.1)', () => {

    // It block: Specific behavior
    it('renders chart container with aria-label', () => {
      // ...
    });
  });
});

Test File Structure

src/
├── components/
│   └── backlog/
│       ├── BurndownChart.tsx
│       └── __tests__/
│           └── BurndownChart.test.tsx
├── stores/
│   ├── sprintStore.ts
│   └── __tests__/
│       └── sprintStore.test.ts
└── services/
    ├── sprintService.ts
    └── __tests__/
        └── sprintService.test.ts

Coverage Goals

TypeTargetNotes
Unit Tests80%+Focus on business logic
Component Tests70%+Key UI interactions
E2E TestsCritical pathsLogin, core workflows

Hello World Co-Op DAO