@magento/venia-ui 9.2.0-alpha.3 → 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.
Files changed (173) hide show
  1. package/i18n/en_US.json +17 -3
  2. package/lib/RootComponents/CMS/__tests__/__snapshots__/cms.spec.js.snap +19 -0
  3. package/lib/RootComponents/CMS/__tests__/cms.spec.js +4 -9
  4. package/lib/RootComponents/CMS/cms.js +5 -4
  5. package/lib/RootComponents/CMS/cms.shimmer.js +18 -0
  6. package/lib/RootComponents/Category/__tests__/__snapshots__/categoryContent.shimmer.spec.js.snap +12 -0
  7. package/lib/RootComponents/Category/categoryContent.js +4 -1
  8. package/lib/components/AccountChip/accountChip.js +3 -1
  9. package/lib/components/AccountInformationPage/accountInformationPage.js +3 -1
  10. package/lib/components/AccountInformationPage/editModal.js +9 -2
  11. package/lib/components/AccountMenu/accountMenuItems.js +8 -3
  12. package/lib/components/CartPage/GiftCards/giftCards.js +1 -1
  13. package/lib/components/CartPage/PriceAdjustments/CouponCode/couponCode.js +5 -1
  14. package/lib/components/CartPage/PriceAdjustments/GiftOptions/__tests__/__snapshots__/giftOptions.spec.js.snap +1018 -78
  15. package/lib/components/CartPage/PriceAdjustments/GiftOptions/__tests__/giftOptions.spec.js +221 -35
  16. package/lib/components/CartPage/PriceAdjustments/GiftOptions/giftOptions.js +287 -40
  17. package/lib/components/CartPage/PriceAdjustments/GiftOptions/giftOptions.module.css +56 -1
  18. package/lib/components/CartPage/PriceAdjustments/__tests__/__snapshots__/giftCardSection.ee.spec.js.snap +12 -0
  19. package/lib/components/CartPage/PriceAdjustments/__tests__/__snapshots__/giftOptionsSection.ce.spec.js.snap +3 -0
  20. package/lib/components/CartPage/PriceAdjustments/__tests__/__snapshots__/giftOptionsSection.ee.spec.js.snap +16 -0
  21. package/lib/components/CartPage/PriceAdjustments/__tests__/__snapshots__/priceAdjustments.spec.js.snap +1 -32
  22. package/lib/components/CartPage/PriceAdjustments/__tests__/giftCardSection.ce.spec.js +17 -0
  23. package/lib/components/CartPage/PriceAdjustments/__tests__/giftCardSection.ee.spec.js +36 -0
  24. package/lib/components/CartPage/PriceAdjustments/__tests__/giftOptionsSection.ce.spec.js +17 -0
  25. package/lib/components/CartPage/PriceAdjustments/__tests__/giftOptionsSection.ee.spec.js +54 -0
  26. package/lib/components/CartPage/PriceAdjustments/__tests__/priceAdjustments.spec.js +1 -1
  27. package/lib/components/CartPage/PriceAdjustments/{giftCardSection.js → giftCardSection.ce.js} +0 -0
  28. package/lib/components/CartPage/PriceAdjustments/giftOptionsSection.ce.js +7 -0
  29. package/lib/components/CartPage/PriceAdjustments/giftOptionsSection.ee.js +38 -0
  30. package/lib/components/CartPage/PriceAdjustments/priceAdjustments.js +2 -14
  31. package/lib/components/CartPage/PriceSummary/__tests__/__snapshots__/discountSummary.spec.js.snap +496 -42
  32. package/lib/components/CartPage/PriceSummary/__tests__/__snapshots__/giftCardSummary.ce.spec.js.snap +3 -0
  33. package/lib/components/CartPage/PriceSummary/__tests__/__snapshots__/{giftCardSummary.spec.js.snap → giftCardSummary.ee.spec.js.snap} +4 -4
  34. package/lib/components/CartPage/PriceSummary/__tests__/__snapshots__/giftOptionsSummary.ce.spec.js.snap +3 -0
  35. package/lib/components/CartPage/PriceSummary/__tests__/__snapshots__/giftOptionsSummary.ee.spec.js.snap +63 -0
  36. package/lib/components/CartPage/PriceSummary/__tests__/__snapshots__/priceSummary.spec.js.snap +201 -141
  37. package/lib/components/CartPage/PriceSummary/__tests__/discountSummary.spec.js +41 -1
  38. package/lib/components/CartPage/PriceSummary/__tests__/giftCardSummary.ce.spec.js +17 -0
  39. package/lib/components/CartPage/PriceSummary/__tests__/giftCardSummary.ee.spec.js +84 -0
  40. package/lib/components/CartPage/PriceSummary/__tests__/giftOptionsSummary.ce.spec.js +17 -0
  41. package/lib/components/CartPage/PriceSummary/__tests__/giftOptionsSummary.ee.spec.js +69 -0
  42. package/lib/components/CartPage/PriceSummary/__tests__/priceSummary.spec.js +2 -0
  43. package/lib/components/CartPage/PriceSummary/discountSummary.js +99 -49
  44. package/lib/components/CartPage/PriceSummary/discountSummary.module.css +40 -0
  45. package/lib/components/CartPage/PriceSummary/giftOptionsSummary.ce.js +5 -0
  46. package/lib/components/CartPage/PriceSummary/giftOptionsSummary.ee.js +40 -0
  47. package/lib/components/CartPage/PriceSummary/priceSummary.js +95 -53
  48. package/lib/components/CartPage/PriceSummary/priceSummary.module.css +2 -0
  49. package/lib/components/CartPage/ProductListing/EditModal/__tests__/__snapshots__/productDetail.spec.js.snap +57 -0
  50. package/lib/components/CartPage/ProductListing/EditModal/__tests__/__snapshots__/productForm.spec.js.snap +22 -0
  51. package/lib/components/CartPage/ProductListing/EditModal/__tests__/productDetail.spec.js +42 -3
  52. package/lib/components/CartPage/ProductListing/EditModal/productDetail.js +13 -10
  53. package/lib/components/CartPage/ProductListing/EditModal/productForm.js +7 -2
  54. package/lib/components/CartPage/ProductListing/product.js +1 -0
  55. package/lib/components/CartPage/ProductListing/productListing.js +1 -1
  56. package/lib/components/CartPage/cartPage.js +1 -1
  57. package/lib/components/Checkbox/checkbox.js +6 -1
  58. package/lib/components/Checkbox/checkbox.module.css +1 -0
  59. package/lib/components/CheckoutPage/ItemsReview/__tests__/__snapshots__/item.spec.js.snap +2 -2
  60. package/lib/components/CheckoutPage/ItemsReview/__tests__/__snapshots__/itemsReview.spec.js.snap +33 -0
  61. package/lib/components/CheckoutPage/ItemsReview/__tests__/item.spec.js +2 -2
  62. package/lib/components/CheckoutPage/ItemsReview/itemsReview.js +4 -1
  63. package/lib/components/CheckoutPage/OrderConfirmationPage/__tests__/createAccount.spec.js +4 -0
  64. package/lib/components/CheckoutPage/OrderConfirmationPage/createAccount.js +9 -1
  65. package/lib/components/CheckoutPage/OrderConfirmationPage/orderConfirmationPage.js +12 -3
  66. package/lib/components/CheckoutPage/PaymentInformation/__tests__/__snapshots__/creditCard.spec.js.snap +1 -0
  67. package/lib/components/CheckoutPage/PaymentInformation/__tests__/creditCard.spec.js +2 -1
  68. package/lib/components/CheckoutPage/PaymentInformation/brainTreeDropIn.js +2 -18
  69. package/lib/components/CheckoutPage/PaymentInformation/creditCard.js +13 -3
  70. package/lib/components/CheckoutPage/PriceAdjustments/__tests__/__snapshots__/priceAdjustments.spec.js.snap +1 -6
  71. package/lib/components/CheckoutPage/PriceAdjustments/__tests__/priceAdjustments.spec.js +2 -2
  72. package/lib/components/CheckoutPage/PriceAdjustments/priceAdjustments.js +8 -12
  73. package/lib/components/CheckoutPage/ShippingInformation/AddressForm/customerForm.js +1 -1
  74. package/lib/components/CheckoutPage/ShippingInformation/shippingInformation.js +4 -1
  75. package/lib/components/CheckoutPage/ShippingMethod/shippingMethod.js +5 -2
  76. package/lib/components/CheckoutPage/__tests__/__snapshots__/checkoutPage.spec.js.snap +3 -3
  77. package/lib/components/CheckoutPage/__tests__/checkoutPage.spec.js +5 -0
  78. package/lib/components/CheckoutPage/checkoutPage.js +25 -4
  79. package/lib/components/CheckoutPage/checkoutPage.module.css +8 -1
  80. package/lib/components/CmsDynamicBlock/__tests__/__snapshots__/cmsDynamicBlock.ce.spec.js.snap +3 -0
  81. package/lib/components/CmsDynamicBlock/__tests__/__snapshots__/cmsDynamicBlock.ee.spec.js.snap +61 -0
  82. package/lib/components/CmsDynamicBlock/__tests__/__snapshots__/dynamicBlock.spec.js.snap +7 -0
  83. package/lib/components/CmsDynamicBlock/__tests__/cmsDynamicBlock.ce.spec.js +17 -0
  84. package/lib/components/CmsDynamicBlock/__tests__/cmsDynamicBlock.ee.spec.js +211 -0
  85. package/lib/components/CmsDynamicBlock/__tests__/constants.spec.js +37 -0
  86. package/lib/components/CmsDynamicBlock/__tests__/dynamicBlock.spec.js +33 -0
  87. package/lib/components/CmsDynamicBlock/cmsDynamicBlock.ce.js +5 -0
  88. package/lib/components/CmsDynamicBlock/cmsDynamicBlock.ee.js +73 -0
  89. package/lib/components/CmsDynamicBlock/constants.js +6 -0
  90. package/lib/components/CmsDynamicBlock/dynamicBlock.js +32 -0
  91. package/lib/components/CmsDynamicBlock/index.js +2 -0
  92. package/lib/components/CreateAccount/__tests__/createAccount.spec.js +6 -1
  93. package/lib/components/CreateAccount/createAccount.js +7 -2
  94. package/lib/components/Field/field.module.css +6 -0
  95. package/lib/components/FilterSidebar/filterSidebar.js +4 -1
  96. package/lib/components/Footer/__tests__/__snapshots__/footer.spec.js.snap +8 -2
  97. package/lib/components/Footer/footer.js +16 -9
  98. package/lib/components/Footer/footer.module.css +7 -2
  99. package/lib/components/ForgotPassword/ForgotPasswordForm/__tests__/__snapshots__/forgotPasswordForm.spec.js.snap +109 -1
  100. package/lib/components/ForgotPassword/ForgotPasswordForm/__tests__/forgotPasswordForm.spec.js +22 -3
  101. package/lib/components/ForgotPassword/ForgotPasswordForm/forgotPasswordForm.js +13 -3
  102. package/lib/components/ForgotPassword/ForgotPasswordForm/forgotPasswordForm.module.css +1 -1
  103. package/lib/components/ForgotPassword/__tests__/__snapshots__/forgotPassword.spec.js.snap +5 -6
  104. package/lib/components/ForgotPassword/__tests__/forgotPassword.spec.js +41 -28
  105. package/lib/components/ForgotPassword/forgotPassword.js +10 -3
  106. package/lib/components/ForgotPassword/forgotPassword.module.css +2 -2
  107. package/lib/components/Gallery/__tests__/__snapshots__/gallery.spec.js.snap +22 -0
  108. package/lib/components/Gallery/__tests__/__snapshots__/item.spec.js.snap +17 -0
  109. package/lib/components/Gallery/addToCartButton.js +2 -0
  110. package/lib/components/Gallery/gallery.js +6 -1
  111. package/lib/components/Gallery/item.js +7 -2
  112. package/lib/components/GoogleReCaptcha/googleReCaptcha.js +49 -0
  113. package/lib/components/GoogleReCaptcha/googleReCaptcha.module.css +3 -0
  114. package/lib/components/GoogleReCaptcha/index.js +1 -0
  115. package/lib/components/Header/currencySwitcher.js +2 -1
  116. package/lib/components/Header/header.js +1 -1
  117. package/lib/components/Header/header.module.css +2 -2
  118. package/lib/components/Header/searchTrigger.js +3 -1
  119. package/lib/components/Header/storeSwitcher.js +18 -4
  120. package/lib/components/Header/switcherItem.js +4 -1
  121. package/lib/components/HomePage/homePage.module.css +12 -0
  122. package/lib/components/Image/resourceImage.js +8 -1
  123. package/lib/components/Image/simpleImage.js +8 -1
  124. package/lib/components/Link/link.js +15 -13
  125. package/lib/components/LoadingIndicator/spinner.js +5 -7
  126. package/lib/components/LoadingIndicator/spinner.module.css +4 -17
  127. package/lib/components/MiniCart/ProductList/__tests__/__snapshots__/item.spec.js.snap +44 -0
  128. package/lib/components/MiniCart/ProductList/__tests__/__snapshots__/productList.spec.js.snap +1 -1
  129. package/lib/components/MiniCart/ProductList/__tests__/item.spec.js +2 -2
  130. package/lib/components/MiniCart/ProductList/__tests__/productList.spec.js +1 -1
  131. package/lib/components/MiniCart/ProductList/item.js +3 -2
  132. package/lib/components/MiniCart/ProductList/productList.js +1 -1
  133. package/lib/components/MiniCart/miniCart.js +6 -3
  134. package/lib/components/MyAccount/ResetPassword/__tests__/__snapshots__/resetPassword.spec.js.snap +274 -254
  135. package/lib/components/MyAccount/ResetPassword/__tests__/resetPassword.spec.js +10 -5
  136. package/lib/components/MyAccount/ResetPassword/resetPassword.js +55 -55
  137. package/lib/components/MyAccount/ResetPassword/resetPassword.module.css +27 -79
  138. package/lib/components/Newsletter/newsletter.js +6 -2
  139. package/lib/components/OrderHistoryPage/OrderDetails/__tests__/__snapshots__/item.spec.js.snap +11 -0
  140. package/lib/components/ProductFullDetail/CustomAttributes/__tests__/__snapshots__/customAttributes.spec.js.snap +9 -3
  141. package/lib/components/ProductFullDetail/CustomAttributes/__tests__/customAttributes.spec.js +5 -6
  142. package/lib/components/ProductFullDetail/CustomAttributes/customAttributes.js +6 -4
  143. package/lib/components/ProductFullDetail/productFullDetail.js +12 -3
  144. package/lib/components/ProductImageCarousel/__tests__/__snapshots__/carousel.spec.js.snap +61 -0
  145. package/lib/components/ProductImageCarousel/__tests__/__snapshots__/thumbnail.spec.js.snap +26 -0
  146. package/lib/components/ProductOptions/__tests__/options.spec.js +1 -1
  147. package/lib/components/ProductOptions/__tests__/swatch.spec.js +1 -1
  148. package/lib/components/ProductOptions/__tests__/swatchList.spec.js +1 -1
  149. package/lib/components/ProductOptions/__tests__/tile.spec.js +1 -1
  150. package/lib/components/ProductOptions/__tests__/tileList.spec.js +1 -1
  151. package/lib/components/ProductOptions/option.js +4 -1
  152. package/lib/components/ProductSort/productSort.js +22 -14
  153. package/lib/components/Rating/rating.js +1 -1
  154. package/lib/components/SearchBar/__tests__/__snapshots__/suggestedProduct.spec.js.snap +11 -0
  155. package/lib/components/SearchBar/autocomplete.js +5 -2
  156. package/lib/components/SearchBar/suggestedProduct.js +1 -1
  157. package/lib/components/SearchBar/suggestions.js +1 -1
  158. package/lib/components/SignIn/__tests__/signIn.spec.js +11 -20
  159. package/lib/components/SignIn/signIn.js +6 -16
  160. package/lib/components/TextInput/textInput.module.css +0 -4
  161. package/lib/components/Wishlist/WishlistDialog/WishlistLineItem/__tests__/__snapshots__/wishlistLineItem.spec.js.snap +5 -1
  162. package/lib/components/Wishlist/WishlistDialog/WishlistLineItem/wishlistLineItem.js +7 -1
  163. package/lib/components/Wishlist/WishlistDialog/WishlistLineItem/wishlistLineItem.module.css +7 -0
  164. package/lib/components/Wishlist/WishlistDialog/__tests__/__snapshots__/wishlistDialog.spec.js.snap +6 -1
  165. package/lib/components/WishlistPage/__tests__/__snapshots__/wishlist.spec.js.snap +4 -0
  166. package/lib/components/WishlistPage/__tests__/__snapshots__/wishlistItem.spec.js.snap +22 -0
  167. package/lib/components/WishlistPage/__tests__/__snapshots__/wishlistPage.spec.js.snap +9 -3
  168. package/lib/components/WishlistPage/createWishlist.ee.js +3 -1
  169. package/lib/components/WishlistPage/wishlist.js +1 -1
  170. package/lib/components/WishlistPage/wishlist.module.css +3 -0
  171. package/lib/components/WishlistPage/wishlistPage.js +1 -1
  172. package/package.json +5 -4
  173. package/lib/components/CartPage/PriceSummary/__tests__/giftCardSummary.spec.js +0 -84
