@magento/venia-ui 9.2.0 → 9.3.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/i18n/en_US.json +17 -3
- package/lib/RootComponents/CMS/__tests__/__snapshots__/cms.spec.js.snap +19 -0
- package/lib/RootComponents/CMS/__tests__/cms.spec.js +4 -9
- package/lib/RootComponents/CMS/cms.js +5 -4
- package/lib/RootComponents/CMS/cms.shimmer.js +18 -0
- package/lib/RootComponents/Category/__tests__/__snapshots__/categoryContent.shimmer.spec.js.snap +12 -0
- package/lib/RootComponents/Category/categoryContent.js +4 -1
- package/lib/components/AccountChip/accountChip.js +3 -1
- package/lib/components/AccountInformationPage/accountInformationPage.js +3 -1
- package/lib/components/AccountInformationPage/editModal.js +9 -2
- package/lib/components/AccountMenu/accountMenuItems.js +8 -3
- package/lib/components/CartPage/GiftCards/giftCards.js +1 -1
- package/lib/components/CartPage/PriceAdjustments/CouponCode/couponCode.js +5 -1
- package/lib/components/CartPage/PriceAdjustments/GiftOptions/__tests__/__snapshots__/giftOptions.spec.js.snap +1018 -78
- package/lib/components/CartPage/PriceAdjustments/GiftOptions/__tests__/giftOptions.spec.js +221 -35
- package/lib/components/CartPage/PriceAdjustments/GiftOptions/giftOptions.js +287 -40
- package/lib/components/CartPage/PriceAdjustments/GiftOptions/giftOptions.module.css +56 -1
- package/lib/components/CartPage/PriceAdjustments/__tests__/__snapshots__/giftCardSection.ee.spec.js.snap +12 -0
- package/lib/components/CartPage/PriceAdjustments/__tests__/__snapshots__/giftOptionsSection.ce.spec.js.snap +3 -0
- package/lib/components/CartPage/PriceAdjustments/__tests__/__snapshots__/giftOptionsSection.ee.spec.js.snap +16 -0
- package/lib/components/CartPage/PriceAdjustments/__tests__/__snapshots__/priceAdjustments.spec.js.snap +1 -32
- package/lib/components/CartPage/PriceAdjustments/__tests__/giftCardSection.ce.spec.js +17 -0
- package/lib/components/CartPage/PriceAdjustments/__tests__/giftCardSection.ee.spec.js +36 -0
- package/lib/components/CartPage/PriceAdjustments/__tests__/giftOptionsSection.ce.spec.js +17 -0
- package/lib/components/CartPage/PriceAdjustments/__tests__/giftOptionsSection.ee.spec.js +54 -0
- package/lib/components/CartPage/PriceAdjustments/__tests__/priceAdjustments.spec.js +1 -1
- package/lib/components/CartPage/PriceAdjustments/{giftCardSection.js → giftCardSection.ce.js} +0 -0
- package/lib/components/CartPage/PriceAdjustments/giftOptionsSection.ce.js +7 -0
- package/lib/components/CartPage/PriceAdjustments/giftOptionsSection.ee.js +38 -0
- package/lib/components/CartPage/PriceAdjustments/priceAdjustments.js +2 -14
- package/lib/components/CartPage/PriceSummary/__tests__/__snapshots__/discountSummary.spec.js.snap +496 -42
- package/lib/components/CartPage/PriceSummary/__tests__/__snapshots__/giftCardSummary.ce.spec.js.snap +3 -0
- package/lib/components/CartPage/PriceSummary/__tests__/__snapshots__/{giftCardSummary.spec.js.snap → giftCardSummary.ee.spec.js.snap} +4 -4
- package/lib/components/CartPage/PriceSummary/__tests__/__snapshots__/giftOptionsSummary.ce.spec.js.snap +3 -0
- package/lib/components/CartPage/PriceSummary/__tests__/__snapshots__/giftOptionsSummary.ee.spec.js.snap +63 -0
- package/lib/components/CartPage/PriceSummary/__tests__/__snapshots__/priceSummary.spec.js.snap +201 -141
- package/lib/components/CartPage/PriceSummary/__tests__/discountSummary.spec.js +41 -1
- package/lib/components/CartPage/PriceSummary/__tests__/giftCardSummary.ce.spec.js +17 -0
- package/lib/components/CartPage/PriceSummary/__tests__/giftCardSummary.ee.spec.js +84 -0
- package/lib/components/CartPage/PriceSummary/__tests__/giftOptionsSummary.ce.spec.js +17 -0
- package/lib/components/CartPage/PriceSummary/__tests__/giftOptionsSummary.ee.spec.js +69 -0
- package/lib/components/CartPage/PriceSummary/__tests__/priceSummary.spec.js +2 -0
- package/lib/components/CartPage/PriceSummary/discountSummary.js +99 -49
- package/lib/components/CartPage/PriceSummary/discountSummary.module.css +40 -0
- package/lib/components/CartPage/PriceSummary/giftOptionsSummary.ce.js +5 -0
- package/lib/components/CartPage/PriceSummary/giftOptionsSummary.ee.js +40 -0
- package/lib/components/CartPage/PriceSummary/priceSummary.js +95 -53
- package/lib/components/CartPage/PriceSummary/priceSummary.module.css +2 -0
- package/lib/components/CartPage/ProductListing/EditModal/__tests__/__snapshots__/productDetail.spec.js.snap +57 -0
- package/lib/components/CartPage/ProductListing/EditModal/__tests__/__snapshots__/productForm.spec.js.snap +22 -0
- package/lib/components/CartPage/ProductListing/EditModal/__tests__/productDetail.spec.js +42 -3
- package/lib/components/CartPage/ProductListing/EditModal/productDetail.js +13 -10
- package/lib/components/CartPage/ProductListing/EditModal/productForm.js +7 -2
- package/lib/components/CartPage/ProductListing/product.js +1 -0
- package/lib/components/CartPage/ProductListing/productListing.js +1 -1
- package/lib/components/CartPage/cartPage.js +1 -1
- package/lib/components/Checkbox/checkbox.js +6 -1
- package/lib/components/Checkbox/checkbox.module.css +1 -0
- package/lib/components/CheckoutPage/ItemsReview/__tests__/__snapshots__/item.spec.js.snap +2 -2
- package/lib/components/CheckoutPage/ItemsReview/__tests__/__snapshots__/itemsReview.spec.js.snap +33 -0
- package/lib/components/CheckoutPage/ItemsReview/__tests__/item.spec.js +2 -2
- package/lib/components/CheckoutPage/ItemsReview/itemsReview.js +4 -1
- package/lib/components/CheckoutPage/OrderConfirmationPage/__tests__/createAccount.spec.js +4 -0
- package/lib/components/CheckoutPage/OrderConfirmationPage/createAccount.js +9 -1
- package/lib/components/CheckoutPage/OrderConfirmationPage/orderConfirmationPage.js +12 -3
- package/lib/components/CheckoutPage/PaymentInformation/__tests__/__snapshots__/creditCard.spec.js.snap +1 -0
- package/lib/components/CheckoutPage/PaymentInformation/__tests__/creditCard.spec.js +2 -1
- package/lib/components/CheckoutPage/PaymentInformation/brainTreeDropIn.js +2 -18
- package/lib/components/CheckoutPage/PaymentInformation/creditCard.js +13 -3
- package/lib/components/CheckoutPage/PriceAdjustments/__tests__/__snapshots__/priceAdjustments.spec.js.snap +1 -6
- package/lib/components/CheckoutPage/PriceAdjustments/__tests__/priceAdjustments.spec.js +2 -2
- package/lib/components/CheckoutPage/PriceAdjustments/priceAdjustments.js +8 -12
- package/lib/components/CheckoutPage/ShippingInformation/AddressForm/customerForm.js +1 -1
- package/lib/components/CheckoutPage/ShippingInformation/shippingInformation.js +4 -1
- package/lib/components/CheckoutPage/ShippingMethod/shippingMethod.js +5 -2
- package/lib/components/CheckoutPage/__tests__/__snapshots__/checkoutPage.spec.js.snap +3 -3
- package/lib/components/CheckoutPage/__tests__/checkoutPage.spec.js +5 -0
- package/lib/components/CheckoutPage/checkoutPage.js +25 -4
- package/lib/components/CheckoutPage/checkoutPage.module.css +8 -1
- package/lib/components/CmsDynamicBlock/__tests__/__snapshots__/cmsDynamicBlock.ce.spec.js.snap +3 -0
- package/lib/components/CmsDynamicBlock/__tests__/__snapshots__/cmsDynamicBlock.ee.spec.js.snap +61 -0
- package/lib/components/CmsDynamicBlock/__tests__/__snapshots__/dynamicBlock.spec.js.snap +7 -0
- package/lib/components/CmsDynamicBlock/__tests__/cmsDynamicBlock.ce.spec.js +17 -0
- package/lib/components/CmsDynamicBlock/__tests__/cmsDynamicBlock.ee.spec.js +211 -0
- package/lib/components/CmsDynamicBlock/__tests__/constants.spec.js +37 -0
- package/lib/components/CmsDynamicBlock/__tests__/dynamicBlock.spec.js +33 -0
- package/lib/components/CmsDynamicBlock/cmsDynamicBlock.ce.js +5 -0
- package/lib/components/CmsDynamicBlock/cmsDynamicBlock.ee.js +73 -0
- package/lib/components/CmsDynamicBlock/constants.js +6 -0
- package/lib/components/CmsDynamicBlock/dynamicBlock.js +32 -0
- package/lib/components/CmsDynamicBlock/index.js +2 -0
- package/lib/components/CreateAccount/__tests__/createAccount.spec.js +6 -1
- package/lib/components/CreateAccount/createAccount.js +7 -2
- package/lib/components/Field/field.module.css +6 -0
- package/lib/components/FilterSidebar/filterSidebar.js +4 -1
- package/lib/components/Footer/__tests__/__snapshots__/footer.spec.js.snap +8 -2
- package/lib/components/Footer/footer.js +16 -9
- package/lib/components/Footer/footer.module.css +7 -2
- package/lib/components/ForgotPassword/ForgotPasswordForm/__tests__/__snapshots__/forgotPasswordForm.spec.js.snap +109 -1
- package/lib/components/ForgotPassword/ForgotPasswordForm/__tests__/forgotPasswordForm.spec.js +22 -3
- package/lib/components/ForgotPassword/ForgotPasswordForm/forgotPasswordForm.js +13 -3
- package/lib/components/ForgotPassword/ForgotPasswordForm/forgotPasswordForm.module.css +1 -1
- package/lib/components/ForgotPassword/__tests__/__snapshots__/forgotPassword.spec.js.snap +5 -6
- package/lib/components/ForgotPassword/__tests__/forgotPassword.spec.js +41 -28
- package/lib/components/ForgotPassword/forgotPassword.js +10 -3
- package/lib/components/ForgotPassword/forgotPassword.module.css +2 -2
- package/lib/components/Gallery/__tests__/__snapshots__/gallery.spec.js.snap +22 -0
- package/lib/components/Gallery/__tests__/__snapshots__/item.spec.js.snap +17 -0
- package/lib/components/Gallery/addToCartButton.js +2 -0
- package/lib/components/Gallery/gallery.js +6 -1
- package/lib/components/Gallery/item.js +7 -2
- package/lib/components/GoogleReCaptcha/googleReCaptcha.js +49 -0
- package/lib/components/GoogleReCaptcha/googleReCaptcha.module.css +3 -0
- package/lib/components/GoogleReCaptcha/index.js +1 -0
- package/lib/components/Header/currencySwitcher.js +2 -1
- package/lib/components/Header/header.js +1 -1
- package/lib/components/Header/header.module.css +2 -2
- package/lib/components/Header/searchTrigger.js +3 -1
- package/lib/components/Header/storeSwitcher.js +18 -4
- package/lib/components/Header/switcherItem.js +4 -1
- package/lib/components/HomePage/homePage.module.css +12 -0
- package/lib/components/Image/resourceImage.js +8 -1
- package/lib/components/Image/simpleImage.js +8 -1
- package/lib/components/Link/link.js +15 -13
- package/lib/components/LoadingIndicator/spinner.js +5 -7
- package/lib/components/LoadingIndicator/spinner.module.css +4 -17
- package/lib/components/MiniCart/ProductList/__tests__/__snapshots__/item.spec.js.snap +44 -0
- package/lib/components/MiniCart/ProductList/__tests__/item.spec.js +2 -2
- package/lib/components/MiniCart/ProductList/item.js +3 -2
- package/lib/components/MiniCart/miniCart.js +6 -3
- package/lib/components/MyAccount/ResetPassword/__tests__/__snapshots__/resetPassword.spec.js.snap +274 -254
- package/lib/components/MyAccount/ResetPassword/__tests__/resetPassword.spec.js +10 -5
- package/lib/components/MyAccount/ResetPassword/resetPassword.js +55 -55
- package/lib/components/MyAccount/ResetPassword/resetPassword.module.css +27 -79
- package/lib/components/Newsletter/newsletter.js +6 -2
- package/lib/components/OrderHistoryPage/OrderDetails/__tests__/__snapshots__/item.spec.js.snap +11 -0
- package/lib/components/ProductFullDetail/productFullDetail.js +12 -3
- package/lib/components/ProductImageCarousel/__tests__/__snapshots__/carousel.spec.js.snap +61 -0
- package/lib/components/ProductImageCarousel/__tests__/__snapshots__/thumbnail.spec.js.snap +26 -0
- package/lib/components/ProductOptions/__tests__/options.spec.js +1 -1
- package/lib/components/ProductOptions/__tests__/swatch.spec.js +1 -1
- package/lib/components/ProductOptions/__tests__/swatchList.spec.js +1 -1
- package/lib/components/ProductOptions/__tests__/tile.spec.js +1 -1
- package/lib/components/ProductOptions/__tests__/tileList.spec.js +1 -1
- package/lib/components/ProductOptions/option.js +4 -1
- package/lib/components/ProductSort/productSort.js +22 -14
- package/lib/components/Rating/rating.js +1 -1
- package/lib/components/SearchBar/__tests__/__snapshots__/suggestedProduct.spec.js.snap +11 -0
- package/lib/components/SearchBar/autocomplete.js +4 -2
- package/lib/components/SearchBar/suggestedProduct.js +1 -1
- package/lib/components/SearchBar/suggestions.js +1 -1
- package/lib/components/SignIn/__tests__/signIn.spec.js +11 -20
- package/lib/components/SignIn/signIn.js +6 -16
- package/lib/components/TextInput/textInput.module.css +0 -4
- package/lib/components/Wishlist/WishlistDialog/WishlistLineItem/__tests__/__snapshots__/wishlistLineItem.spec.js.snap +5 -1
- package/lib/components/Wishlist/WishlistDialog/WishlistLineItem/wishlistLineItem.js +7 -1
- package/lib/components/Wishlist/WishlistDialog/WishlistLineItem/wishlistLineItem.module.css +7 -0
- package/lib/components/Wishlist/WishlistDialog/__tests__/__snapshots__/wishlistDialog.spec.js.snap +6 -1
- package/lib/components/WishlistPage/__tests__/__snapshots__/wishlist.spec.js.snap +4 -0
- package/lib/components/WishlistPage/__tests__/__snapshots__/wishlistItem.spec.js.snap +22 -0
- package/lib/components/WishlistPage/__tests__/__snapshots__/wishlistPage.spec.js.snap +9 -3
- package/lib/components/WishlistPage/createWishlist.ee.js +3 -1
- package/lib/components/WishlistPage/wishlist.js +1 -1
- package/lib/components/WishlistPage/wishlist.module.css +3 -0
- package/lib/components/WishlistPage/wishlistPage.js +1 -1
- package/package.json +4 -3
- package/lib/components/CartPage/PriceSummary/__tests__/giftCardSummary.spec.js +0 -84
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`#GiftOptionsSection EE renders loading 1`] = `null`;
|
|
4
|
+
|
|
5
|
+
exports[`#GiftOptionsSection EE renders not loading and not visible 1`] = `null`;
|
|
6
|
+
|
|
7
|
+
exports[`#GiftOptionsSection EE renders not loading and visible 1`] = `
|
|
8
|
+
<mock-Section
|
|
9
|
+
id="gift_options"
|
|
10
|
+
title="See Gift Options"
|
|
11
|
+
>
|
|
12
|
+
<require('./GiftOptions')
|
|
13
|
+
giftOptionsConfigData={Object {}}
|
|
14
|
+
/>
|
|
15
|
+
</mock-Section>
|
|
16
|
+
`;
|
|
@@ -68,38 +68,7 @@ exports[`it renders Venia price adjustments 1`] = `
|
|
|
68
68
|
</div>
|
|
69
69
|
</div>
|
|
70
70
|
<GiftCardSection />
|
|
71
|
-
<
|
|
72
|
-
<button
|
|
73
|
-
onClick={[Function]}
|
|
74
|
-
type="button"
|
|
75
|
-
>
|
|
76
|
-
<span>
|
|
77
|
-
<span>
|
|
78
|
-
See Gift Options
|
|
79
|
-
</span>
|
|
80
|
-
<span>
|
|
81
|
-
<svg
|
|
82
|
-
fill="none"
|
|
83
|
-
height={24}
|
|
84
|
-
stroke="currentColor"
|
|
85
|
-
strokeLinecap="round"
|
|
86
|
-
strokeLinejoin="round"
|
|
87
|
-
strokeWidth="2"
|
|
88
|
-
viewBox="0 0 24 24"
|
|
89
|
-
width={24}
|
|
90
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
91
|
-
>
|
|
92
|
-
<polyline
|
|
93
|
-
points="6 9 12 15 18 9"
|
|
94
|
-
/>
|
|
95
|
-
</svg>
|
|
96
|
-
</span>
|
|
97
|
-
</span>
|
|
98
|
-
</button>
|
|
99
|
-
<div>
|
|
100
|
-
<require('./GiftOptions') />
|
|
101
|
-
</div>
|
|
102
|
-
</div>
|
|
71
|
+
<GiftOptionsSection />
|
|
103
72
|
</div>
|
|
104
73
|
</div>
|
|
105
74
|
`;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { createTestInstance } from '@magento/peregrine';
|
|
4
|
+
|
|
5
|
+
import GiftCardSection from '../giftCardSection.ce';
|
|
6
|
+
|
|
7
|
+
const Component = () => {
|
|
8
|
+
return <GiftCardSection />;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
describe('#GiftCardSection CE', () => {
|
|
12
|
+
it('renders', () => {
|
|
13
|
+
const tree = createTestInstance(<Component />);
|
|
14
|
+
|
|
15
|
+
expect(tree.toJSON()).toBe(null);
|
|
16
|
+
});
|
|
17
|
+
});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { createTestInstance } from '@magento/peregrine';
|
|
4
|
+
|
|
5
|
+
import GiftCardSection from '../giftCardSection.ee';
|
|
6
|
+
|
|
7
|
+
jest.mock('../../../Accordion', () => ({
|
|
8
|
+
Section: ({ children, ...rest }) => (
|
|
9
|
+
<mock-Section {...rest}>{children}</mock-Section>
|
|
10
|
+
)
|
|
11
|
+
}));
|
|
12
|
+
jest.mock('../../GiftCards', () => props => <mock-GiftCards {...props} />);
|
|
13
|
+
|
|
14
|
+
let inputProps = {};
|
|
15
|
+
|
|
16
|
+
const Component = () => {
|
|
17
|
+
return <GiftCardSection {...inputProps} />;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const givenDefaultValues = () => {
|
|
21
|
+
inputProps = {
|
|
22
|
+
setIsCartUpdating: false
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
describe('#GiftCardSection EE', () => {
|
|
27
|
+
beforeEach(() => {
|
|
28
|
+
givenDefaultValues();
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it('renders', () => {
|
|
32
|
+
const tree = createTestInstance(<Component />);
|
|
33
|
+
|
|
34
|
+
expect(tree.toJSON()).toMatchSnapshot();
|
|
35
|
+
});
|
|
36
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { createTestInstance } from '@magento/peregrine';
|
|
4
|
+
|
|
5
|
+
import GiftOptionsSection from '../giftOptionsSection.ce';
|
|
6
|
+
|
|
7
|
+
const Component = () => {
|
|
8
|
+
return <GiftOptionsSection />;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
describe('#GiftOptionsSection CE', () => {
|
|
12
|
+
it('renders', () => {
|
|
13
|
+
const tree = createTestInstance(<Component />);
|
|
14
|
+
|
|
15
|
+
expect(tree.toJSON()).toMatchSnapshot();
|
|
16
|
+
});
|
|
17
|
+
});
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { createTestInstance } from '@magento/peregrine';
|
|
4
|
+
import { useGiftOptionsSection } from '@magento/peregrine/lib/talons/CartPage/PriceAdjustments/useGiftOptionsSection';
|
|
5
|
+
|
|
6
|
+
import GiftOptionsSection from '../giftOptionsSection.ee';
|
|
7
|
+
|
|
8
|
+
jest.mock(
|
|
9
|
+
'@magento/peregrine/lib/talons/CartPage/PriceAdjustments/useGiftOptionsSection'
|
|
10
|
+
);
|
|
11
|
+
jest.mock('../../../Accordion', () => ({
|
|
12
|
+
Section: ({ children, ...rest }) => (
|
|
13
|
+
<mock-Section {...rest}>{children}</mock-Section>
|
|
14
|
+
)
|
|
15
|
+
}));
|
|
16
|
+
|
|
17
|
+
const Component = () => {
|
|
18
|
+
return <GiftOptionsSection />;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
describe('#GiftOptionsSection EE', () => {
|
|
22
|
+
it('renders loading', () => {
|
|
23
|
+
useGiftOptionsSection.mockReturnValueOnce({
|
|
24
|
+
giftOptionsConfigData: {},
|
|
25
|
+
isLoading: true,
|
|
26
|
+
isVisible: false
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const tree = createTestInstance(<Component />);
|
|
30
|
+
expect(tree.toJSON()).toMatchSnapshot();
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it('renders not loading and not visible', () => {
|
|
34
|
+
useGiftOptionsSection.mockReturnValueOnce({
|
|
35
|
+
giftOptionsConfigData: {},
|
|
36
|
+
isLoading: false,
|
|
37
|
+
isVisible: false
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
const tree = createTestInstance(<Component />);
|
|
41
|
+
expect(tree.toJSON()).toMatchSnapshot();
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it('renders not loading and visible', () => {
|
|
45
|
+
useGiftOptionsSection.mockReturnValueOnce({
|
|
46
|
+
giftOptionsConfigData: {},
|
|
47
|
+
isLoading: false,
|
|
48
|
+
isVisible: true
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
const tree = createTestInstance(<Component />);
|
|
52
|
+
expect(tree.toJSON()).toMatchSnapshot();
|
|
53
|
+
});
|
|
54
|
+
});
|
|
@@ -6,7 +6,7 @@ import PriceAdjustments from '../priceAdjustments';
|
|
|
6
6
|
jest.mock('../ShippingMethods', () => 'ShippingMethods');
|
|
7
7
|
jest.mock('../CouponCode', () => 'CouponCode');
|
|
8
8
|
jest.mock('../giftCardSection', () => 'GiftCardSection');
|
|
9
|
-
jest.mock('../
|
|
9
|
+
jest.mock('../giftOptionsSection', () => 'GiftOptionsSection');
|
|
10
10
|
|
|
11
11
|
test('it renders Venia price adjustments', () => {
|
|
12
12
|
// Act.
|
package/lib/components/CartPage/PriceAdjustments/{giftCardSection.js → giftCardSection.ce.js}
RENAMED
|
File without changes
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React, { Suspense } from 'react';
|
|
2
|
+
import { useIntl } from 'react-intl';
|
|
3
|
+
|
|
4
|
+
import LoadingIndicator from '@magento/venia-ui/lib/components/LoadingIndicator';
|
|
5
|
+
import { Section } from '@magento/venia-ui/lib/components/Accordion';
|
|
6
|
+
import { useGiftOptionsSection } from '@magento/peregrine/lib/talons/CartPage/PriceAdjustments/useGiftOptionsSection';
|
|
7
|
+
|
|
8
|
+
const GiftOptions = React.lazy(() => import('./GiftOptions'));
|
|
9
|
+
|
|
10
|
+
const GiftOptionsSection = () => {
|
|
11
|
+
const { formatMessage } = useIntl();
|
|
12
|
+
const {
|
|
13
|
+
giftOptionsConfigData,
|
|
14
|
+
isLoading,
|
|
15
|
+
isVisible
|
|
16
|
+
} = useGiftOptionsSection();
|
|
17
|
+
|
|
18
|
+
if (isLoading || !isVisible) {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<Section
|
|
24
|
+
id={'gift_options'}
|
|
25
|
+
data-cy="PriceAdjustments-giftOptionsSection"
|
|
26
|
+
title={formatMessage({
|
|
27
|
+
id: 'priceAdjustments.giftOptions',
|
|
28
|
+
defaultMessage: 'See Gift Options'
|
|
29
|
+
})}
|
|
30
|
+
>
|
|
31
|
+
<Suspense fallback={<LoadingIndicator />}>
|
|
32
|
+
<GiftOptions giftOptionsConfigData={giftOptionsConfigData} />
|
|
33
|
+
</Suspense>
|
|
34
|
+
</Section>
|
|
35
|
+
);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export default GiftOptionsSection;
|
|
@@ -6,11 +6,10 @@ import LoadingIndicator from '@magento/venia-ui/lib/components/LoadingIndicator'
|
|
|
6
6
|
import { useStyle } from '../../../classify';
|
|
7
7
|
import { Accordion, Section } from '../../Accordion';
|
|
8
8
|
import GiftCardSection from './giftCardSection';
|
|
9
|
-
|
|
9
|
+
import GiftOptionsSection from './giftOptionsSection';
|
|
10
10
|
import defaultClasses from './priceAdjustments.module.css';
|
|
11
11
|
|
|
12
12
|
const CouponCode = React.lazy(() => import('./CouponCode'));
|
|
13
|
-
const GiftOptions = React.lazy(() => import('./GiftOptions'));
|
|
14
13
|
const ShippingMethods = React.lazy(() => import('./ShippingMethods'));
|
|
15
14
|
|
|
16
15
|
/**
|
|
@@ -65,18 +64,7 @@ const PriceAdjustments = props => {
|
|
|
65
64
|
</Suspense>
|
|
66
65
|
</Section>
|
|
67
66
|
<GiftCardSection setIsCartUpdating={setIsCartUpdating} />
|
|
68
|
-
<
|
|
69
|
-
id={'gift_options'}
|
|
70
|
-
data-cy="PriceAdjustments-giftOptionsSection"
|
|
71
|
-
title={formatMessage({
|
|
72
|
-
id: 'priceAdjustments.giftOptions',
|
|
73
|
-
defaultMessage: 'See Gift Options'
|
|
74
|
-
})}
|
|
75
|
-
>
|
|
76
|
-
<Suspense fallback={<LoadingIndicator />}>
|
|
77
|
-
<GiftOptions />
|
|
78
|
-
</Suspense>
|
|
79
|
-
</Section>
|
|
67
|
+
<GiftOptionsSection />
|
|
80
68
|
</Accordion>
|
|
81
69
|
</div>
|
|
82
70
|
);
|