mars-v2-frontend/__tests__/components/MarketAssetTable/MarketDetails.test.tsx
Linkie Link cfd7fb3073
Pre migration adjustments (#506)
* fix: added close button to accountDetails

* fix: fixed the AccountList to load async

* fix: fixed the heart size on the AccountStats

* fix: added AccountDetails loading state

* feat: added migration banner

* fix: fixed tests
2023-09-25 20:17:43 +02:00

39 lines
1004 B
TypeScript

import { render } from '@testing-library/react'
import MarketDetails from 'components/MarketAssetTable/MarketDetails'
import { ASSETS } from 'constants/assets'
import { BN } from 'utils/helpers'
const data: LendingMarketTableData = {
asset: ASSETS[0],
marketDepositAmount: BN('890546916'),
accountLentValue: BN('0.5498406009348686811'),
marketLiquidityAmount: BN('629396551'),
marketDepositCap: BN('2500000000000'),
marketLiquidityRate: 0.017,
marketLiquidationThreshold: 0.61,
marketMaxLtv: 0.59,
borrowEnabled: true,
}
jest.mock('hooks/useDisplayCurrencyPrice', () => () => {
const { BN } = require('utils/helpers')
return {
getConversionRate: () => BN(1),
convertAmount: () => BN(1),
symbol: 'MARS',
}
})
describe('<LendingDetails />', () => {
afterAll(() => {
jest.unmock('hooks/usePrices')
})
it('should render', () => {
const { container } = render(<MarketDetails type='lend' data={data} />)
expect(container).toBeInTheDocument()
})
})