use correct coupon codes to total $0
This commit is contained in:
parent
1195e79c17
commit
de759607d1
|
@ -49,7 +49,7 @@ const runCheckoutApplyCouponsTest = () => {
|
||||||
let couponPercentage;
|
let couponPercentage;
|
||||||
let couponFixedProduct;
|
let couponFixedProduct;
|
||||||
|
|
||||||
describe('Checkout applying coupons', () => {
|
describe('Checkout coupons', () => {
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
await merchant.login();
|
await merchant.login();
|
||||||
await createSimpleProduct();
|
await createSimpleProduct();
|
||||||
|
@ -95,14 +95,14 @@ const runCheckoutApplyCouponsTest = () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('prevents customer applying same coupon twice', async () => {
|
it('prevents customer applying same coupon twice', async () => {
|
||||||
await applyCouponToCart( couponPercentage );
|
await applyCouponToCart( couponFixedCart );
|
||||||
await expect(page).toMatchElement('.woocommerce-message', {text: 'Coupon code applied successfully.'});
|
await expect(page).toMatchElement('.woocommerce-message', {text: 'Coupon code applied successfully.'});
|
||||||
await applyCouponToCart( couponPercentage );
|
await applyCouponToCart( couponFixedCart );
|
||||||
await expect(page).toMatchElement('.woocommerce-error li', { text: 'Coupon code already applied!' });
|
await expect(page).toMatchElement('.woocommerce-error li', { text: 'Coupon code already applied!' });
|
||||||
});
|
});
|
||||||
|
|
||||||
it('allows customer to apply multiple coupon', async () => {
|
it('allows customer to apply multiple coupons', async () => {
|
||||||
await applyCouponToCart( couponFixedCart );
|
await applyCouponToCart( couponFixedProduct );
|
||||||
await expect(page).toMatchElement('.woocommerce-message', {text: 'Coupon code applied successfully.'});
|
await expect(page).toMatchElement('.woocommerce-message', {text: 'Coupon code applied successfully.'});
|
||||||
await expect(page).toMatchElement('.order-total .amount', {text: '$0.00'});
|
await expect(page).toMatchElement('.order-total .amount', {text: '$0.00'});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue