Skip to content

[Web UI] Set up vitest testing infrastructure #103

@santoshkumarradha

Description

@santoshkumarradha

Summary

The Web UI currently has zero test coverage. Set up vitest testing infrastructure to enable unit testing of React components and hooks.

Current State

  • Location: control-plane/web/client/
  • Framework: React + TypeScript + Vite
  • Test files: None (0 test files exist)
  • Components: 216 React components untested

Tasks

  1. Install vitest and React Testing Library as dev dependencies
  2. Create vitest.config.ts configuration file
  3. Set up test utilities and mocks for common patterns
  4. Add a simple example test for one component (e.g., StatusBadge.tsx)
  5. Add test scripts to package.json (test, test:watch, test:coverage)

Acceptance Criteria

  • npm test runs vitest successfully
  • At least one example test passes
  • Test coverage can be generated with npm run test:coverage
  • Configuration supports testing React components with jsdom environment

Files to Modify/Create

  • control-plane/web/client/vitest.config.ts (new)
  • control-plane/web/client/src/test/setup.ts (new)
  • control-plane/web/client/package.json (add devDependencies and scripts)
  • control-plane/web/client/src/components/ui/StatusBadge.test.tsx (example test)

Resources


Using AI to solve this issue? Read our AI-Assisted Contributions guide for testing requirements, prompt strategies, and common pitfalls to avoid.

Metadata

Metadata

Assignees

Labels

area:web-uiReact web UI functionalitygood first issueGood for newcomerstestsUnit test improvements and coverage

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions