Skip to content

Commit

Permalink
fix: prepare-bridge-page tests
Browse files Browse the repository at this point in the history
  • Loading branch information
micaelae committed Oct 15, 2024
1 parent 32302ac commit 46529fe
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion ui/pages/bridge/prepare/prepare-bridge-page.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down Expand Up @@ -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(<PrepareBridgePage />, configureStore(mockStore)),
).toThrow();
});
});

0 comments on commit 46529fe

Please sign in to comment.