aglinxinyuan opened a new issue, #7477:
URL: https://github.com/apache/texera/issues/7477
### Task Summary
The PVE block is the largest uncovered region in
`computing-unit-selection.component.ts` (~112 missed lines of the file's
total), and the existing suite stops exactly at its seams — it does
`vi.spyOn(component as any, "runPveWebSocket").mockImplementation(() => {})`
and the same for `deleteUserPackages`, so it can assert name validation without
opening a socket.
Everything past those seams is plain logic over stubbed service observables.
The one environmental need is a stand-in for `WebSocket` — jsdom has none, and
the component never inspects anything but the handlers it assigns, so
`vi.stubGlobal("WebSocket", FakeSocket)` is enough to fire `onmessage` and
`onerror` by hand.
Worth pinning: the `__DONE__` sentinel is the only thing that stops the
spinner and unlocks the card; `onerror` is the only thing that stops a dropped
connection looking like an install that never finishes; and the create path's
completion chains delete-then-install, which is how a rebuilt environment gets
its packages back.
**Trap for whoever writes this.** Asserting `isInstalling === false` after
`__DONE__` passes even when the sentinel branch is mutated to leave it set —
the real delete/install continuation resets it downstream. The continuation has
to be stubbed for the assertion to mean anything.
Also found while probing: `skippedMessages` is declared in
`installUserPackages` and never pushed to (skips are reported through
`notificationService.error` instead), so its `if (skippedMessages.length > 0)`
block is 3 lines of dead code.
### 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]