fix(orders): cancel all and pegged orders amendable (#3843)

This commit is contained in:
m.ray 2023-05-19 17:55:08 +03:00 committed by GitHub
parent 0db5d0ce87
commit fd338c7400
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 11 deletions

View File

@ -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);
}); });
}); });

View File

@ -133,11 +133,9 @@ export const OrderListManager = ({
const cancelAll = useCallback(() => { const cancelAll = useCallback(() => {
create({ create({
orderCancellation: { orderCancellation: {},
marketId,
},
}); });
}, [create, marketId]); }, [create]);
return ( return (
<> <>

View File

@ -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([

View File

@ -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;
} }