Critical flows: Shopper → Cart → Can remove product (https://github.com/woocommerce/woocommerce-blocks/pull/6015)

* Added test case for Critical flows: Shopper → Cart → Can remove product
This commit is contained in:
Tarun Vijwani 2022-03-10 15:47:53 +04:00 committed by GitHub
parent f15d628610
commit 0530048f4c
1 changed files with 30 additions and 0 deletions

View File

@ -0,0 +1,30 @@
/**
* Internal dependencies
*/
import { shopper } from '../../../utils';
import { SIMPLE_PRODUCT_NAME } from '../../../utils/constants';
if ( process.env.WOOCOMMERCE_BLOCKS_PHASE < 2 )
// eslint-disable-next-line jest/no-focused-tests
test.only( `skipping ${ block.name } tests`, () => {} );
describe( 'Shopper → Cart → Can remove product', () => {
beforeAll( async () => {
await shopper.block.emptyCart();
} );
it( 'Can remove product from cart', async () => {
await shopper.goToShop();
await shopper.addToCartFromShopPage( SIMPLE_PRODUCT_NAME );
await shopper.block.goToCart();
const removeProductLink = await page.$(
'.wc-block-cart-item__remove-link'
);
await removeProductLink.click();
// Verify product is removed from the cart'
await expect( page ).toMatchElement( 'h2', {
text: 'Your cart is currently empty!',
} );
} );
} );