forked from deriv-com/deriv-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WALL] Aizad/WALL-2899/WalletMarketCurrencyIcon-test-case (deriv-com#…
…15685) * chore: added WalletMarketCurrencyIcon test case * chore: rerun workflow
- Loading branch information
1 parent
c5fada5
commit f91a215
Showing
2 changed files
with
47 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
...allets/src/components/WalletMarketCurrencyIcon/__test__/WalletMarketCurrencyIcon.spec.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import React from 'react'; | ||
import { render, screen } from '@testing-library/react'; | ||
import { CFD_PLATFORMS, MARKET_TYPE } from '../../../features/cfd/constants'; | ||
import WalletMarketCurrencyIcon from '../WalletMarketCurrencyIcon'; | ||
import '@testing-library/jest-dom'; | ||
|
||
const defaultProps = { | ||
currency: 'USD', | ||
isDemo: false, | ||
}; | ||
describe('WalletMarketCurrencyIcon', () => { | ||
it('renders MT5 Financial Icon', () => { | ||
render( | ||
<WalletMarketCurrencyIcon | ||
{...defaultProps} | ||
marketType={MARKET_TYPE.FINANCIAL} | ||
platform={CFD_PLATFORMS.MT5} | ||
/> | ||
); | ||
const marketIcon = screen.getByTestId('dt_wallet_icon'); | ||
const currencyIcon = screen.getByTestId('dt_wallet_currency_icon'); | ||
expect(screen.getByTestId('dt_wallet_market_icon')).toBeInTheDocument(); | ||
expect(marketIcon).toBeInTheDocument(); | ||
expect(currencyIcon).toBeInTheDocument(); | ||
}); | ||
|
||
it('renders DXTrade icon', () => { | ||
render( | ||
<WalletMarketCurrencyIcon {...defaultProps} marketType={MARKET_TYPE.ALL} platform={CFD_PLATFORMS.DXTRADE} /> | ||
); | ||
const marketIcon = screen.getByTestId('dt_wallet_icon'); | ||
const currencyIcon = screen.getByTestId('dt_wallet_currency_icon'); | ||
expect(screen.getByTestId('dt_wallet_market_icon')).toBeInTheDocument(); | ||
expect(marketIcon).toBeInTheDocument(); | ||
expect(currencyIcon).toBeInTheDocument(); | ||
}); | ||
|
||
it('renders Options icon', () => { | ||
render(<WalletMarketCurrencyIcon {...defaultProps} marketType={undefined} platform={undefined} />); | ||
const marketIcon = screen.getByTestId('dt_wallet_icon'); | ||
const currencyIcon = screen.getByTestId('dt_wallet_currency_icon'); | ||
expect(screen.getByTestId('dt_wallet_market_icon')).toBeInTheDocument(); | ||
expect(marketIcon).toBeInTheDocument(); | ||
expect(currencyIcon).toBeInTheDocument(); | ||
}); | ||
}); |