diff --git a/libs/orders/src/lib/components/order-list/order-list.spec.tsx b/libs/orders/src/lib/components/order-list/order-list.spec.tsx index b9395600e..f8fdacba5 100644 --- a/libs/orders/src/lib/components/order-list/order-list.spec.tsx +++ b/libs/orders/src/lib/components/order-list/order-list.spec.tsx @@ -33,7 +33,7 @@ const defaultProps: OrderListTableProps = { const generateJsx = ( props: Partial = defaultProps, - context: PartialDeep = { keypair: { pub: '0x123' } } + context: PartialDeep = { pubKey: '0x123' } ) => { return ( @@ -166,7 +166,7 @@ describe('OrderListTable', () => { expect(mockCancel).toHaveBeenCalledWith(order); }); - it('doesnt show buttons for liquidity provision orders', async () => { + it('shows if an order is a liquidity provision order and does not show order actions', async () => { const order = generateOrder({ type: OrderType.TYPE_LIMIT, timeInForce: OrderTimeInForce.TIME_IN_FORCE_GTC, @@ -178,10 +178,12 @@ describe('OrderListTable', () => { }); const amendCell = getAmendCell(); + const typeCell = screen.getAllByRole('gridcell')[2]; + expect(typeCell).toHaveTextContent('Liquidity provision'); expect(amendCell.queryAllByRole('button')).toHaveLength(0); }); - it('doesnt show buttons for pegged orders', async () => { + it('shows if an order is a pegged order and does not show order actions', async () => { const order = generateOrder({ type: OrderType.TYPE_LIMIT, timeInForce: OrderTimeInForce.TIME_IN_FORCE_GTC, @@ -195,6 +197,8 @@ describe('OrderListTable', () => { }); const amendCell = getAmendCell(); + const typeCell = screen.getAllByRole('gridcell')[2]; + expect(typeCell).toHaveTextContent('Pegged'); expect(amendCell.queryAllByRole('button')).toHaveLength(0); }); @@ -221,7 +225,7 @@ describe('OrderListTable', () => { OrderStatus.STATUS_FILLED, OrderStatus.STATUS_REJECTED, OrderStatus.STATUS_STOPPED, - ])('doesnt show buttons for %s orders', async (status) => { + ])('does not show buttons for %s orders', async (status) => { const order = generateOrder({ type: OrderType.TYPE_LIMIT, status, diff --git a/libs/orders/src/lib/components/order-list/order-list.tsx b/libs/orders/src/lib/components/order-list/order-list.tsx index 91be880ce..e192ad84e 100644 --- a/libs/orders/src/lib/components/order-list/order-list.tsx +++ b/libs/orders/src/lib/components/order-list/order-list.tsx @@ -144,9 +144,12 @@ export const OrderListTable = forwardRef( ) => { if (!value) return '-'; + if (order.peggedOrder) return t('Pegged'); + if (order.liquidityProvision) return t('Liquidity provision'); return OrderTypeMapping[value]; }} />