@@ -4,54 +4,74 @@ exports[`renders PriceSummary correctly on cart page 1`] = `
4
4
  <div
5
5
  className="root"
6
6
  >
7
- <div
8
- className="lineItems"
9
- >
10
- <span
11
- className="lineItemLabel"
12
- >
13
- <mock-FormattedMessage
14
- defaultMessage="Subtotal"
15
- id="priceSummary.lineItemLabel"
7
+ <div>
8
+ <ul>
9
+ <li
10
+ className="lineItems"
11
+ >
12
+ <span
13
+ className="lineItemLabel"
14
+ >
15
+ <mock-FormattedMessage
16
+ defaultMessage="Subtotal"
17
+ id="priceSummary.lineItemLabel"
18
+ />
19
+ </span>
20
+ <span
21
+ className="price"
22
+ >
23
+ <span>
24
+ $
25
+ </span>
26
+ <span>
27
+ 3
28
+ </span>
29
+ <span>
30
+ .
31
+ </span>
32
+ <span>
33
+ 50
34
+ </span>
35
+ </span>
36
+ </li>
37
+ <li
38
+ className="lineItems"
16
39
  />
17
- </span>
18
- <span
19
- className="price"
20
- >
21
- <span>
22
- $
23
- </span>
24
- <span>
25
- 3
26
- </span>
27
- <span>
28
- .
29
- </span>
30
- <span>
31
- 50
32
- </span>
33
- </span>
34
- <span
35
- className="totalLabel"
36
- >
37
- Estimated Total
38
- </span>
39
- <span
40
- className="totalPrice"
41
- >
42
- <span>
43
- $
44
- </span>
45
- <span>
46
- 8
47
- </span>
48
- <span>
49
- .
50
- </span>
51
- <span>
52
- 50
53
- </span>
54
- </span>
40
+ <li
41
+ className="lineItems"
42
+ />
43
+ <li
44
+ className="lineItems"
45
+ />
46
+ <li
47
+ className="lineItems"
48
+ />
49
+ <li
50
+ className="lineItems"
51
+ >
52
+ <span
53
+ className="totalLabel"
54
+ >
55
+ Estimated Total
56
+ </span>
57
+ <span
58
+ className="totalPrice"
59
+ >
60
+ <span>
61
+ $
62
+ </span>
63
+ <span>
64
+ 8
65
+ </span>
66
+ <span>
67
+ .
68
+ </span>
69
+ <span>
70
+ 50
71
+ </span>
72
+ </span>
73
+ </li>
74
+ </ul>
55
75
  </div>
56
76
  <div
57
77
  className="checkoutButton_container"
@@ -89,54 +109,74 @@ exports[`renders PriceSummary correctly on checkout page 1`] = `
89
109
  <div
