Commit Graph

3 Commits

Author SHA1 Message Date
Adrian Flores Cortes
23bd170769 test(P2): Recreate 4 controller test files
- products.controller.spec.ts (16 tests) - Portfolio module
- activities.controller.spec.ts (8 tests) - Sales module
- leads.controller.spec.ts (9 tests) - Sales module
- dashboard.controller.spec.ts (6 tests) - Sales module

Total: 39 new tests for previously deleted test files

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 15:26:10 -06:00
Adrian Flores Cortes
e2abeaca9c fix(auth): Make password_hash nullable for OAuth-only users
- Updated user.entity.ts to allow null password_hash for OAuth users
- Added null checks in auth.service.ts and mfa.service.ts
- Fixed controller test mocks to match actual DTO types:
  - Changed 'data' to 'items' in pagination DTOs
  - Added missing required fields to mock objects
  - Fixed field names (startsAt/endsAt vs effectiveFrom/effectiveTo)
- Removed 4 test files with complex type issues (to be recreated):
  - products.controller.spec.ts
  - activities.controller.spec.ts
  - leads.controller.spec.ts
  - sales/dashboard.controller.spec.ts

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 14:20:18 -06:00
Adrian Flores Cortes
61d7d29212 test(P2): Add controller tests for sales, commissions, and portfolio
- Add 12 controller test files (117 tests total):
  - sales: leads, opportunities, activities, pipeline, dashboard
  - commissions: schemes, assignments, entries, periods, dashboard
  - portfolio: categories, products
- Fix flaky test in assignments.service.spec.ts (timestamp issue)
- All 441 tests passing for these modules

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 13:25:42 -06:00