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

Commit

Permalink
Fix/order summary sidebar css (#6231)
Browse files Browse the repository at this point in the history
* Add box sizing to Totals item

* Add some unit tests for Order summary blocks

* Fix Proceed to checkout button size
  • Loading branch information
ralucaStan authored Apr 12, 2022
1 parent 40180ae commit 669aee7
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
.wc-block-cart__submit-button {
width: 100%;
margin: 0;
box-sizing: border-box;
}

.wc-block-cart {
Expand Down
17 changes: 17 additions & 0 deletions assets/js/blocks/cart/test/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -49,6 +50,7 @@ const CartBlock = ( {
</ItemsBlock>
<TotalsBlock>
<OrderSummaryBlock>
<OrderSummaryHeadingBlock />
<OrderSummarySubtotalBlock />
<OrderSummaryShippingBlock
isShippingCalculatorEnabled={
Expand Down Expand Up @@ -93,6 +95,7 @@ describe( 'Testing cart', () => {
it( 'renders cart if there are items in the cart', async () => {
render( <CartBlock /> );
await waitFor( () => expect( fetchMock ).toHaveBeenCalled() );

expect(
screen.getByText( /Proceed to Checkout/i )
).toBeInTheDocument();
Expand All @@ -110,6 +113,20 @@ describe( 'Testing cart', () => {
expect( screen.getByText( /Tax/i ) ).toBeInTheDocument();
} );

it( 'Contains a Order summary header', async () => {
render( <CartBlock /> );

await waitFor( () => expect( fetchMock ).toHaveBeenCalled() );
expect( screen.getByText( /Cart totals/i ) ).toBeInTheDocument();
} );

it( 'Contains a Order summary Subtotal section', async () => {
render( <CartBlock /> );

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;
Expand Down
1 change: 1 addition & 0 deletions packages/checkout/components/totals/item/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
display: flex;
flex-wrap: wrap;
width: 100%;
box-sizing: border-box;
}

.wc-block-components-totals-item__label {
Expand Down

0 comments on commit 669aee7

Please sign in to comment.