Commit Graph

6 Commits

Author SHA1 Message Date
c6dfa31839 fix(frontend): pass userId to deleteUserTariff API to fix compilation error
The generated API service requires userId as a second parameter for
deleteUserTariff(). Inject AuthService and use getCurrentUserId() to
provide the required argument, unblocking the entire frontend test suite.
2026-07-24 09:43:37 +02:00
54f45d6bf7 test(frontend): fix vitest test infrastructure and admin-user-approval tests
- Add vitest.config.ts for Angular 21 @angular/build:unit-test runner
- Install @angular/platform-browser-dynamic for TestBed initialization
- Regenerate API client from OpenAPI spec (npm run generate-api)
- Fix spec: use includes() for URL matching (generated API prepends basePath)
- Fix spec: 'should not reload' test assertion (0 not 1) for no-reload behavior
- All 107 frontend tests now pass (17 test files)
2026-07-24 09:33:19 +02:00
71ecf47948 test(frontend): enhance AdminUserApprovalComponent tests with full coverage
Add comprehensive tests covering:
- Tab navigation (pending/all) with signal verification
- loadAllUsers() calls correct endpoint via generated AdminIAMService
- Error handling for loadPendingUsers and loadAllUsers failures
- Approve/reject user actions including undefined userId guards
- Template rendering: pending tab with Freigeben/Ablehnen buttons
- Template rendering: all users tab without action buttons
- Status badge rendering in both tabs
- Role column display (Unternehmen/Privatperson)
- Empty state messages for both tabs
- Duplicate Status column header bug fix verification
- No reload of allUsers if already loaded
2026-07-24 08:12:32 +02:00
2bf1d49af1 feat(frontend): add tab navigation and all-users table to AdminUserApprovalComponent
- Add activeTab signal ('pending' | 'all') with tab navigation UI
- Add allUsers signal with loadAllUsers() using generated AdminIAMService.getAllUsers()
- Add getStatusLabel() helper for German status labels (Ausstehend/Aktiv/Freigeschaltet/Inaktiv/Abgelehnt)
- Add getStatusBadgeClass() for color-coded status badges (yellow/green/red)
- Fix duplicate 'Status' column header bug in pending users table
- All-users tab shows Name, Email, Status badge, Rolle columns (no action buttons)
- Add 22 passing tests covering signals, helpers, tab switching, approve/reject, and template
2026-07-23 14:32:02 +02:00
0bfa0d98d5 test(dashboard,frontend): add DashboardControllerTest, fix broken spec files and add login tests
- Add DashboardControllerTest with 4 tests for admin and user dashboard endpoints
- Fix incorrect class name imports in header, admin-user-approval, metering-points, verify-email specs
- Add missing ActivatedRoute/Router/AuthService providers in all spec files
- Replace stub login spec with 10 comprehensive tests (form validation, role redirect, error handling)
- Remove stale 'should render title' test from app.spec.ts
2026-07-22 08:39:58 +02:00
ad47f7399e added admin approval list
implemented approval (untested)
implemented eda consent simulation (untested)
2026-06-17 11:08:44 +02:00