Add backend unit test framework and modularize settings UI

Introduced a Vitest-based backend unit testing framework with supporting scripts, helpers, and GitHub Actions integration. Refactored the admin settings page to a modular architecture, splitting monolithic logic into feature-specific tabs and hooks for improved maintainability and testability. Updated documentation to reflect the new testing setup and settings architecture, and added new dependencies for testing utilities.
This commit is contained in:
kikootwo
2026-01-15 16:49:59 -05:00
parent b3f89d67bb
commit 94dbaf073b
127 changed files with 23549 additions and 2868 deletions
+28
View File
@@ -0,0 +1,28 @@
# Testing
**Status:** ⏳ In Progress | Backend unit testing framework (Vitest)
## Overview
Unit tests for backend logic with isolated mocks (Prisma, integrations, queue).
## Key Details
- **Runner:** Vitest (`vitest.config.ts`, Node environment)
- **Setup:** `tests/setup.ts` sets `NODE_ENV=test`, `TZ=UTC`, blocks unmocked fetch
- **Helpers:** `tests/helpers/prisma.ts`, `tests/helpers/job-queue.ts`
- **GitHub Actions:** Manual workflow `.github/workflows/manual-tests.yml` runs `npm test`
- **Coverage:** `npm run test:coverage` (reports in `coverage/`)
- **Scope:** Backend unit tests only; no real network or services
## API/Interfaces
```
npm run test
npm run test:watch
npm run test:coverage
```
## Critical Issues
- API route unit tests are incomplete; add route-level mocks before enforcing coverage.
## Related
- [backend/services/jobs.md](backend/services/jobs.md)
- [backend/services/scheduler.md](backend/services/scheduler.md)