-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #259 from actiontech/bugfix/syncDataSource-router
[fix]: (SyncDataSrouce) Adjust the routing structure and remove unused import.
- Loading branch information
Showing
26 changed files
with
189 additions
and
242 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 1 addition & 5 deletions
6
src/components/Nav/Header/Component/__test__/HeaderMenu.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,16 @@ | ||
import { renderHook } from '@testing-library/react-hooks'; | ||
|
||
import { Router } from 'react-router'; | ||
import useBack from '.'; | ||
import useNavigate from '../useNavigate'; | ||
|
||
jest.mock('../useNavigate', () => jest.fn()); | ||
|
||
describe('useBack', () => { | ||
test('should jump to last path in history when call goBack', () => { | ||
// const history = createMemoryHistory(); | ||
// history.push('/'); | ||
// history.push('/test'); | ||
// const { result } = renderHook(() => useBack(), { | ||
// wrapper: Router, | ||
// initialProps: { history }, | ||
// }); | ||
// expect(history.location.pathname).toBe('/test'); | ||
// result.current.goBack(); | ||
// expect(history.location.pathname).toBe('/'); | ||
const navigateSpy = jest.fn(); | ||
(useNavigate as jest.Mock).mockImplementation(() => navigateSpy); | ||
const { result } = renderHook(() => useBack()); | ||
result.current.goBack(); | ||
expect(navigateSpy).toBeCalledTimes(1); | ||
expect(navigateSpy).toBeCalledWith(-1); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/page/AuditPlan/PlanList/Modal/SubscribeNotice/tests/SubscribeNotice.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.