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

Cross-Sells block: Replace <AddToCartButton /> with <ProductButton /> #8914

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import { Block as ProductRating } from '../../../atomic/blocks/product-elements/
import { Block as ProductSaleBadge } from '../../../atomic/blocks/product-elements/sale-badge/block';
import { Block as ProductPrice } from '../../../atomic/blocks/product-elements/price/block';
import { Block as ProductButton } from '../../../atomic/blocks/product-elements/button/block';
import AddToCartButton from '../../../atomic/blocks/product-elements/add-to-cart/block';

interface CrossSellsProductProps {
product: ProductResponseItem;
Expand Down Expand Up @@ -59,11 +58,7 @@ const CartCrossSellsProduct = ( {
/>
<ProductPrice />
</div>
{ product.is_in_stock ? (
<AddToCartButton />
) : (
<ProductButton />
) }
<ProductButton />
</ProductDataContextProvider>
</InnerBlockLayoutContextProvider>
</div>
Expand Down
4 changes: 2 additions & 2 deletions tests/utils/shopper.js
Original file line number Diff line number Diff line change
Expand Up @@ -388,10 +388,10 @@ export const shopper = {

addCrossSellsProductToCart: async () => {
await page.waitForSelector(
'.wc-block-components-product-add-to-cart-button'
'.wp-block-cart-cross-sells-product__product-add-to-cart .wc-block-components-product-button__button'
);
expect( page ).toClick(
'.wc-block-components-product-add-to-cart-button'
'.wp-block-cart-cross-sells-product__product-add-to-cart .wc-block-components-product-button__button'
);
},

Expand Down