From a6961b9ed1208613defea275d8f95f2d40ab62b4 Mon Sep 17 00:00:00 2001 From: Raluca Stan Date: Tue, 12 Apr 2022 15:44:40 +0200 Subject: [PATCH 1/3] Add box sizing to Totals item --- packages/checkout/components/totals/item/style.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/checkout/components/totals/item/style.scss b/packages/checkout/components/totals/item/style.scss index 1d623feb996..3500233949b 100644 --- a/packages/checkout/components/totals/item/style.scss +++ b/packages/checkout/components/totals/item/style.scss @@ -2,6 +2,7 @@ display: flex; flex-wrap: wrap; width: 100%; + box-sizing: border-box; } .wc-block-components-totals-item__label { From 5c9d5c522211bb7de6a66a920c0531ef54c99c75 Mon Sep 17 00:00:00 2001 From: Raluca Stan Date: Tue, 12 Apr 2022 15:45:07 +0200 Subject: [PATCH 2/3] Add some unit tests for Order summary blocks --- assets/js/blocks/cart/test/block.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/assets/js/blocks/cart/test/block.js b/assets/js/blocks/cart/test/block.js index 6a37e224821..17f94e2ea7d 100644 --- a/assets/js/blocks/cart/test/block.js +++ b/assets/js/blocks/cart/test/block.js @@ -25,6 +25,7 @@ import OrderSummaryBlock from '../inner-blocks/cart-order-summary-block/frontend import ExpressPaymentBlock from '../inner-blocks/cart-express-payment-block/block'; import ProceedToCheckoutBlock from '../inner-blocks/proceed-to-checkout-block/block'; import AcceptedPaymentMethodsIcons from '../inner-blocks/cart-accepted-payment-methods-block/block'; +import OrderSummaryHeadingBlock from '../inner-blocks/cart-order-summary-heading/frontend'; import OrderSummarySubtotalBlock from '../inner-blocks/cart-order-summary-subtotal/frontend'; import OrderSummaryShippingBlock from '../inner-blocks/cart-order-summary-shipping/frontend'; import OrderSummaryTaxesBlock from '../inner-blocks/cart-order-summary-taxes/frontend'; @@ -49,6 +50,7 @@ const CartBlock = ( { + { it( 'renders cart if there are items in the cart', async () => { render( ); await waitFor( () => expect( fetchMock ).toHaveBeenCalled() ); + expect( screen.getByText( /Proceed to Checkout/i ) ).toBeInTheDocument(); @@ -110,6 +113,20 @@ describe( 'Testing cart', () => { expect( screen.getByText( /Tax/i ) ).toBeInTheDocument(); } ); + it( 'Contains a Order summary header', async () => { + render( ); + + await waitFor( () => expect( fetchMock ).toHaveBeenCalled() ); + expect( screen.getByText( /Cart totals/i ) ).toBeInTheDocument(); + } ); + + it( 'Contains a Order summary Subtotal section', async () => { + render( ); + + await waitFor( () => expect( fetchMock ).toHaveBeenCalled() ); + expect( screen.getByText( /Subtotal/i ) ).toBeInTheDocument(); + } ); + it( 'Shows individual tax lines if the store is set to do so', async () => { allSettings.displayCartPricesIncludingTax = false; allSettings.displayItemizedTaxes = true; From d33f2d6da64195d47ae7daa2e3ef9f94a3d820aa Mon Sep 17 00:00:00 2001 From: Raluca Stan Date: Tue, 12 Apr 2022 16:18:22 +0200 Subject: [PATCH 3/3] Fix Proceed to checkout button size --- .../cart/inner-blocks/proceed-to-checkout-block/style.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/assets/js/blocks/cart/inner-blocks/proceed-to-checkout-block/style.scss b/assets/js/blocks/cart/inner-blocks/proceed-to-checkout-block/style.scss index 5307d0bd729..2bcd5aa9685 100644 --- a/assets/js/blocks/cart/inner-blocks/proceed-to-checkout-block/style.scss +++ b/assets/js/blocks/cart/inner-blocks/proceed-to-checkout-block/style.scss @@ -6,6 +6,7 @@ .wc-block-cart__submit-button { width: 100%; margin: 0; + box-sizing: border-box; } .wc-block-cart {