LOW: No tests for subscription CRUD, authentication, pricing, or news controllers #17

Closed
opened 2026-05-09 00:03:28 +00:00 by Mark · 0 comments
Owner

Severity: Low

Location

backend/src/ — only has tests for auth.ts and DashboardService.ts
frontend/src/ — only has tests for api.ts and utils.ts

Description

The project has minimal test coverage. Existing tests cover:

  • auth.test.ts: password hashing, token generation/verification (43 lines)
  • DashboardService.test.ts: dashboard stats calculations (70 lines)
  • api.test.ts: API client auth headers, error handling (65 lines)
  • utils.test.ts: tailwind class merging (21 lines)

Not tested:

  • SubscriptionController (create/update/delete/getAll/getById) — 164 lines of critical code
  • AuthController (register/login/getCurrentUser/updateCurrentUser) — 102 lines
  • AuthService.register/login — user creation flow
  • PricingController, NewsController
  • SubscriptionService, PricingService, NewsService
  • PaydayService (getNextPaydays, isPayday, groupSubscriptionsByPayday) — 233 lines of complex date logic
  • database.ts — the core data persistence layer
  • All frontend components (App.tsx contains ~1400 lines of component logic with zero tests)

Impact

  • No regression protection for the most critical business logic
  • Complex date calculations in PaydayService are untested
  • Refactoring is risky without test coverage

Suggested Fix

Prioritize tests for:

  1. PaydayService (isPayday edge cases for Feb 28/29, month boundaries, biweekly calculations)
  2. AuthController/Service (registration, login, duplicate email handling)
  3. SubscriptionController CRUD operations
  4. Database layer (read/write/update operations)
## Severity: Low ## Location `backend/src/` — only has tests for `auth.ts` and `DashboardService.ts` `frontend/src/` — only has tests for `api.ts` and `utils.ts` ## Description The project has minimal test coverage. Existing tests cover: - `auth.test.ts`: password hashing, token generation/verification (43 lines) - `DashboardService.test.ts`: dashboard stats calculations (70 lines) - `api.test.ts`: API client auth headers, error handling (65 lines) - `utils.test.ts`: tailwind class merging (21 lines) **Not tested:** - SubscriptionController (create/update/delete/getAll/getById) — 164 lines of critical code - AuthController (register/login/getCurrentUser/updateCurrentUser) — 102 lines - AuthService.register/login — user creation flow - PricingController, NewsController - SubscriptionService, PricingService, NewsService - PaydayService (getNextPaydays, isPayday, groupSubscriptionsByPayday) — 233 lines of complex date logic - database.ts — the core data persistence layer - All frontend components (App.tsx contains ~1400 lines of component logic with zero tests) ## Impact - No regression protection for the most critical business logic - Complex date calculations in PaydayService are untested - Refactoring is risky without test coverage ## Suggested Fix Prioritize tests for: 1. PaydayService (isPayday edge cases for Feb 28/29, month boundaries, biweekly calculations) 2. AuthController/Service (registration, login, duplicate email handling) 3. SubscriptionController CRUD operations 4. Database layer (read/write/update operations)
Mark 2026-05-26 08:05:59 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Mark/subvault#17
No description provided.