From 46529fed1002f96b0736e899347dface6caee3a3 Mon Sep 17 00:00:00 2001 From: Micaela Estabillo Date: Tue, 15 Oct 2024 14:23:51 -0700 Subject: [PATCH] fix: prepare-bridge-page tests --- .../prepare/prepare-bridge-page.test.tsx | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/ui/pages/bridge/prepare/prepare-bridge-page.test.tsx b/ui/pages/bridge/prepare/prepare-bridge-page.test.tsx index 75b99441cee8..82441aad218d 100644 --- a/ui/pages/bridge/prepare/prepare-bridge-page.test.tsx +++ b/ui/pages/bridge/prepare/prepare-bridge-page.test.tsx @@ -57,11 +57,12 @@ describe('PrepareBridgePage', () => { }, { fromTokenInputValue: 1, - fromToken: { address: '0x3103910' }, + fromToken: { address: '0x3103910', decimals: 6 }, toToken: { iconUrl: 'http://url', symbol: 'UNI', address: '0x1f9840a85d5af5bf1d1762f925bdaddc4201f984', + decimals: 6, }, toChainId: CHAIN_IDS.LINEA_MAINNET, }, @@ -90,4 +91,28 @@ describe('PrepareBridgePage', () => { expect(getByTestId('switch-tokens').closest('button')).not.toBeDisabled(); }); + + it('should throw an error if token decimals are not defined', async () => { + const mockStore = createBridgeMockStore( + { + srcNetworkAllowlist: [CHAIN_IDS.MAINNET, CHAIN_IDS.LINEA_MAINNET], + destNetworkAllowlist: [CHAIN_IDS.LINEA_MAINNET], + }, + { + fromTokenInputValue: 1, + fromToken: { address: '0x3103910' }, + toToken: { + iconUrl: 'http://url', + symbol: 'UNI', + address: '0x1f9840a85d5af5bf1d1762f925bdaddc4201f984', + }, + toChainId: CHAIN_IDS.LINEA_MAINNET, + }, + {}, + ); + + expect(() => + renderWithProvider(, configureStore(mockStore)), + ).toThrow(); + }); });