3.8 KiB
3.8 KiB
2026-03-27 Q-004 Coverage Remediation Pass 5
Scope
- Continue remediating the remaining real
Q-004gaps after Pass 4. - This pass focused on:
- deeper non-network
internal/auth/providersparsing and error branches - low-coverage admin log pages
- deeper non-network
Changes
Frontend
- Added page-level regression coverage in:
frontend/admin/src/pages/admin/LoginLogsPage/LoginLogsPage.test.tsxfrontend/admin/src/pages/admin/OperationLogsPage/OperationLogsPage.test.tsx
- Newly covered page behavior includes:
- initial load
- filter application
- reset
- refresh
- pagination callback handling
- detail drawer open/close flow
- page-level error retry
Backend
- Added provider non-network transport tests in:
internal/auth/providers/provider_http_roundtrip_test.go
- The new tests replace live network dependencies with a fake
http.DefaultTransport. - Newly covered provider logic includes:
QQProvider.GetOpenIDsuccess and invalid-JSON failureQQProvider.GetUserInfoAPI-error and success branchesWeiboProvider.ValidateTokenerror / valid / ambiguous / invalid-JSON branchesWeChatProvider.ValidateTokensuccess / failure / invalid-JSON branchesGoogleProvider.ValidateTokensuccess and parse-failure branchesFacebookProvider.GetUserInfoerror.messageand success branches
Verified Commands
cd D:\project\frontend\admin
npm.cmd run test:run -- src/pages/admin/LoginLogsPage/LoginLogsPage.test.tsx
npm.cmd run test:run -- src/pages/admin/OperationLogsPage/OperationLogsPage.test.tsx
npm.cmd run lint
npm.cmd run build
npm.cmd run test:coverage
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/auth/providers -run 'Test(QQProviderGetOpenIDAndUserInfoWithDefaultTransport|WeiboProviderValidateTokenWithDefaultTransport|WeChatProviderValidateTokenWithDefaultTransport|GoogleProviderValidateTokenWithDefaultTransport|FacebookProviderGetUserInfoWithDefaultTransport)$' -count=1
go test ./... -count=1
go vet ./...
go build ./cmd/server
go test ./internal/auth/providers ./internal/repository -cover -count=1
Results
Frontend coverage
- Overall:
- statements
56.81% - branches
44.67% - functions
57.38% - lines
57.57%
- statements
- Target areas:
services:86.2%statements,90.9%branchessrc/pages/admin/LoginLogsPage/LoginLogsPage.tsx:93.1%statements,55.55%branchessrc/pages/admin/OperationLogsPage/OperationLogsPage.tsx:91.52%statements,68.75%branches
Backend coverage
internal/auth/providers:28.7%internal/repository:37.1%
Validation Notes
npm.cmd run test:coveragecompleted successfully with28passing test files and96passing tests.- The same successful coverage run still printed one post-summary jsdom
AggregateErrornetwork-noise line.- This did not fail the command.
- It is still a real residual test-hygiene issue and should be traced separately instead of being ignored or misrepresented as a clean zero-noise run.
Real Conclusion
- This pass materially reduced two real
Q-004gaps:- admin log pages are no longer among the main uncovered page-level hotspots
internal/auth/providersimproved substantially from the previous15.2%, but remains materially under-covered
Q-004still cannot be honestly declared closed.- The main remaining real gaps are now concentrated in:
- deeper
internal/auth/providerspaths beyond the new non-network parsing/error coverage - still-uncovered admin pages/components such as:
PermissionsPageRolesPageProfilePage- multiple admin drawers/modals that still remain near
0%
- deeper
- Secondary remaining gap:
internal/repositoryhas improved, but37.1%is still not a closure-grade depth