fix(orders): cancel all and pegged orders amendable (#3843)
This commit is contained in:
parent
0db5d0ce87
commit
fd338c7400
@ -482,7 +482,7 @@ describe('amend and cancel order', { tags: '@smoke' }, () => {
|
|||||||
testOrderCancellation(order);
|
testOrderCancellation(order);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
it('must be able to cancel all orders on a market', () => {
|
it('must be able to cancel all orders on all markets', () => {
|
||||||
// 7003-MORD-009
|
// 7003-MORD-009
|
||||||
// 7003-MORD-010
|
// 7003-MORD-010
|
||||||
// 7003-MORD-011
|
// 7003-MORD-011
|
||||||
@ -496,9 +496,7 @@ describe('amend and cancel order', { tags: '@smoke' }, () => {
|
|||||||
.should('have.text', 'Cancel all')
|
.should('have.text', 'Cancel all')
|
||||||
.then(($btn) => {
|
.then(($btn) => {
|
||||||
cy.wrap($btn).click({ force: true });
|
cy.wrap($btn).click({ force: true });
|
||||||
const order: OrderCancellation = {
|
const order: OrderCancellation = {};
|
||||||
marketId: 'market-0',
|
|
||||||
};
|
|
||||||
testOrderCancellation(order);
|
testOrderCancellation(order);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -133,11 +133,9 @@ export const OrderListManager = ({
|
|||||||
|
|
||||||
const cancelAll = useCallback(() => {
|
const cancelAll = useCallback(() => {
|
||||||
create({
|
create({
|
||||||
orderCancellation: {
|
orderCancellation: {},
|
||||||
marketId,
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
}, [create, marketId]);
|
}, [create]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
@ -226,8 +226,8 @@ describe('OrderListTable', () => {
|
|||||||
const amendCell = getAmendCell();
|
const amendCell = getAmendCell();
|
||||||
const typeCell = screen.getAllByRole('gridcell')[2];
|
const typeCell = screen.getAllByRole('gridcell')[2];
|
||||||
expect(typeCell).toHaveTextContent('Mid - 10.0 Peg limit');
|
expect(typeCell).toHaveTextContent('Mid - 10.0 Peg limit');
|
||||||
expect(amendCell.queryByTestId('edit')).not.toBeInTheDocument();
|
expect(amendCell.queryByTestId('edit')).toBeInTheDocument();
|
||||||
expect(amendCell.queryByTestId('cancel')).not.toBeInTheDocument();
|
expect(amendCell.queryByTestId('cancel')).toBeInTheDocument();
|
||||||
});
|
});
|
||||||
|
|
||||||
it.each([
|
it.each([
|
||||||
|
@ -329,7 +329,7 @@ export const isOrderActive = (status: Schema.OrderStatus) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const isOrderAmendable = (order: Order | undefined) => {
|
export const isOrderAmendable = (order: Order | undefined) => {
|
||||||
if (!order || order.peggedOrder || order.liquidityProvision) {
|
if (!order || order.liquidityProvision) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user