Skip to content

Commit

Permalink
Improve regular expressions syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
zeina-idris committed Feb 11, 2019
1 parent c778adb commit 3d455eb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions tests/e2e/specs/productDetailPage_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ describe('Product detail page', () => {

cy.wrap($product)
.find('[data-test=product-old-price]')
.contains(/\s*248,75\s€/);
.contains(/^\s*248,75\s€\s*$/);

cy.wrap($product)
.find('[data-test=product-new-price]')
.contains(/\s*174,12\s€/);
.contains(/^\s*174,12\s€\s*$/);

cy.wrap($product)
.find('[data-test=product-attributes-accordion]')
Expand All @@ -30,7 +30,7 @@ describe('Product detail page', () => {
.find('[data-test=product-attributes-list]')
.should('have.length', 7)
.eq(2)
.contains(/\s*size:\s+34\s*/);
.contains(/^\s*size:\s+34\s*$/);
});

cy.get('[data-test=product-gallery]')
Expand Down
6 changes: 3 additions & 3 deletions tests/e2e/specs/productThumbnail_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ describe('Product thumbnail', () => {

cy.wrap($thumbnail)
.find('[data-test=product-old-price]')
.contains(/\s*248,75\s€/);
.contains(/^\s*248,75\s€\s*$/);

cy.wrap($thumbnail)
.find('[data-test=product-new-price]')
.contains(/\s*174,12\s€/);
.contains(/^\s*174,12\s€\s*$/);
});

cy.get('[data-test=product-thumbnail-name]')
Expand All @@ -38,7 +38,7 @@ describe('Product thumbnail', () => {

cy.wrap($thumbnail)
.find('[data-test=product-original-price]')
.contains(/\s*231,25\s€/);
.contains(/\s*231,25\s€\s*$/);

cy.wrap($thumbnail)
.find('[data-test=product-new-price]')
Expand Down

0 comments on commit 3d455eb

Please sign in to comment.