Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
brendan-defi committed Jan 9, 2025
1 parent f6d4793 commit 68735f6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
9 changes: 8 additions & 1 deletion src/wallet/components/WalletIslandAddressDetails.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,13 @@ describe('WalletIslandAddressDetails', () => {
schemaId: '1',
});

mockUseWalletIslandContext.mockReturnValue({
portfolioFiatValue: 1000,
animations: {
content: '',
},
});

render(<AddressDetails />);

expect(screen.getByTestId('ockAvatar_ImageContainer')).toBeDefined();
Expand Down Expand Up @@ -181,7 +188,7 @@ describe('WalletIslandAddressDetails', () => {

mockUseWalletIslandContext.mockReturnValue({
isFetchingPortfolioData: false,
portfolioFiatValue: '1234.567',
portfolioFiatValue: 1234.567,
animations: {
content: '',
},
Expand Down
4 changes: 2 additions & 2 deletions src/wallet/components/WalletIslandAddressDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ function AddressBalanceInFiat() {
return <Spinner />;
}

if (portfolioFiatValue === null) {
if (portfolioFiatValue === null || portfolioFiatValue === undefined) {
return null;
}

Expand All @@ -91,7 +91,7 @@ function AddressBalanceInFiat() {
className={cn(text.title1, 'mt-1 font-normal')}
data-testid="ockWalletIsland_AddressBalance"
>
{`$${Number(portfolioFiatValue)?.toFixed(2)}`}
{`$${portfolioFiatValue.toFixed(2)}`}
</div>
);
}

0 comments on commit 68735f6

Please sign in to comment.