fix regex

This commit is contained in:
Karolina Rakoczy 2021-02-17 00:11:46 +01:00
parent c361da5dc8
commit 9bb20551f9

View file

@ -179,8 +179,12 @@ describe("User authorization", () => {
totalAmount = totalAmount
.toFixed(2)
.toString()
.replace(".", "[,.]");
const regexp = new RegExp(`\\D*${totalAmount}\\D*`);
.split(".");
totalAmount = `\\D*${totalAmount[0].replace(
/(\d)(?=(\d{3})+(?!\d))/g,
"$1[,.]*"
)}[,.]${totalAmount[1]}\\D*`;
const regexp = new RegExp(totalAmount);
cy.visit(urlList.homePage);
homePageSteps.changeChannel(defaultChannel.name);
cy.contains(HOMEPAGE_SELECTORS.sales, regexp).should("be.visible");