diff --git a/ui/pages/multi-srp/import-srp/import-srp.tsx b/ui/pages/multi-srp/import-srp/import-srp.tsx index dc2365dcecd7..3cea8eca03da 100644 --- a/ui/pages/multi-srp/import-srp/import-srp.tsx +++ b/ui/pages/multi-srp/import-srp/import-srp.tsx @@ -374,6 +374,7 @@ export const ImportSrp = () => { flexDirection={FlexDirection.Row} alignItems={AlignItems.center} width={BlockSize.Full} + paddingRight={2} > ({ ...jest.requireActual('react-router-dom'), useHistory: () => ({ push: mockPush, - goBack: mockGoBack, }), })); @@ -134,7 +135,6 @@ const createMockState = ( describe('BaseAccountDetails', () => { beforeEach(() => { mockPush.mockClear(); - mockGoBack.mockClear(); }); describe('Component Rendering', () => { @@ -216,7 +216,7 @@ describe('BaseAccountDetails', () => { }); describe('Navigation', () => { - it('should go back when back button is clicked', () => { + it('should navigate to default route when back button is clicked', () => { const state = createMockState(MOCK_ACCOUNT_EOA.address); const store = mockStore(state); @@ -233,7 +233,7 @@ describe('BaseAccountDetails', () => { const backButton = screen.getByLabelText('Back'); fireEvent.click(backButton); - expect(mockGoBack).toHaveBeenCalledTimes(1); + expect(mockPush).toHaveBeenCalledWith(DEFAULT_ROUTE); }); it('should navigate to QR code route when address row is clicked', () => { diff --git a/ui/pages/multichain-accounts/base-account-details/base-account-details.tsx b/ui/pages/multichain-accounts/base-account-details/base-account-details.tsx index 667c980d8bde..144ac1fc408b 100644 --- a/ui/pages/multichain-accounts/base-account-details/base-account-details.tsx +++ b/ui/pages/multichain-accounts/base-account-details/base-account-details.tsx @@ -100,7 +100,7 @@ export const BaseAccountDetails = ({ const handleNavigation = useCallback(() => { dispatch(setAccountDetailsAddress('')); - history.goBack(); + history.push(DEFAULT_ROUTE); }, [history, dispatch]); // we can never have a scenario where an account is not associated with a wallet.