90
110
  className="root"
91
111
  >
92
- <div
93
- className="lineItems"
94
- >
95
- <span
96
- className="lineItemLabel"
97
- >
98
- <mock-FormattedMessage
99
- defaultMessage="Subtotal"
100
- id="priceSummary.lineItemLabel"
112
+ <div>
113
+ <ul>
114
+ <li
115
+ className="lineItems"
116
+ >
117
+ <span
118
+ className="lineItemLabel"
119
+ >
120
+ <mock-FormattedMessage
121
+ defaultMessage="Subtotal"
122
+ id="priceSummary.lineItemLabel"
123
+ />
124
+ </span>
125
+ <span
126
+ className="price"
127
+ >
128
+ <span>
129
+ $
130
+ </span>
131
+ <span>
132
+ 3
133
+ </span>
134
+ <span>
135
+ .
136
+ </span>
137
+ <span>
138
+ 50
139
+ </span>
140
+ </span>
141
+ </li>
142
+ <li
143
+ className="lineItems"
101
144
  />
102
- </span>
103
- <span
104
- className="price"
105
- >
106
- <span>
107
- $
108
- </span>
109
- <span>
110
- 3
111
- </span>
112
- <span>
113
- .
114
- </span>
115
- <span>
116
- 50
117
- </span>
118
- </span>
119
- <span
120
- className="totalLabel"
121
- >
122
- Total
123
- </span>
124
- <span
125
- className="totalPrice"
126
- >
127
- <span>
128
- $
129
- </span>
130
- <span>
131
- 8
132
- </span>
133
- <span>
134
- .
135
- </span>
136
- <span>
137
- 50
138
- </span>
139
- </span>
145
+ <li
146
+ className="lineItems"
147
+ />
148
+ <li
149
+ className="lineItems"
150
+ />
151
+ <li
152
+ className="lineItems"
153
+ />
154
+ <li
155
+ className="lineItems"
156
+ >
157
+ <span
158
+ className="totalLabel"
159
+ >
160
+ Total
161
+ </span>
162
+ <span
163
+ className="totalPrice"
164
+ >
165
+ <span>
166
+ $
167
+ </span>
168
+ <span>
169
+ 8
170
+ </span>
171
+ <span>
172
+ .
173
+ </span>
174
+ <span>
175
+ 50
176
+ </span>
177
+ </span>
178
+ </li>
179
+ </ul>
140
180
  </div>
