2023-06-15 12:34:12 +00:00
|
|
|
import { render } from '@testing-library/react'
|
|
|
|
|
2023-07-24 07:44:45 +00:00
|
|
|
import MarketDetails from 'components/MarketAssetTable/MarketDetails'
|
2023-06-15 12:34:12 +00:00
|
|
|
import { ASSETS } from 'constants/assets'
|
|
|
|
import { BN } from 'utils/helpers'
|
|
|
|
|
|
|
|
const data: LendingMarketTableData = {
|
|
|
|
asset: ASSETS[0],
|
|
|
|
marketDepositAmount: BN('890546916'),
|
2023-06-23 10:30:08 +00:00
|
|
|
accountLentValue: BN('0.5498406009348686811'),
|
2023-06-15 12:34:12 +00:00
|
|
|
marketLiquidityAmount: BN('629396551'),
|
|
|
|
marketDepositCap: BN('2500000000000'),
|
|
|
|
marketLiquidityRate: 0.017,
|
|
|
|
marketLiquidationThreshold: 0.61,
|
|
|
|
marketMaxLtv: 0.59,
|
|
|
|
}
|
|
|
|
|
|
|
|
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', () => {
|
2023-07-24 07:44:45 +00:00
|
|
|
const { container } = render(<MarketDetails type='lend' data={data} />)
|
2023-06-15 12:34:12 +00:00
|
|
|
expect(container).toBeInTheDocument()
|
|
|
|
})
|
|
|
|
})
|