Fix broken CSS classes and update JS unit snapshots (#45732)

* Fix broken CSS classes and update JS unit snapshots

* Add changefile(s) from automation for the following project(s): woocommerce-blocks

---------

Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
Niels Lange 2024-03-20 17:42:05 +07:00 committed by GitHub
parent 49b92070cc
commit fa49848cf9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 50 additions and 22 deletions

View File

@ -85,7 +85,7 @@ const TotalsFooterItem = ( {
const priceComponent = (
<FormattedMonetaryAmount
className="wc-block-components-totals-item__value"
className="wc-block-components-totals-footer-item-tax-value"
currency={ currency }
value={ parseInt( totalPrice, 10 ) }
/>

View File

@ -10,11 +10,15 @@ exports[`TotalsFooterItem Does not show the "including %s of tax" line if tax is
>
Total
</span>
<span
class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value"
<div
class="wc-block-components-totals-item__value"
>
£85.00
</span>
<span
class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-footer-item-tax-value"
>
£85.00
</span>
</div>
<div
class="wc-block-components-totals-item__description"
/>
@ -32,11 +36,15 @@ exports[`TotalsFooterItem Does not show the "including %s of tax" line if tax is
>
Total
</span>
<span
class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value"
<div
class="wc-block-components-totals-item__value"
>
£85.00
</span>
<span
class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-footer-item-tax-value"
>
£85.00
</span>
</div>
<div
class="wc-block-components-totals-item__description"
/>
@ -54,11 +62,15 @@ exports[`TotalsFooterItem Shows the "including %s TAX LABEL" line with single ta
>
Total
</span>
<span
class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value"
<div
class="wc-block-components-totals-item__value"
>
£85.00
</span>
<span
class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-footer-item-tax-value"
>
£85.00
</span>
</div>
<div
class="wc-block-components-totals-item__description"
>
@ -82,11 +94,15 @@ exports[`TotalsFooterItem Shows the "including %s TAX LABELS" line with multiple
>
Total
</span>
<span
class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value"
<div
class="wc-block-components-totals-item__value"
>
£85.00
</span>
<span
class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-footer-item-tax-value"
>
£85.00
</span>
</div>
<div
class="wc-block-components-totals-item__description"
>
@ -110,11 +126,15 @@ exports[`TotalsFooterItem Shows the "including %s of tax" line if tax is greater
>
Total
</span>
<span
class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-item__value"
<div
class="wc-block-components-totals-item__value"
>
£85.00
</span>
<span
class="wc-block-formatted-money-amount wc-block-components-formatted-money-amount wc-block-components-totals-footer-item-tax-value"
>
£85.00
</span>
</div>
<div
class="wc-block-components-totals-item__description"
>

View File

@ -26,7 +26,11 @@ const TotalsItemValue = ( {
currency,
}: Partial< TotalsItemProps > ): ReactElement | null => {
if ( isValidElement( value ) ) {
return <>{ value }</>;
return (
<div className="wc-block-components-totals-item__value">
{ value }
</div>
);
}
return Number.isFinite( value ) ? (

View File

@ -0,0 +1,4 @@
Significance: minor
Type: fix
Fix broken CSS styles of the `totalValue` filter.