Skip to content

Commit 7108ed4

Browse files
committed
tests upadate
1 parent dcc4be1 commit 7108ed4

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

packages/gator-permissions-snap/test/client/accountApiClient.test.ts

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -855,12 +855,20 @@ describe('AccountApiClient', () => {
855855
}),
856856
});
857857

858-
await expect(
859-
client.getTokenBalanceAndMetadata({
860-
chainId: mockChainId,
861-
account: mockAccount,
862-
}),
863-
).rejects.toThrow('Invalid response structure');
858+
const result = await client.getTokenBalanceAndMetadata({
859+
chainId: mockChainId,
860+
account: mockAccount,
861+
});
862+
863+
expect(result).toStrictEqual({
864+
balance: BigInt('1000000000000000000'),
865+
decimals: 18,
866+
symbol: 'ETH',
867+
iconUrl:
868+
'https://dev-static.cx.metamask.io/api/v1/tokenIcons/1/0x0000000000000000000000000000000000000000.png',
869+
});
870+
871+
expect(mockFetch).toHaveBeenCalledTimes(4); // 2 balance calls + 2 metadata calls
864872
});
865873

866874
it('succeeds on first attempt when no retry is needed', async () => {

0 commit comments

Comments
 (0)