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

Commit c410644

Browse files
Alex Floriscatarhi-saad
andauthored
Add static class name for product-details (#6914)
* Add a static class name for the product details item instead of the translatable string * Update Jest snapshot Co-authored-by: Saad Tarhi <[email protected]>
1 parent 6c68e0c commit c410644

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

assets/js/base/components/cart-checkout/product-details/index.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/**
22
* External dependencies
33
*/
4-
import { kebabCase } from 'lodash';
54
import { decodeEntities } from '@wordpress/html-entities';
65
import type { ProductResponseItemData } from '@woocommerce/type-defs/product-response';
76

@@ -32,15 +31,10 @@ const ProductDetails = ( {
3231
{ details.map( ( detail ) => {
3332
// Support both `key` and `name` props
3433
const name = detail?.key || detail.name || '';
35-
const className = name
36-
? `wc-block-components-product-details__${ kebabCase(
37-
name
38-
) }`
39-
: '';
4034
return (
4135
<li
4236
key={ name + ( detail.display || detail.value ) }
43-
className={ className }
37+
className="wc-block-components-product-details__item"
4438
>
4539
{ name && (
4640
<>

assets/js/base/components/cart-checkout/product-details/test/__snapshots__/index.js.snap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ exports[`ProductDetails should not render hidden details 1`] = `
55
className="wc-block-components-product-details"
66
>
77
<li
8-
className="wc-block-components-product-details__lorem"
8+
className="wc-block-components-product-details__item"
99
>
1010
<span
1111
className="wc-block-components-product-details__name"
@@ -32,7 +32,7 @@ exports[`ProductDetails should render details 1`] = `
3232
className="wc-block-components-product-details"
3333
>
3434
<li
35-
className="wc-block-components-product-details__lorem"
35+
className="wc-block-components-product-details__item"
3636
>
3737
<span
3838
className="wc-block-components-product-details__name"
@@ -48,7 +48,7 @@ exports[`ProductDetails should render details 1`] = `
4848
</span>
4949
</li>
5050
<li
51-
className="wc-block-components-product-details__lorem"
51+
className="wc-block-components-product-details__item"
5252
>
5353
<span
5454
className="wc-block-components-product-details__name"
@@ -64,7 +64,7 @@ exports[`ProductDetails should render details 1`] = `
6464
</span>
6565
</li>
6666
<li
67-
className=""
67+
className="wc-block-components-product-details__item"
6868
>
6969
7070
<span

0 commit comments

Comments
 (0)