Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
brendan-defi committed Jan 8, 2025
1 parent 76d148b commit 4467926
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/wallet/components/WalletIslandWalletActions.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,24 @@ describe('WalletIslandWalletActions', () => {

expect(refetchPortfolioDataMock).toHaveBeenCalled();
});

it('opens transaction history when transactions button is clicked', () => {
const windowOpenSpy = vi
.spyOn(window, 'open')
.mockImplementation(() => null);

render(<WalletIslandWalletActions />);

const transactionsButton = screen.getByTestId(
'ockWalletIsland_TransactionsButton',
);
fireEvent.click(transactionsButton);

expect(windowOpenSpy).toHaveBeenCalledWith(
'https://wallet.coinbase.com/assets/transactions',
'_blank',
);

windowOpenSpy.mockRestore();
});
});

0 comments on commit 4467926

Please sign in to comment.