feat(positions): do not show liquidation price if position openVolume is 0 (#5990)
This commit is contained in:
parent
7620f0b67d
commit
475b52bcaf
@ -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');
|
||||
|
@ -400,7 +400,7 @@ export const PositionsTable = ({
|
||||
sortable: false,
|
||||
filter: false,
|
||||
cellRenderer: ({ data }: VegaICellRendererParams<Position>) => {
|
||||
if (!data) {
|
||||
if (!data || data.openVolume === '0') {
|
||||
return '-';
|
||||
}
|
||||
return (
|
||||
|
Loading…
Reference in New Issue
Block a user