fix: trading e2e mocks

* fix: mock gql query data

* fix: optional chaining for simple market list test, remove cucumber config file
This commit is contained in:
Matthew Russell 2022-06-28 17:18:00 -07:00 committed by GitHub
parent 54bad195b8
commit eba3b6a5b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 6 deletions

View File

@ -60,7 +60,7 @@ describe('market list', () => {
cy.intercept('POST', '/query').as('Filters');
cy.visit('/markets');
cy.wait('@Filters').then((filters) => {
if (filters?.response?.body.data.markets.length) {
if (filters?.response?.body?.data?.markets?.length) {
const asset =
filters.response.body.data.markets[0].tradableInstrument.instrument
.product.settlementAsset.symbol;

View File

@ -1,3 +0,0 @@
{
"stepDefinitions": "src/support/step_definitions"
}

View File

@ -18,8 +18,9 @@ export const aliasQuery = (
if (hasOperationName(req, operationName)) {
req.alias = operationName;
if (data !== undefined) {
req.reply((res) => {
res.body.data = data;
req.reply({
statusCode: 200,
body: { data },
});
}
}