Copilot commented on code in PR #6371:
URL: https://github.com/apache/texera/pull/6371#discussion_r3566352256
##########
frontend/src/app/workspace/service/execute-workflow/execute-workflow.service.spec.ts:
##########
@@ -82,6 +91,17 @@ describe("ExecuteWorkflowService", () => {
mockWorkflowSnapshotService = TestBed.inject(WorkflowSnapshotService);
});
+ afterEach(() => {
+ // sendExecutionRequest reads/writes sessionStorage; keep tests isolated
+ sessionStorage.clear();
+ });
+
+ // Push an event through the same Subject the real WorkflowWebsocketService
feeds, so the
+ // constructor subscription in ExecuteWorkflowService runs exactly as it
would in production.
+ const emitWsEvent = (event: TexeraWebsocketEvent): void => {
+ (service as
any).workflowWebsocketService.webSocketResponseSubject.next(event);
+ };
Review Comment:
The test helper reaches into `WorkflowWebsocketService`'s private
`webSocketResponseSubject` field. This makes the spec brittle to internal
refactors of that service; prefer emitting via the public `websocketEvent()`
API (casting to access `.next` for tests) so the helper is less coupled to
private implementation details.
--
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]