SBIN2010 commented on code in PR #35447:
URL: https://github.com/apache/superset/pull/35447#discussion_r2397559420
##########
superset-frontend/src/hooks/useUnsavedChangesPrompt/useUnsavedChangesPrompt.test.tsx:
##########
@@ -22,115 +22,116 @@ import { Router } from 'react-router-dom';
import { createMemoryHistory } from 'history';
import { act } from 'spec/helpers/testing-library';
-const history = createMemoryHistory({
+let history = createMemoryHistory({
initialEntries: ['/dashboard'],
});
+beforeEach(() => {
+ history = createMemoryHistory({ initialEntries: ['/dashboard'] });
+});
Review Comment:
Yes, beforeEach works perfectly fine with a flat test structure.
It runs before each test - every test gets a fresh history instance
--
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]