Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
Fix the "Strict mode violation" error
Browse files Browse the repository at this point in the history
  • Loading branch information
tarhi-saad committed Oct 27, 2023
1 parent e1b6b4c commit f684f69
Showing 1 changed file with 0 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,34 +73,9 @@ test.describe( 'Shopper → Cart block', () => {
);
await frontendUtils.goToShop();
await frontendUtils.emptyCart();
await frontendUtils.addToCart( DISCOUNTED_PRODUCT_NAME );
await frontendUtils.addToCart( REGULAR_PRICED_PRODUCT_NAME );
await frontendUtils.goToCart();

// Ensure no discount label is present on the products in the cart
const capRow = await pageObject.findProductRow(
DISCOUNTED_PRODUCT_NAME
);
await expect( capRow ).toBeVisible();
const capRegularPriceElement = capRow.locator(
'.wc-block-components-product-price__regular'
);
const capDiscountedPriceElement = capRow.locator(
'.wc-block-components-product-price__value.is-discounted'
);
await expect( capRegularPriceElement ).toBeHidden();
await expect( capDiscountedPriceElement ).toBeHidden();

// Locate the price element within the Cap product row
const capPriceElement = capRow?.locator(
'.wc-block-components-product-price__value'
);
await expect( capPriceElement ).toBeVisible();

// Get the text content of the price element and check the price
const capPriceText = await capPriceElement.textContent();
expect( capPriceText ).toBe( '$50.00' );

const hoodieRow = await pageObject.findProductRow(
REGULAR_PRICED_PRODUCT_NAME
);
Expand Down

0 comments on commit f684f69

Please sign in to comment.