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


##########
frontend/src/app/workspace/component/result-panel/result-panel.component.spec.ts:
##########
@@ -76,6 +87,23 @@ describe("ResultPanelComponent", () => {
     fixture.detectChanges();
   });
 
+  afterEach(() => {
+    // Several added tests install spies on the global `window` / shared 
service
+    // instances and drive real streams; restore everything and tear the 
fixture
+    // down so state never leaks into the next test.
+    vi.restoreAllMocks();
+    fixture.destroy();
+  });

Review Comment:
   The new `afterEach` calls `fixture.destroy()`, which triggers 
`ResultPanelComponent.ngOnDestroy()` and writes `result-panel-*` keys into 
`localStorage`. Because those keys are also read in the component 
constructor/ngOnInit, this can leak state into later specs and make the overall 
test suite order-dependent/flaky. Clean up the component’s persisted keys after 
destroying the fixture (prefer removing only these keys rather than 
`localStorage.clear()`).



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