mengw15 commented on code in PR #6540:
URL: https://github.com/apache/texera/pull/6540#discussion_r3609566417


##########
frontend/src/app/workspace/component/left-panel/time-travel/time-travel.component.spec.ts:
##########
@@ -60,4 +73,143 @@ describe("TimeTravelComponent", () => {
   it("should create", () => {
     expect(component).toBeTruthy();
   });
+
+  describe("extended method coverage", () => {
+    let executionsService: WorkflowExecutionsService;
+    let versionService: WorkflowVersionService;
+    let executeService: ExecuteWorkflowService;
+    let notificationService: NotificationService;

Review Comment:
   Good catch — `WorkflowActionService` defaults to `wid: 0`, so the poller did 
fire an executions request in `should create`. Moved the `getWorkflowMetadata` 
stub into the outer `beforeEach` (before `detectChanges`), so no test schedules 
a stray request now. (I left out `HttpTestingController.verify()` because 
component creation also fires an unrelated `operator-metadata` GET that a 
blanket verify would trip on; the interaction-history test still asserts its 
specific request via `expectOne`.)



##########
frontend/src/app/workspace/component/left-panel/time-travel/time-travel.component.spec.ts:
##########
@@ -60,4 +73,143 @@ describe("TimeTravelComponent", () => {
   it("should create", () => {
     expect(component).toBeTruthy();
   });
+
+  describe("extended method coverage", () => {
+    let executionsService: WorkflowExecutionsService;
+    let versionService: WorkflowVersionService;
+    let executeService: ExecuteWorkflowService;
+    let notificationService: NotificationService;
+    let httpMock: HttpTestingController;
+    let metadataSpy: ReturnType<typeof vi.spyOn>;
+
+    beforeEach(() => {
+      executionsService = TestBed.inject(WorkflowExecutionsService);
+      versionService = TestBed.inject(WorkflowVersionService);
+      executeService = TestBed.inject(ExecuteWorkflowService);
+      notificationService = TestBed.inject(NotificationService);
+      httpMock = TestBed.inject(HttpTestingController);
+      // Neutralize the ngOnInit 5s poller: with no wid its callback 
early-returns,
+      // so no stray executions request lands in httpMock.
+      metadataSpy = vi.spyOn(workflowActionService, 
"getWorkflowMetadata").mockReturnValue(undefined as any);
+    });
+
+    afterEach(() => {
+      vi.restoreAllMocks();
+    });

Review Comment:
   Done — the nested `beforeEach` no longer re-spies; it reuses the outer 
`metadataSpy`, and `vi.restoreAllMocks()` now runs from the single outer 
`afterEach`.



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