import { render, screen } from '@testing-library/react'; import { MemoryRouter } from 'react-router-dom'; import { Deposit } from './deposit'; jest.mock('@vegaprotocol/deposits', () => ({ DepositContainer: ({ assetId }: { assetId?: string }) => (
{assetId}
), })); jest.mock('./deposit-get-started', () => ({ DepositGetStarted: () =>
DepositGetStarted
, })); const renderJsx = (route = '/deposit') => { render( ); }; describe('Deposit page', () => { it('assetId should be passed down', () => { const assetId = 'foo'; const route = '/deposit?assetId=' + assetId; renderJsx(route); expect(screen.getByTestId('assetId')).toHaveTextContent(assetId); }); });