aglinxinyuan commented on code in PR #6371:
URL: https://github.com/apache/texera/pull/6371#discussion_r3567373378


##########
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 helper now goes through the public API: 
`TestBed.inject(WorkflowWebsocketService).websocketEvent() as Subject<...>` and 
calls `.next` on that — coupled only to `websocketEvent()` returning the event 
stream, not to the private field name (d2bef4a).



-- 
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