Task Summary
ComputingUnitSelectionComponent sits at codecov ~66% (130 uncovered lines) — its spec covers the interaction flows but leaves the resource-formatting and status-display getters untested. Extend the spec to cover those pure getters. jsdom/Vitest; see frontend/TESTING.md.
Behavior to add
ComputingUnitSelectionComponent (frontend/src/app/workspace/component/power-button/computing-unit-selection.component.ts, codecov ~66% — EXTEND; spec covers flows, not the getters)
Scope: the pure resource-formatter and status-display getters — each delegates to a pure util from the current computing unit's values, so seed the component's selected unit (or stub the getCurrentComputingUnit* accessors) and assert the returned value:
- CPU:
getCpuLimit / getCpuValue / getCpuUnit / getCpuLimitUnit / getCpuPercentage / getCpuStatus — assert formatted numbers/units and that getCpuStatus maps a percentage to "success" | "exception" | "active" | "normal".
- Memory:
getMemoryLimit / getMemoryValue / getMemoryUnit / getMemoryLimitUnit / getMemoryPercentage / getMemoryStatus — same shape.
- Other resources:
getGpuLimit / getJvmMemorySize / getSharedMemorySize.
- Status/display:
computeStatus / getButtonText / getBadgeColor(status) / getUnitStatusTooltip / isComputingUnitRunning / isSelectedUnit / isCreateDisabled(pve) / cannotSelectUnit — assert the string/boolean for representative inputs.
- Trivial:
trackByCuid / trackByIndex return the identity key.
Out of scope (separate issue): the WebSocket/HTTP/service-driven methods (runPveWebSocket, refreshUserPackages, refreshAvailableDbPves, createVirtualEnvironment, installUserPackages, terminateComputingUnit, selectComputingUnit) — they need service mocks.
Task Type
Task Summary
ComputingUnitSelectionComponentsits at codecov ~66% (130 uncovered lines) — its spec covers the interaction flows but leaves the resource-formatting and status-display getters untested. Extend the spec to cover those pure getters. jsdom/Vitest; seefrontend/TESTING.md.Behavior to add
ComputingUnitSelectionComponent (
frontend/src/app/workspace/component/power-button/computing-unit-selection.component.ts, codecov ~66% — EXTEND; spec covers flows, not the getters)Scope: the pure resource-formatter and status-display getters — each delegates to a pure util from the current computing unit's values, so seed the component's selected unit (or stub the
getCurrentComputingUnit*accessors) and assert the returned value:getCpuLimit/getCpuValue/getCpuUnit/getCpuLimitUnit/getCpuPercentage/getCpuStatus— assert formatted numbers/units and thatgetCpuStatusmaps a percentage to"success" | "exception" | "active" | "normal".getMemoryLimit/getMemoryValue/getMemoryUnit/getMemoryLimitUnit/getMemoryPercentage/getMemoryStatus— same shape.getGpuLimit/getJvmMemorySize/getSharedMemorySize.computeStatus/getButtonText/getBadgeColor(status)/getUnitStatusTooltip/isComputingUnitRunning/isSelectedUnit/isCreateDisabled(pve)/cannotSelectUnit— assert the string/boolean for representative inputs.trackByCuid/trackByIndexreturn the identity key.Out of scope (separate issue): the WebSocket/HTTP/service-driven methods (
runPveWebSocket,refreshUserPackages,refreshAvailableDbPves,createVirtualEnvironment,installUserPackages,terminateComputingUnit,selectComputingUnit) — they need service mocks.Task Type