Finding
Scanner refactor PRs #21518, #21519, #21520, #21522 (all currently open with needs-tests label) split ~15 oversized files into ~40 new modules. Many of the newly-extracted modules are pure functions or thin hooks with clear input/output contracts — they are ideal unit-test targets but no tests were added alongside the refactor.
The repo already has a working vitest setup with a clean pattern under web/src/lib/__tests__/ (see cn.test.ts, gpu.test.ts, tips.test.ts, icons.test.ts, statusColors.test.ts) and hook-testing pattern in web/src/hooks/useCachedGrpc.test.ts.
Without tests, these refactors carry regression risk because the refactor mechanically moves logic across file boundaries with no behavioral safety net.
Recommendation
Add unit tests for the following high-value extracted modules as follow-up PRs once the parent refactor lands. Priority ordered:
P0 — pure functions with threshold/branch logic (highest regression risk)
P1 — pure data helpers
P2 — hooks (renderHook pattern)
P3 — smoke tests for structural moves
Per-PR guidance has also been posted as review comments on each refactor PR.
Priority
- Impact: medium (regression protection for a large refactor; long-term coverage improvement)
- Effort: medium (~40-60 test cases across ~10 files; each file is a self-contained scope)
Filed by quality agent (ACMM L4/L6 — full mode)
Finding
Scanner refactor PRs #21518, #21519, #21520, #21522 (all currently open with
needs-testslabel) split ~15 oversized files into ~40 new modules. Many of the newly-extracted modules are pure functions or thin hooks with clear input/output contracts — they are ideal unit-test targets but no tests were added alongside the refactor.The repo already has a working vitest setup with a clean pattern under
web/src/lib/__tests__/(seecn.test.ts,gpu.test.ts,tips.test.ts,icons.test.ts,statusColors.test.ts) and hook-testing pattern inweb/src/hooks/useCachedGrpc.test.ts.Without tests, these refactors carry regression risk because the refactor mechanically moves logic across file boundaries with no behavioral safety net.
Recommendation
Add unit tests for the following high-value extracted modules as follow-up PRs once the parent refactor lands. Priority ordered:
P0 — pure functions with threshold/branch logic (highest regression risk)
web/src/hooks/useTokenUsage.math.ts—getTokenAlertLevel,reconcileUsageBreakdown,getUsagePeriodKey,getNextResetDate(from [scanner] refactor: split oversized hooks & lib-layer files #21520)web/src/components/dashboard/StatBlockValidation.ts—createStatBlockId,getSmartDefault,validateStatAssistResult,validateStatBlockResult(from [scanner] refactor: split oversized dashboard & mission-control components #21522)web/src/lib/missions/preflightCheck.checks.ts— each check function (from [scanner] refactor: split oversized hooks & lib-layer files #21520)P1 — pure data helpers
web/src/lib/utils/dateFormatting.ts(from [scanner] refactor: split GPU & cluster components #21518)web/src/hooks/useStackDiscovery.filters.ts(from [scanner] refactor: split oversized hooks & lib-layer files #21520)web/src/components/drilldown/views/MultiClusterSummaryDrillDown/utilities.ts(from [scanner] refactor: split oversized dashboard & mission-control components #21522)P2 — hooks (renderHook pattern)
web/src/components/clusters/hooks/useClusterSorting.tsweb/src/components/clusters/hooks/useGPUDetailData.tsweb/src/components/clusters/hooks/useNamespaceResourcesData.tsweb/src/hooks/useGPUReservationsData.tsweb/src/components/cards/rss/useRSSRefresh.tsP3 — smoke tests for structural moves
ArgoAppDrillDown/andMultiClusterSummaryDrillDown/index barrel files (guards against broken re-exports after the directory move in [scanner] refactor: split oversized dashboard & mission-control components #21522)Per-PR guidance has also been posted as review comments on each refactor PR.
Priority
Filed by quality agent (ACMM L4/L6 — full mode)