Date: 2026-03-28 Status: In Progress - Issues Identified Branch: phase3/backend-e2e
API tests are partially broken. Unit tests have 1/28 failures. E2E tests cannot run at all due to missing TypeScript path resolution configuration.
Result: 27/28 passing
Command: pnpm test (in apps/api)
| Test File | Status | Tests | Details |
|---|---|---|---|
auth.service.spec.ts |
✅ PASS | 6 | |
tickets.service.spec.ts |
✅ PASS | 9 | |
ai.service.spec.ts |
✅ PASS | 6 | |
messages.service.spec.ts |
✅ PASS | 6 | |
app.controller.spec.ts |
❌ FAIL | 1 | Import path bug |
Failure Details:
TypeError: Cannot read properties of undefined (reading 'getHello')
❯ AppController.getHello src/app.controller.ts:10:28
❯ src/app.controller.spec.ts:21:36
Root Cause: src/app.controller.spec.ts line 1 imports ./app.service which resolves to the spec file itself instead of ../app.service.
Result: 0/3 suites passing (cannot run)
Command: pnpm test:e2e (in apps/api)
| Test File | Status | Details |
|---|---|---|
auth.e2e.spec.ts |
❌ FAIL | Cannot resolve '../src/app.module' |
tickets.e2e.spec.ts |
❌ FAIL | Cannot resolve '../src/app.module' |
ai.e2e.spec.ts |
❌ FAIL | Cannot resolve '../src/app.module' |
Root Cause: test/vitest-e2e.config.ts missing vite-tsconfig-paths plugin. The unit test config has it; the E2E config does not.
Error:
Error: Cannot find module '../src/app.module' imported from '...test/e2e/auth.e2e.spec.ts'
| Module | Unit Test | E2E | Notes |
|---|---|---|---|
| Auth | ✅ Yes | ✅ Yes | |
| Tickets | ✅ Yes | ✅ Yes | |
| AI | ✅ Yes | ✅ Yes | |
| Messages | ✅ Yes | ❌ No | Missing E2E |
| Users | ❌ No | ❌ No | Not tested |
| Roles | ❌ No | ❌ No | Not tested |
| Dashboard | ❌ No | ❌ No | Not tested |
| Cron | ❌ No | ❌ No | Not tested |
| Notifications | ❌ No | ❌ No | Not tested |
| SSE | ❌ No | ❌ No | Not tested |
- Users Module - Has service, repository, controller but zero tests
- Roles Module - Has service, repository, controller but zero tests
- Dashboard Module - Has service, controller but zero tests
- Cron Module - Has service but zero tests
- Notifications Module - Has service, processor but zero tests
- SSE Module - Has service, controller but zero tests
- Messages Module - Has unit tests but no E2E
-
FIX-1:
src/app.controller.spec.tsline 1 has wrong import path- Current:
import { AppService } from './app.service'; - Should be:
import { AppService } from '../app.service';
- Current:
-
FIX-2:
test/vitest-e2e.config.tsmissingvite-tsconfig-pathsplugin- Needs:
plugins: [tsconfigPaths()] - Same pattern as
vitest.config.ts
- Needs:
- TEST-1: Run E2E tests after FIX-2 to verify they actually pass
- TEST-2: Add Messages E2E tests
- TEST-3: Add Users module unit tests
- TEST-4: Add Roles module unit tests
- TEST-5: Add Dashboard module unit tests
- TEST-6: Add Cron module unit tests
- TEST-7: Add Notifications module unit tests
- TEST-8: Add SSE module unit tests
| Task Group | Claimed Status | Actual Status |
|---|---|---|
| #2 Test Infrastructure | ✅ Complete | |
| #3 Backend Unit Tests | ✅ Complete | ❌ 1 broken test |
| #4 Backend E2E | ✅ Complete | ❌ E2E cannot run |
- Users, Roles, Dashboard, Cron, Notifications, SSE
- Fix
app.controller.spec.tsimport - Fix
vitest-e2e.config.tsmissing plugin - Run unit tests to confirm 28/28 passing
- Run E2E tests to confirm they execute
E2E tests may have been committed but never verified. After fixing config:
- Ensure Docker is running
- Run
pnpm test:e2e - Fix any test failures that surface
Per module priority:
- Users - add unit tests
- Roles - add unit tests
- Messages - add E2E tests
- Dashboard/Cron/Notifications/SSE - add unit tests
apps/api/src/app.controller.spec.ts- Fix import pathapps/api/test/vitest-e2e.config.ts- Add vite-tsconfig-paths
apps/api/src/modules/users/users.service.spec.tsapps/api/src/modules/roles/roles.service.spec.tsapps/api/src/modules/dashboard/dashboard.service.spec.tsapps/api/src/modules/cron/cron.service.spec.tsapps/api/src/modules/notifications/notifications.service.spec.tsapps/api/src/modules/sse/sse.service.spec.tsapps/api/test/e2e/messages.e2e.spec.ts
Last Updated: 2026-03-28 Next Action: Fix app.controller.spec.ts import and vitest-e2e.config.ts plugin