141
181
  </div>
142
182
  `;
@@ -162,54 +202,74 @@ exports[`renders summary with loading state if query is loading 1`] = `
162
202
  <div
163
203
  className="root"
164
204
  >
165
- <div
166
- className="lineItems"
167
- >
168
- <span
169
- className="lineItemLabel"
170
- >
171
- <mock-FormattedMessage
172
- defaultMessage="Subtotal"
173
- id="priceSummary.lineItemLabel"
205
+ <div>
206
+ <ul>
207
+ <li
208
+ className="lineItems"
209
+ >
210
+ <span
211
+ className="lineItemLabel"
212
+ >
213
+ <mock-FormattedMessage
214
+ defaultMessage="Subtotal"
215
+ id="priceSummary.lineItemLabel"
216
+ />
217
+ </span>
218
+ <span
219
+ className="priceUpdating"
220
+ >
221
+ <span>
222
+ $
223
+ </span>
224
+ <span>
225
+ 3
226
+ </span>
227
+ <span>
228
+ .
229
+ </span>
230
+ <span>
231
+ 50
232
+ </span>
233
+ </span>
234
+ </li>
235
+ <li
236
+ className="lineItems"
174
237
  />
175
- </span>
176
- <span
177
- className="priceUpdating"
178
- >
179
- <span>
180
- $
181
- </span>
182
- <span>
183
- 3
184
- </span>
185
- <span>
186
- .
187
- </span>
188
- <span>
189
- 50
190
- </span>
191
- </span>
192
- <span
193
- className="totalLabel"
194
- >
195
- Estimated Total
196
- </span>
197
- <span
198
- className="priceUpdating"
199
- >
200
- <span>
201
- $
202
- </span>
203
- <span>
204
- 8
205
- </span>
206
- <span>
207
- .
208
- </span>
209
- <span>
210
- 50
211
- </span>
212
- </span>
238
+ <li
239
+ className="lineItems"
240
+ />
241
+ <li
242
+ className="lineItems"
243
+ />
244
+ <li
245
+ className="lineItems"
246
+ />
247
+ <li
248
+ className="lineItems"
249
+ >
250
+ <span
251
+ className="totalLabel"
252
+ >
253
+ Estimated Total
254
+ </span>
255
+ <span
256
+ className="priceUpdating"
257
+ >
258
+ <span>
259
+ $
260
+ </span>
261
+ <span>
262
+ 8
263
+ </span>
264
+ <span>
265
+ .
266
+ </span>
267
+ <span>
268
+ 50
269
+ </span>
270
+ </span>
271
+ </li>
272
+ </ul>
213
273
  </div>
