diff --git a/libs/positions/src/lib/positions-table.spec.tsx b/libs/positions/src/lib/positions-table.spec.tsx index fea30e37a..9aabbb4ae 100644 --- a/libs/positions/src/lib/positions-table.spec.tsx +++ b/libs/positions/src/lib/positions-table.spec.tsx @@ -102,7 +102,7 @@ describe('Positions', () => { expect(cell.getByTestId('stack-cell-secondary')).toHaveTextContent('12.3'); }); - it('doesnt render entry / mark if market is in opening auction', async () => { + it('does not render entry / mark if market is in opening auction', async () => { await renderComponent({ ...singleRow, marketTradingMode: Schema.MarketTradingMode.TRADING_MODE_OPENING_AUCTION, @@ -118,6 +118,15 @@ describe('Positions', () => { expect(cells[4].textContent).toEqual('liquidation price'); }); + it('do not displays liquidation price if openVolume is 0', async () => { + await renderComponent({ + ...singleRow, + openVolume: '0', + }); + const cells = screen.getAllByRole('gridcell'); + expect(cells[4].textContent).toEqual('-'); + }); + it('displays margin and leverage', async () => { await renderComponent(singleRow); const cells = screen.getAllByRole('gridcell'); diff --git a/libs/positions/src/lib/positions-table.tsx b/libs/positions/src/lib/positions-table.tsx index fa5317ba6..39d7ad0dd 100644 --- a/libs/positions/src/lib/positions-table.tsx +++ b/libs/positions/src/lib/positions-table.tsx @@ -400,7 +400,7 @@ export const PositionsTable = ({ sortable: false, filter: false, cellRenderer: ({ data }: VegaICellRendererParams) => { - if (!data) { + if (!data || data.openVolume === '0') { return '-'; } return (