fix: use position decimal places for volume and decimal places … (#1026)

* fix: #1025 use position decimal places for volume and decimal places for price and interest

* fix: market-info.cy.ts test

* fix: market-info.cy.ts
This commit is contained in:
m.ray 2022-08-15 10:42:34 +02:00 committed by GitHub
parent 80ae079633
commit 445897eb2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 32 additions and 10 deletions

View File

@ -23,16 +23,21 @@ describe('market info is displayed', () => {
validateMarketDataRow(2, 'Liquidity Fee', '1.00%');
});
it('market data displated', () => {
cy.getByTestId(marketTitle).contains('Market data').click();
it('market volume displayed', () => {
cy.getByTestId(marketTitle).contains('Market volume').click();
validateMarketDataRow(0, 'Indicative Volume', '0');
validateMarketDataRow(1, 'Best Bid Volume', '5');
validateMarketDataRow(2, 'Best Offer Volume', '1');
validateMarketDataRow(3, 'Best Static Bid Volume', '5');
validateMarketDataRow(4, 'Best Static Offer Volume', '1');
});
it('market price and interest displayed', () => {
cy.getByTestId(marketTitle).contains('Market price and interest').click();
validateMarketDataRow(0, 'Mark Price', '57.49');
validateMarketDataRow(1, 'Indicative Volume', '0');
validateMarketDataRow(2, 'Best Bid Volume', '5');
validateMarketDataRow(3, 'Best Offer Volume', '1');
validateMarketDataRow(4, 'Best Static Bid Volume', '5');
validateMarketDataRow(5, 'Best Static Offer Volume', '1');
validateMarketDataRow(6, 'Open Interest', '0.00');
validateMarketDataRow(1, 'Open Interest', '0.00');
});
it('key details displayed', () => {

View File

@ -193,14 +193,31 @@ export const Info = ({ market }: InfoProps) => {
),
},
{
title: t('Market data'),
title: t('Market price and interest'),
content: (
<MarketInfoTable
data={market.data}
data={pick(market.data, 'name', 'markPrice', 'openInterest')}
decimalPlaces={market.decimalPlaces}
/>
),
},
{
title: t('Market volume'),
content: (
<MarketInfoTable
data={pick(
market.data,
'name',
'indicativeVolume',
'bestBidVolume',
'bestOfferVolume',
'bestStaticBidVolume',
'bestStaticOfferVolume'
)}
decimalPlaces={market.positionDecimalPlaces}
/>
),
},
];
const keyDetails = pick(