Copilot commented on code in PR #6785:
URL: https://github.com/apache/texera/pull/6785#discussion_r3627938747


##########
frontend/src/app/workspace/component/left-panel/versions-list/versions-list.component.spec.ts:
##########
@@ -50,10 +56,162 @@ describe("VersionsListComponent", () => {
     fixture = TestBed.createComponent(VersionsListComponent);
     component = fixture.componentInstance;
     workflowActionService = TestBed.inject(WorkflowActionService);
+    workflowVersionService = TestBed.inject(WorkflowVersionService);
     fixture.detectChanges();
   });

Review Comment:
   `fixture.detectChanges()` in `beforeEach` will run `ngOnInit()` once before 
these tests set up spies/stubs, but the `ngOnInit` specs then call 
`component.ngOnInit()` again manually. That means the assertions are verifying 
a *second* invocation of `ngOnInit`, which can mask real regressions or 
introduce side effects that would never happen in Angular (where `ngOnInit` 
only runs once). Consider either (a) removing `fixture.detectChanges()` from 
`beforeEach` and invoking it only in tests that need it, or (b) creating the 
fixture inside the `ngOnInit` tests after configuring spies so the first/only 
`ngOnInit` invocation is observed.



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