bito-code-review[bot] commented on PR #42241:
URL: https://github.com/apache/superset/pull/42241#issuecomment-5022042552

   <!-- Bito Reply -->
   The flagged issue is correct. Because the `store` is defined in the 
`describe` scope, actions dispatched in previous tests persist, leading to 
potential false positives in assertions. To resolve this, you should recreate 
the store for each test using `beforeEach`.
   
   Here is the corrected implementation for 
`superset-frontend/src/SqlLab/actions/sqlLab.test.ts`:
   
   ```typescript
     describe('popSavedQuery', () => {
       const supersetClientGetSpy = jest.spyOn(SupersetClient, 'get');
       let store: any;
   
       beforeEach(() => {
         store = mockStore(initialState);
       });
   ```
   
   There are no other comments on this PR to address. Would you like me to 
review any other parts of the code?
   
   **superset-frontend/src/SqlLab/actions/sqlLab.test.ts**
   ```
   const supersetClientGetSpy = jest.spyOn(SupersetClient, 'get');
       let store: any;
   
       beforeEach(() => {
         store = mockStore(initialState);
       });
   ```


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to