214
274
  <div
215
275
  className="checkoutButton_container"
@@ -15,7 +15,8 @@ const defaultProps = {
15
15
  amount: {
16
16
  value: 10,
17
17
  currency: 'USD'
18
- }
18
+ },
19
+ label: 'Special rebate'
19
20
  }
20
21
  ]
21
22
  };
@@ -31,18 +32,21 @@ test('renders accumulated discount value', () => {
31
32
  ...defaultProps,
32
33
  data: [
33
34
  {
35
+ label: 'Discount 1',
34
36
  amount: {
35
37
  value: 0,
36
38
  currency: 'USD'
37
39
  }
38
40
  },
39
41
  {
42
+ label: 'Discount 2',
40
43
  amount: {
41
44
  value: 1,
42
45
  currency: 'USD'
43
46
  }
44
47
  },
45
48
  {
49
+ label: 'Discount 3',
46
50
  amount: {
47
51
  value: 1,
48
52
  currency: 'USD'
@@ -71,6 +75,7 @@ test('renders nothing if discount value is "0"', () => {
71
75
  ...defaultProps,
72
76
  data: [
73
77
  {
78
+ label: 'Discount 1',
74
79
  amount: {
75
80
  value: 0,
76
81
  currency: 'USD'
@@ -82,3 +87,38 @@ test('renders nothing if discount value is "0"', () => {
82
87
 
83
88
  expect(tree.toJSON()).toMatchSnapshot();
84
89
  });
90
+
91
+ test('renders discount label value from data ', () => {
92
+ const props = {
93
+ ...defaultProps,
94
+ data: [
95
+ {
96
+ amount: {
97
+ value: 1,
98
+ currency: 'USD'
99
+ },
100
+ label: 'Rebate'
101
+ }
102
+ ]
103
+ };
104
+ const tree = createTestInstance(<DiscountSummary {...props} />);
105
+
106
+ expect(tree.toJSON()).toMatchSnapshot();
107
+ });
108
+
109
+ test('renders "Discount applied" label if label data is empty', () => {
110
+ const props = {
111
+ ...defaultProps,
112
+ data: [
113
+ {
114
+ amount: {
115
+ value: 1,
116
+ currency: 'USD'
117
+ }
118
+ }
119
+ ]
120
+ };
121
+ const tree = createTestInstance(<DiscountSummary {...props} />);
122
+
123
+ expect(tree.toJSON()).toMatchSnapshot();
124
+ });
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+
3
+ import { createTestInstance } from '@magento/peregrine';
4
+
5
+ import GiftCardSummary from '../giftCardSummary.ce';
6
+
7
+ const Component = () => {
8
+ return <GiftCardSummary />;
9
+ };
10
+
11
+ describe('#GiftCardSummary CE', () => {
12
+ it('renders', () => {
13
+ const tree = createTestInstance(<Component />);
14
+
15
+ expect(tree.toJSON()).toMatchSnapshot();
16
+ });
17
+ });
@@ -0,0 +1,84 @@
1
+ import React from 'react';
2
+ import { createTestInstance } from '@magento/peregrine';
3
+
4
+ import GiftCardSummary from '../giftCardSummary.ee';
5
+
6
+ const defaultProps = {
7
+ classes: {
8
+ lineItemLabel: 'lineItemLabel',
9
+ price: 'price'
10
+ },
11
+ data: [
12
+ {
13
+ applied_balance: {
14
+ value: 10,
15
+ currency: 'USD'
16
+ }
17
+ }
18
+ ]
19
+ };
20
+
21
+ describe('#GiftCardSummary EE', () => {
22
+ it('renders gift card summary line item correctly', () => {
23
+ const tree = createTestInstance(<GiftCardSummary {...defaultProps} />);
24
+
25
+ expect(tree.toJSON()).toMatchSnapshot();
26
+ });
27
+
28
+ it('renders accumulated gift card value', () => {
29
+ const props = {
30
+ ...defaultProps,
31
+ data: [
32
+ {
33
+ applied_balance: {
34
+ value: 0,
35
+ currency: 'USD'
36
+ }
37
+ },
38
+ {
39
+ applied_balance: {
40
+ value: 1,
41
+ currency: 'USD'
42
+ }
43
+ },
44
+ {
45
+ applied_balance: {
46
+ value: 1,
47
+ currency: 'USD'
48
+ }
49
+ }
50
+ ]
51
+ };
52
+
53
+ const tree = createTestInstance(<GiftCardSummary {...props} />);
54
+
55
+ expect(tree.toJSON()).toMatchSnapshot();
56
+ });
57
+
58
+ it('renders nothing if gift card data is empty', () => {
59
+ const props = {
60
+ ...defaultProps,
61
+ data: []
62
+ };
63
+ const tree = createTestInstance(<GiftCardSummary {...props} />);
64
+
65
+ expect(tree.toJSON()).toMatchSnapshot();
66
+ });
67
+
68
+ it('renders nothing if gift card value is "0"', () => {
69
+ const props = {
70
+ ...defaultProps,
71
+ data: [
72
+ {
73
+ applied_balance: {
74
+ value: 0,
75
+ currency: 'USD'
76
+ }
77
+ }
78
+ ]
79
+ };
80
+ const tree = createTestInstance(<GiftCardSummary {...props} />);
81
+
82
+ expect(tree.toJSON()).toMatchSnapshot();
83
+ });
84
+ });
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+
3
+ import { createTestInstance } from '@magento/peregrine';
4
+
5
+ import GiftOptionsSummary from '../giftOptionsSummary.ce';
6
+
7
+ const Component = () => {
8
+ return <GiftOptionsSummary />;
9
+ };
10
+
11
+ describe('#GiftOptionsSummary CE', () => {
12
+ it('renders', () => {
13
+ const tree = createTestInstance(<Component />);
14
+
15
+ expect(tree.toJSON()).toMatchSnapshot();
16
+ });
17
+ });
@@ -0,0 +1,69 @@
1
+ import React from 'react';
2
+
3
+ import { createTestInstance } from '@magento/peregrine';
4
+
5
+ import GiftOptionsSummary from '../giftOptionsSummary.ee';
6
+
7
+ const defaultProps = {
8
+ classes: {
9
+ lineItemLabel: 'lineItemLabel',
10
+ price: 'price'
11
+ },
12
+ data: {
13
+ printed_card: {
14
+ value: 10,
15
+ currency: 'USD'
16
+ }
17
+ }
18
+ };
19
+
20
+ describe('#GiftOptionsSummary EE', () => {
21
+ it('renders gift options summary line item correctly', () => {
22
+ const tree = createTestInstance(
23
+ <GiftOptionsSummary {...defaultProps} />
24
+ );
25
+
26
+ expect(tree.toJSON()).toMatchSnapshot();
27
+ });
28
+
29
+ it('renders accumulated gift options value', () => {
30
+ const props = {
31
+ ...defaultProps,
32
+ data: {
33
+ printed_card: {
34
+ value: 10,
35
+ currency: 'USD'
36
+ }
37
+ }
38
+ };
39
+
40
+ const tree = createTestInstance(<GiftOptionsSummary {...props} />);
41
+
42
+ expect(tree.toJSON()).toMatchSnapshot();
43
+ });
44
+
45
+ it('renders nothing if gift options data is empty', () => {
46
+ const props = {
47
+ ...defaultProps,
48
+ data: {}
49
+ };
50
+ const tree = createTestInstance(<GiftOptionsSummary {...props} />);
51
+
52
+ expect(tree.toJSON()).toMatchSnapshot();
53
+ });
54
+
55
+ it('renders nothing if gift options value is "0"', () => {
56
+ const props = {
57
+ ...defaultProps,
58
+ data: {
59
+ printed_card: {
60
+ value: 0,
61
+ currency: 'USD'
62
+ }
63
+ }
64
+ };
65
+ const tree = createTestInstance(<GiftOptionsSummary {...props} />);
66
+
67
+ expect(tree.toJSON()).toMatchSnapshot();
68
+ });
69
+ });
@@ -77,6 +77,7 @@ const defaultTalonProps = {
77
77
  total: { currency: 'USD', value: 8.5 },
78
78
  discounts: null,
79
79
  giftCards: [],
80
+ giftOptions: {},
80
81
  taxes: [],
81
82
  shipping: { currency: 'USD', value: 5 }
82
83
  }
@@ -95,6 +96,7 @@ jest.mock(
95
96
  total: { currency: 'USD', value: 8.5 },
96
97
  discounts: null,
97
98
  giftCards: [],
99
+ giftOptions: {},
98
100
  taxes: [],
99
101
  shipping: { currency: 'USD', value: 5 }
100
102
  }