test(trading): fix capsule place order test (#4286)

This commit is contained in:
daro-maj 2023-07-12 09:54:40 +02:00 committed by GitHub
parent 981c8649a2
commit 77e1390686
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,7 +2,6 @@ import { removeDecimal } from '@vegaprotocol/cypress';
import * as Schema from '@vegaprotocol/types'; import * as Schema from '@vegaprotocol/types';
import { import {
OrderStatusMapping, OrderStatusMapping,
OrderTimeInForceMapping,
OrderTypeMapping, OrderTypeMapping,
Side, Side,
} from '@vegaprotocol/types'; } from '@vegaprotocol/types';
@ -17,7 +16,6 @@ const orderStatus = 'status';
const orderRemaining = 'remaining'; const orderRemaining = 'remaining';
const orderPrice = 'price'; const orderPrice = 'price';
const orderTimeInForce = 'timeInForce'; const orderTimeInForce = 'timeInForce';
const orderCreatedAt = 'createdAt';
const orderUpdatedAt = 'updatedAt'; const orderUpdatedAt = 'updatedAt';
const assetSelectField = 'select[name="asset"]'; const assetSelectField = 'select[name="asset"]';
const amountField = 'input[name="amount"]'; const amountField = 'input[name="amount"]';
@ -260,10 +258,7 @@ describe('capsule', { tags: '@slow', testIsolation: true }, () => {
OrderStatusMapping.STATUS_ACTIVE OrderStatusMapping.STATUS_ACTIVE
); );
cy.get(`[col-id='${orderRemaining}']`).should( cy.get(`[col-id='${orderRemaining}']`).should('contain.text', '0.00');
'contain.text',
`0.00/${order.size}`
);
cy.get(`[col-id='${orderPrice}']`).then(($price) => { cy.get(`[col-id='${orderPrice}']`).then(($price) => {
expect(parseFloat($price.text())).to.equal(parseFloat(order.price)); expect(parseFloat($price.text())).to.equal(parseFloat(order.price));
@ -271,10 +266,10 @@ describe('capsule', { tags: '@slow', testIsolation: true }, () => {
cy.get(`[col-id='${orderTimeInForce}']`).should( cy.get(`[col-id='${orderTimeInForce}']`).should(
'contain.text', 'contain.text',
OrderTimeInForceMapping[order.timeInForce] 'GTC'
); );
checkIfDataAndTimeOfCreationAndUpdateIsEqual(orderCreatedAt); checkIfDataAndTimeOfCreationAndUpdateIsEqual(orderUpdatedAt);
}); });
}); });
}); });