mengw15 opened a new issue, #6745:
URL: https://github.com/apache/texera/issues/6745

   ### 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
   
   - [ ] Refactor / Cleanup
   - [ ] DevOps / Deployment / CI
   - [x] Testing / QA
   - [ ] Documentation
   - [ ] Performance
   - [ ] Other
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to