From c8bd9828a032c3a28f905cbf5d0223b4c749998c Mon Sep 17 00:00:00 2001 From: PeteWilliams Date: Fri, 12 Aug 2022 17:49:27 +0100 Subject: [PATCH] Chore: Split settlement asset into separate market info section (#1028) * chore: split settlement asset into seperate market info section * fix: market-info.cy.ts test * fix: market-info.cy.ts Co-authored-by: Madalina Raicu --- .../src/integration/market-info.cy.ts | 15 +++++++++----- .../src/components/info-market.tsx | 20 ++++++++++++++++--- 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/apps/trading-e2e/src/integration/market-info.cy.ts b/apps/trading-e2e/src/integration/market-info.cy.ts index 23235264b..360ef8aaa 100644 --- a/apps/trading-e2e/src/integration/market-info.cy.ts +++ b/apps/trading-e2e/src/integration/market-info.cy.ts @@ -43,7 +43,7 @@ describe('market info is displayed', () => { validateMarketDataRow(2, 'Position Decimal Places', '0'); validateMarketDataRow(3, 'Trading Mode', 'Continuous'); validateMarketDataRow(4, 'State', 'Active'); - validateMarketDataRow(5, 'Market Id', 'market-0'); + validateMarketDataRow(5, 'Market ID', 'market-0'); }); it('instrument displayed', () => { @@ -53,13 +53,18 @@ describe('market info is displayed', () => { validateMarketDataRow(1, 'Code', 'BTCUSD.MF21'); validateMarketDataRow(2, 'Product Type', 'Future'); validateMarketDataRow(3, 'Quote Name', 'BTC'); + }); + + it('settlement asset displayed', () => { + cy.getByTestId(marketTitle).contains('Settlement asset').click(); + + validateMarketDataRow(0, 'Name', 'tBTC TEST'); + validateMarketDataRow(1, 'Symbol', 'tBTC'); validateMarketDataRow( - 4, - 'Id', + 2, + 'ID', '5cfa87844724df6069b94e4c8a6f03af21907d7bc251593d08e4251043ee9f7c' ); - validateMarketDataRow(5, 'Symbol', 'tBTC'); - validateMarketDataRow(6, 'Name', 'tBTC TEST'); }); it('metadata displayed', () => { diff --git a/libs/deal-ticket/src/components/info-market.tsx b/libs/deal-ticket/src/components/info-market.tsx index ad28e8f65..43d8d5d67 100644 --- a/libs/deal-ticket/src/components/info-market.tsx +++ b/libs/deal-ticket/src/components/info-market.tsx @@ -219,7 +219,7 @@ export const Info = ({ market }: InfoProps) => { { productType: market.tradableInstrument.instrument.product.__typename, ...market.tradableInstrument.instrument.product, - ...(market.tradableInstrument.instrument.product?.settlementAsset ?? - {}), + }} + /> + ), + }, + { + title: t('Settlement asset'), + content: ( + ),