mirror of
https://github.com/kikootwo/ReadMeABook.git
synced 2026-06-03 04:40:09 +00:00
Add series fields to audiobooks and update related logic
Introduces 'series' and 'seriesPart' fields to the Audiobook model and database schema. Updates API routes, file organization, and path template utilities to support series metadata. Enhances chapter merging logic, improves notification backend testing, and expands test coverage for admin and API routes.
This commit is contained in:
@@ -1,17 +1,19 @@
|
||||
# Testing
|
||||
|
||||
**Status:** ⏳ In Progress | Backend unit testing framework (Vitest)
|
||||
**Status:** ƒ?3 In Progress | Backend + frontend unit testing framework (Vitest)
|
||||
|
||||
## Overview
|
||||
Unit tests for backend logic with isolated mocks (Prisma, integrations, queue).
|
||||
Backend unit tests (Node) and frontend component tests (jsdom) with isolated mocks and deterministic helpers.
|
||||
|
||||
## 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`
|
||||
- **Runner:** Vitest (`vitest.config.ts`)
|
||||
- **Environments:** Node for `*.test.ts`, jsdom for `*.test.tsx` via `environmentMatchGlobs`
|
||||
- **Setup:** `tests/setup.ts` sets `NODE_ENV=test`, `TZ=UTC`, jest-dom, DOM polyfills, Next.js `Link/Image` mocks
|
||||
- **Frontend helpers:** `tests/helpers/render.tsx`, `tests/helpers/mock-auth.ts`, `tests/helpers/mock-next-navigation.ts`
|
||||
- **Backend 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
|
||||
- **Scope:** Unit tests only; no real network or services
|
||||
|
||||
## API/Interfaces
|
||||
```
|
||||
@@ -21,8 +23,10 @@ npm run test:coverage
|
||||
```
|
||||
|
||||
## Critical Issues
|
||||
- API route unit tests are incomplete; add route-level mocks before enforcing coverage.
|
||||
- Frontend coverage not yet enforced; expand component/page tests before adding coverage gates.
|
||||
|
||||
## Related
|
||||
- [frontend/components.md](frontend/components.md)
|
||||
- [frontend/routing-auth.md](frontend/routing-auth.md)
|
||||
- [backend/services/jobs.md](backend/services/jobs.md)
|
||||
- [backend/services/scheduler.md](backend/services/scheduler.md)
|
||||
|
||||
Reference in New Issue
Block a user