From 8434c04dc11869fd24b1668da51d468b5264b0bc Mon Sep 17 00:00:00 2001 From: Karolina Rakoczy Date: Thu, 11 Feb 2021 16:51:29 +0100 Subject: [PATCH] Fix regex in orders --- cypress/integration/dashboard.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cypress/integration/dashboard.js b/cypress/integration/dashboard.js index e71f33ce3..c8a7363e7 100644 --- a/cypress/integration/dashboard.js +++ b/cypress/integration/dashboard.js @@ -47,7 +47,7 @@ describe("User authorization", () => { const randomNameProductOutOfStock = `${startsWith}${faker.random.number()}`; const shippingPrice = 12; const productPrice = 22; - let sales = productPrice * 2 + shippingPrice; + const sales = productPrice * 2 + shippingPrice; // Create channel, customer, product - everything needed to create order cy.fixture("addresses").then(json => { @@ -134,13 +134,12 @@ describe("User authorization", () => { .get(DASHBOARD_SELECTORS.dataAreLoading) .should("not.exist"); const regex = /^1\D+/; - sales = sales.toFixed(2).replace(".", ","); cy.softAssertMatch(DASHBOARD_SELECTORS.ordersReadyToFulfill, regex) .softAssertMatch(DASHBOARD_SELECTORS.paymentsWaitingForCapture, regex) .softAssertMatch(DASHBOARD_SELECTORS.productsOutOfStock, regex) .softAssertMatch( DASHBOARD_SELECTORS.sales, - new RegExp(`\\D+${sales}\\D+`) + new RegExp(`\\D+${sales}[\,\.]00\\D+`) ) .softAssertMatch(DASHBOARD_SELECTORS.orders, /\D+2\D*/); });