5.6 KiB
5.6 KiB
2026-03-28 Q-004 Coverage Remediation Pass 7
Scope
- Continue strict
Q-004closure work after Pass 6. - This pass focused on:
- fully closing the remaining
UsersPagemodal/drawer cluster - fully closing the remaining
WebhooksPagemodal/drawer cluster - materially lifting
internal/repository - fixing newly exposed repository correctness defects found during stricter coverage work
- fully closing the remaining
Changes
Frontend
- Added component-level coverage in:
frontend/admin/src/pages/admin/UsersPage/AssignRolesModal.test.tsxfrontend/admin/src/pages/admin/UsersPage/UserEditDrawer.test.tsxfrontend/admin/src/pages/admin/UsersPage/UserDetailDrawer.test.tsxfrontend/admin/src/pages/admin/UsersPage/CreateUserModal.behavior.test.tsxfrontend/admin/src/pages/admin/WebhooksPage/DeliveryDetailModal.test.tsxfrontend/admin/src/pages/admin/WebhooksPage/WebhookFormModal.test.tsxfrontend/admin/src/pages/admin/WebhooksPage/WebhookDeliveriesDrawer.test.tsx
- Newly covered frontend behavior includes:
- assign-role modal state sync, transfer changes, submit success, submit failure, and cancel reset
- user edit drawer form hydration, birthday normalization, validation-error swallow path, service-error path, and close reset
- user detail drawer loading, success rendering, empty fallback, fetch-failure fallback, and optional-field placeholder rendering
- create-user modal close/reset, disabled activation-email backfill, validation-error swallow path, and service-error path
- delivery detail modal success/failure rendering, JSON formatting branch, raw payload fallback, and close path
- webhook form modal create/edit mode branching, validation-error swallow path, and service-error path
- webhook deliveries drawer load, refresh, detail-open, no-webhook guard, and load-failure path
Backend
- Added repository depth coverage in:
internal/repository/repository_relationships_test.go
- Newly covered backend logic includes:
RoleRepositorylifecycle, status queries, default-role queries, search, parent queries, and ID-batch queriesPermissionRepositorylifecycle, type/status queries, join-based enabled permission queries, parent queries, and ID-batch queriesUserRoleRepositorycreate/batch-create/batch-delete/delete/delete-by-user/delete-by-role and ID projection helpersRolePermissionRepositorycreate/batch-create/batch-delete/delete/delete-by-role/delete-by-permission and projection helpers
- Real defects found and fixed during this pass:
internal/repository/role.go- explicit
status=0role creation was being swallowed by DB defaults and persisted as enabled
- explicit
internal/repository/permission.go- explicit
status=0permission creation was being swallowed by DB defaults and persisted as enabled
- explicit
Verified Commands
cd D:\project
$env:GOCACHE='D:\project\.tmp\gocache'
$env:GOPATH='D:\project\.tmp\go'
$env:GOMODCACHE='D:\project\.tmp\go\pkg\mod'
go test ./internal/repository -run 'Test(RoleRepositoryLifecycleAndQueries|PermissionRepositoryLifecycleAndQueries|UserRoleAndRolePermissionRepositoriesLifecycle)$' -count=1
go test ./internal/repository -cover -count=1
go test ./... -count=1
go vet ./...
go build ./cmd/server
cd D:\project\frontend\admin
npm.cmd run test:run -- src/pages/admin/UsersPage/AssignRolesModal.test.tsx src/pages/admin/UsersPage/UserEditDrawer.test.tsx src/pages/admin/UsersPage/UserDetailDrawer.test.tsx src/pages/admin/UsersPage/CreateUserModal.behavior.test.tsx src/pages/admin/UsersPage/CreateUserModal.test.tsx src/pages/admin/UsersPage/UsersPage.test.tsx
npm.cmd run test:run -- src/pages/admin/WebhooksPage/DeliveryDetailModal.test.tsx src/pages/admin/WebhooksPage/WebhookFormModal.test.tsx src/pages/admin/WebhooksPage/WebhookDeliveriesDrawer.test.tsx src/pages/admin/WebhooksPage/WebhooksPage.test.tsx
npm.cmd run lint
npm.cmd run build
npm.cmd run test:coverage
Results
Frontend coverage
- Overall:
- statements
74.54% - branches
63.57% - functions
74.61% - lines
75.35%
- statements
- Target areas:
src/pages/admin/UsersPage:95.06%statementsAssignRolesModal.tsx:100%CreateUserModal.tsx:100%UserDetailDrawer.tsx:100%UserEditDrawer.tsx:100%UsersPage.tsx:90.98%
src/pages/admin/WebhooksPage:94.92%statementsDeliveryDetailModal.tsx:100%WebhookDeliveriesDrawer.tsx:96.66%WebhookFormModal.tsx:96.42%WebhooksPage.tsx:93.15%
Backend coverage
internal/repository:67.1%
Validation Notes
- Frontend full coverage now completes with
41passing test files and134passing tests. - The successful frontend coverage run still emits one post-summary jsdom
AggregateErrornetwork-noise line.- It does not fail the command.
- It is still a real residual hygiene issue and should continue to be tracked honestly.
Real Conclusion
- This pass materially changed the real
Q-004map again:UsersPageis no longer one of the remaining dominant uncovered admin clustersWebhooksPageis no longer one of the remaining dominant uncovered admin clustersinternal/repositoryis no longer at the earlier closure-blocking37.1%depth
Q-004still cannot be honestly declared closed.- The remaining real gaps are now more concentrated in:
- deeper remaining frontend hotspots such as
ProfileSecurityPage,LoginPage,RegisterPage,AuthProvider, andlib/http - remaining backend repository depth outside the newly covered relation/role/permission paths
- frontend validation hygiene due the recurring post-summary jsdom
AggregateErrornoise
- deeper remaining frontend hotspots such as