@magento/venia-ui 9.1.0 → 9.2.0-beta.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 (292) hide show
  1. package/i18n/en_US.json +22 -7
  2. package/lib/RootComponents/CMS/__tests__/cms.spec.js +50 -20
  3. package/lib/RootComponents/CMS/cms.js +39 -43
  4. package/lib/RootComponents/CMS/cms.module.css +17 -14
  5. package/lib/RootComponents/Category/NoProductsFound/noProductsFound.js +1 -1
  6. package/lib/RootComponents/Category/__tests__/__snapshots__/category.spec.js.snap +2 -2
  7. package/lib/RootComponents/Category/__tests__/__snapshots__/categoryContent.spec.js.snap +60 -0
  8. package/lib/RootComponents/Category/__tests__/category.spec.js +1 -1
  9. package/lib/RootComponents/Category/__tests__/categoryContent.spec.js +8 -0
  10. package/lib/RootComponents/Category/category.gql.js +2 -1
  11. package/lib/RootComponents/Category/category.js +6 -6
  12. package/lib/RootComponents/Category/categoryContent.js +11 -4
  13. package/lib/components/Accordion/section.js +6 -2
  14. package/lib/components/AccountChip/accountChip.gql.js +1 -1
  15. package/lib/components/AccountInformationPage/accountInformationPage.gql.js +5 -7
  16. package/lib/components/AccountInformationPage/accountInformationPage.js +5 -1
  17. package/lib/components/AccountInformationPage/editForm.js +22 -4
  18. package/lib/components/AccountMenu/accountMenu.js +1 -1
  19. package/lib/components/AccountMenu/accountMenuItems.js +2 -1
  20. package/lib/components/AddressBookPage/__tests__/__snapshots__/addressCard.spec.js.snap +5 -0
  21. package/lib/components/AddressBookPage/addEditDialog.js +36 -10
  22. package/lib/components/AddressBookPage/addressBookPage.js +5 -2
  23. package/lib/components/AddressBookPage/addressCard.js +17 -4
  24. package/lib/components/App/app.js +5 -1
  25. package/lib/components/App/localeProvider.js +2 -1
  26. package/lib/components/Breadcrumbs/breadcrumbs.js +3 -3
  27. package/lib/components/Breadcrumbs/breadcrumbs.module.css +10 -3
  28. package/lib/components/CartPage/GiftCards/giftCard.js +1 -0
  29. package/lib/components/CartPage/GiftCards/giftCards.js +2 -0
  30. package/lib/components/CartPage/PriceAdjustments/CouponCode/couponCode.js +3 -0
  31. package/lib/components/CartPage/PriceAdjustments/GiftOptions/giftOptions.js +3 -0
  32. package/lib/components/CartPage/PriceAdjustments/ShippingMethods/shippingForm.js +10 -2
  33. package/lib/components/CartPage/PriceAdjustments/ShippingMethods/shippingMethods.js +2 -1
  34. package/lib/components/CartPage/PriceAdjustments/ShippingMethods/shippingRadio.js +1 -1
  35. package/lib/components/CartPage/PriceAdjustments/ShippingMethods/shippingRadios.js +1 -1
  36. package/lib/components/CartPage/PriceAdjustments/giftCardSection.ee.js +1 -0
  37. package/lib/components/CartPage/PriceAdjustments/priceAdjustments.js +4 -1
  38. package/lib/components/CartPage/PriceSummary/discountSummary.js +8 -2
  39. package/lib/components/CartPage/PriceSummary/giftCardSummary.ee.js +4 -1
  40. package/lib/components/CartPage/PriceSummary/priceSummary.js +10 -3
  41. package/lib/components/CartPage/PriceSummary/shippingSummary.js +6 -1
  42. package/lib/components/CartPage/PriceSummary/taxSummary.js +1 -1
  43. package/lib/components/CartPage/ProductListing/EditModal/__tests__/__snapshots__/productDetail.spec.js.snap +3 -3
  44. package/lib/components/CartPage/ProductListing/EditModal/__tests__/__snapshots__/productForm.spec.js.snap +2 -2
  45. package/lib/components/CartPage/ProductListing/EditModal/productDetail.js +1 -1
  46. package/lib/components/CartPage/ProductListing/__tests__/__snapshots__/errorMessage.spec.js.snap +11 -0
  47. package/lib/components/CartPage/ProductListing/__tests__/errorMessage.spec.js +20 -0
  48. package/lib/components/CartPage/ProductListing/__tests__/product.spec.js +1 -0
  49. package/lib/components/CartPage/ProductListing/errorMessage.js +31 -0
  50. package/lib/components/CartPage/ProductListing/errorMessage.module.css +9 -0
  51. package/lib/components/CartPage/ProductListing/product.js +14 -7
  52. package/lib/components/CartPage/ProductListing/productListing.js +6 -1
  53. package/lib/components/CartPage/ProductListing/productListing.module.css +6 -0
  54. package/lib/components/CartPage/ProductListing/quantity.js +3 -0
  55. package/lib/components/CartPage/cartPage.js +1 -1
  56. package/lib/components/CategoryList/__tests__/categoryList.spec.js +2 -0
  57. package/lib/components/CategoryList/categoryList.js +4 -2
  58. package/lib/components/CategoryList/categoryList.module.css +2 -0
  59. package/lib/components/CategoryList/categoryTile.js +2 -0
  60. package/lib/components/CategoryList/categoryTile.module.css +2 -0
  61. package/lib/components/CategoryList/index.js +2 -0
  62. package/lib/components/CategoryTree/categoryBranch.js +2 -1
  63. package/lib/components/CategoryTree/categoryLeaf.js +1 -0
  64. package/lib/components/CategoryTree/categoryTree.js +3 -3
  65. package/lib/components/Checkbox/checkbox.module.css +11 -3
  66. package/lib/components/Checkout/addressForm.js +2 -3
  67. package/lib/components/CheckoutPage/GuestSignIn/guestSignIn.js +6 -2
  68. package/lib/components/CheckoutPage/ItemsReview/__fixtures__/cartItems.js +12 -12
  69. package/lib/components/CheckoutPage/ItemsReview/__tests__/__snapshots__/item.spec.js.snap +2 -2
  70. package/lib/components/CheckoutPage/ItemsReview/__tests__/__snapshots__/itemsReview.spec.js.snap +3 -3
  71. package/lib/components/CheckoutPage/ItemsReview/item.js +1 -1
  72. package/lib/components/CheckoutPage/ItemsReview/itemsReview.js +4 -1
  73. package/lib/components/CheckoutPage/OrderConfirmationPage/__tests__/__snapshots__/orderConfirmationPage.spec.js.snap +1 -1
  74. package/lib/components/CheckoutPage/OrderConfirmationPage/createAccount.js +6 -0
  75. package/lib/components/CheckoutPage/OrderConfirmationPage/orderConfirmationPage.js +10 -4
  76. package/lib/components/CheckoutPage/OrderSummary/orderSummary.js +1 -1
  77. package/lib/components/CheckoutPage/PaymentInformation/braintreeSummary.js +2 -1
  78. package/lib/components/CheckoutPage/PaymentInformation/creditCard.js +11 -1
  79. package/lib/components/CheckoutPage/PaymentInformation/editCard.js +1 -1
  80. package/lib/components/CheckoutPage/PaymentInformation/editModal.js +1 -1
  81. package/lib/components/CheckoutPage/PaymentInformation/paymentInformation.js +1 -1
  82. package/lib/components/CheckoutPage/ShippingInformation/AddressForm/__tests__/__snapshots__/guestForm.spec.js.snap +8 -0
  83. package/lib/components/CheckoutPage/ShippingInformation/AddressForm/__tests__/guestForm.spec.js +56 -1
  84. package/lib/components/CheckoutPage/ShippingInformation/AddressForm/customerForm.js +27 -4
  85. package/lib/components/CheckoutPage/ShippingInformation/AddressForm/guestForm.js +96 -9
  86. package/lib/components/CheckoutPage/ShippingInformation/card.js +1 -1
  87. package/lib/components/CheckoutPage/ShippingInformation/shippingInformation.js +14 -3
  88. package/lib/components/CheckoutPage/ShippingMethod/completedView.js +1 -0
  89. package/lib/components/CheckoutPage/ShippingMethod/shippingMethod.js +2 -1
  90. package/lib/components/CheckoutPage/ShippingMethod/updateModal.js +1 -0
  91. package/lib/components/CheckoutPage/__tests__/__snapshots__/checkoutPage.spec.js.snap +32 -0
  92. package/lib/components/CheckoutPage/__tests__/checkoutPage.spec.js +2 -0
  93. package/lib/components/CheckoutPage/checkoutPage.js +26 -4
  94. package/lib/components/ContactPage/__tests__/__snapshots__/contactLink.spec.js.snap +11 -0
  95. package/lib/components/ContactPage/__tests__/__snapshots__/contactPage.shimmer.spec.js.snap +113 -0
  96. package/lib/components/ContactPage/__tests__/__snapshots__/contactPage.spec.js.snap +312 -0
  97. package/lib/components/ContactPage/__tests__/contactLink.spec.js +58 -0
  98. package/lib/components/ContactPage/__tests__/contactPage.shimmer.spec.js +20 -0
  99. package/lib/components/ContactPage/__tests__/contactPage.spec.js +159 -0
  100. package/lib/components/ContactPage/contactLink.js +21 -0
  101. package/lib/components/ContactPage/contactPage.js +270 -0
  102. package/lib/components/ContactPage/contactPage.module.css +81 -0
  103. package/lib/components/ContactPage/contactPage.shimmer.js +104 -0
  104. package/lib/components/ContactPage/contactPage.shimmer.module.css +27 -0
  105. package/lib/components/ContactPage/index.js +2 -0
  106. package/lib/components/CreateAccount/createAccount.js +5 -0
  107. package/lib/components/Dialog/dialog.js +18 -4
  108. package/lib/components/ErrorMessage/errorMessage.js +7 -2
  109. package/lib/components/ErrorView/errorView.js +4 -2
  110. package/lib/components/Field/field.module.css +10 -6
  111. package/lib/components/FilterModal/CurrentFilters/currentFilter.js +7 -3
  112. package/lib/components/FilterModal/FilterList/__tests__/filterItem.spec.js +34 -5
  113. package/lib/components/FilterModal/FilterList/filterDefault.js +3 -2
  114. package/lib/components/FilterModal/FilterList/filterItem.js +27 -7
  115. package/lib/components/FilterModal/FilterList/filterList.js +6 -1
  116. package/lib/components/FilterModal/filterBlock.js +9 -4
  117. package/lib/components/FilterModal/filterFooter.js +1 -0
  118. package/lib/components/FilterModal/filterModal.js +6 -1
  119. package/lib/components/FilterModalOpenButton/filterModalOpenButton.js +1 -0
  120. package/lib/components/FilterSidebar/filterSidebar.js +6 -1
  121. package/lib/components/Footer/__tests__/__snapshots__/footer.spec.js.snap +14 -0
  122. package/lib/components/Footer/__tests__/footer.spec.js +9 -1
  123. package/lib/components/Footer/footer.js +14 -7
  124. package/lib/components/Footer/sampleData.js +8 -3
  125. package/lib/components/ForgotPassword/ForgotPasswordForm/forgotPasswordForm.js +3 -0
  126. package/lib/components/ForgotPassword/FormSubmissionSuccessful/formSubmissionSuccessful.js +4 -2
  127. package/lib/components/ForgotPassword/forgotPassword.gql.js +0 -1
  128. package/lib/components/FormError/formError.js +10 -4
  129. package/lib/components/Gallery/__tests__/__snapshots__/addToCartButton.spec.js.snap +0 -3
  130. package/lib/components/Gallery/__tests__/__snapshots__/item.spec.js.snap +1 -0
  131. package/lib/components/Gallery/addToCartButton.js +24 -20
  132. package/lib/components/Gallery/item.js +15 -4
  133. package/lib/components/Gallery/item.module.css +1 -0
  134. package/lib/components/Head/index.js +2 -1
  135. package/lib/components/Header/__tests__/header.spec.js +1 -1
  136. package/lib/components/Header/accountTrigger.js +1 -0
  137. package/lib/components/Header/cartTrigger.js +4 -1
  138. package/lib/components/Header/header.js +1 -1
  139. package/lib/components/Header/navTrigger.js +1 -0
  140. package/lib/components/Header/searchTrigger.js +1 -0
  141. package/lib/components/LegacyMiniCart/cartOptions.gql.js +4 -3
  142. package/lib/components/LegacyMiniCart/editFormFragment.gql.js +7 -3
  143. package/lib/components/LegacyMiniCart/kebab.js +1 -0
  144. package/lib/components/LegacyMiniCart/productOptions.js +6 -1
  145. package/lib/components/LegacyMiniCart/section.js +15 -5
  146. package/lib/components/Link/link.js +6 -4
  147. package/lib/components/Mask/mask.js +3 -3
  148. package/lib/components/MegaMenu/__tests__/MegaMenuItem.spec.js +1 -0
  149. package/lib/components/MegaMenu/__tests__/__snapshots__/MegaMenu.spec.js.snap +9 -0
  150. package/lib/components/MegaMenu/__tests__/__snapshots__/MegaMenuItem.spec.js.snap +6 -0
  151. package/lib/components/MegaMenu/__tests__/__snapshots__/Submenu.spec.js.snap +2 -0
  152. package/lib/components/MegaMenu/megaMenu.js +6 -2
  153. package/lib/components/MegaMenu/megaMenuItem.js +27 -6
  154. package/lib/components/MegaMenu/megaMenuItem.module.css +0 -5
  155. package/lib/components/MegaMenu/submenu.js +5 -3
  156. package/lib/components/MegaMenu/submenuColumn.js +15 -4
  157. package/lib/components/MiniCart/ProductList/__tests__/__snapshots__/item.spec.js.snap +4 -4
  158. package/lib/components/MiniCart/ProductList/__tests__/__snapshots__/productList.spec.js.snap +1 -1
  159. package/lib/components/MiniCart/ProductList/__tests__/productList.spec.js +1 -1
  160. package/lib/components/MiniCart/ProductList/item.js +5 -2
  161. package/lib/components/MiniCart/ProductList/productList.js +6 -2
  162. package/lib/components/MiniCart/__tests__/__snapshots__/miniCart.spec.js.snap +1 -1
  163. package/lib/components/MiniCart/miniCart.gql.js +3 -2
  164. package/lib/components/MiniCart/miniCart.js +9 -4
  165. package/lib/components/MyAccount/ResetPassword/resetPassword.gql.js +1 -1
  166. package/lib/components/Newsletter/__tests__/__snapshots__/newsletter.shimmer.spec.js.snap +40 -0
  167. package/lib/components/Newsletter/__tests__/__snapshots__/newsletter.spec.js.snap +14 -8
  168. package/lib/components/Newsletter/__tests__/newsletter.shimmer.spec.js +10 -0
  169. package/lib/components/Newsletter/__tests__/newsletter.spec.js +25 -2
  170. package/lib/components/Newsletter/newsletter.js +27 -6
  171. package/lib/components/Newsletter/newsletter.shimmer.js +46 -0
  172. package/lib/components/Newsletter/newsletter.shimmer.module.css +11 -0
  173. package/lib/components/OrderHistoryPage/OrderDetails/__tests__/__snapshots__/item.spec.js.snap +1 -1
  174. package/lib/components/OrderHistoryPage/OrderDetails/__tests__/__snapshots__/shippingMethod.spec.js.snap +3 -0
  175. package/lib/components/OrderHistoryPage/OrderDetails/billingInformation.js +4 -1
  176. package/lib/components/OrderHistoryPage/OrderDetails/item.js +1 -1
  177. package/lib/components/OrderHistoryPage/OrderDetails/items.js +1 -1
  178. package/lib/components/OrderHistoryPage/OrderDetails/paymentMethod.js +1 -1
  179. package/lib/components/OrderHistoryPage/OrderDetails/shippingInformation.js +4 -1
  180. package/lib/components/OrderHistoryPage/OrderDetails/shippingMethod.js +5 -1
  181. package/lib/components/OrderHistoryPage/orderHistoryPage.js +8 -1
  182. package/lib/components/Pagination/pagination.js +1 -1
  183. package/lib/components/Pagination/tile.js +5 -1
  184. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Boolean/__tests__/__snapshots__/boolean.spec.js.snap +20 -0
  185. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Boolean/__tests__/boolean.spec.js +52 -0
  186. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Boolean/boolean.js +74 -0
  187. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Boolean/boolean.module.css +9 -0
  188. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Boolean/index.js +1 -0
  189. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Date/__tests__/__snapshots__/date.spec.js.snap +25 -0
  190. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Date/__tests__/date.spec.js +52 -0
  191. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Date/date.js +82 -0
  192. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Date/date.module.css +9 -0
  193. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Date/index.js +1 -0
  194. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/DateTime/__tests__/__snapshots__/dateTime.spec.js.snap +29 -0
  195. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/DateTime/__tests__/dateTime.spec.js +53 -0
  196. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/DateTime/dateTime.js +85 -0
  197. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/DateTime/dateTime.module.css +9 -0
  198. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/DateTime/index.js +1 -0
  199. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Multiselect/__tests__/__snapshots__/multiSelect.spec.js.snap +36 -0
  200. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Multiselect/__tests__/multiSelect.spec.js +88 -0
  201. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Multiselect/index.js +1 -0
  202. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Multiselect/multiselect.js +99 -0
  203. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Multiselect/multiselect.module.css +13 -0
  204. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Price/__tests__/__snapshots__/price.spec.js.snap +23 -0
  205. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Price/__tests__/price.spec.js +52 -0
  206. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Price/index.js +1 -0
  207. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Price/price.js +74 -0
  208. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Price/price.module.css +9 -0
  209. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Select/__tests__/__snapshots__/select.spec.js.snap +36 -0
  210. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Select/__tests__/select.spec.js +88 -0
  211. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Select/index.js +1 -0
  212. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Select/select.js +99 -0
  213. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Select/select.module.css +13 -0
  214. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Text/__tests__/__snapshots__/text.spec.js.snap +33 -0
  215. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Text/__tests__/text.spec.js +74 -0
  216. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Text/index.js +1 -0
  217. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Text/text.js +88 -0
  218. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Text/text.module.css +13 -0
  219. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Textarea/__tests__/__snapshots__/textarea.spec.js.snap +33 -0
  220. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Textarea/__tests__/textarea.spec.js +74 -0
  221. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Textarea/index.js +1 -0
  222. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Textarea/textarea.js +88 -0
  223. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Textarea/textarea.module.css +13 -0
  224. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/__tests__/__snapshots__/attributeType.spec.js.snap +101 -0
  225. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/__tests__/attributeType.spec.js +173 -0
  226. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/attributeType.js +61 -0
  227. package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/index.js +1 -0
  228. package/lib/components/ProductFullDetail/CustomAttributes/__tests__/__snapshots__/customAttributes.spec.js.snap +55 -0
  229. package/lib/components/ProductFullDetail/CustomAttributes/__tests__/customAttributes.spec.js +77 -0
  230. package/lib/components/ProductFullDetail/CustomAttributes/customAttributes.js +68 -0
  231. package/lib/components/ProductFullDetail/CustomAttributes/customAttributes.module.css +14 -0
  232. package/lib/components/ProductFullDetail/CustomAttributes/index.js +1 -0
  233. package/lib/components/ProductFullDetail/__tests__/__snapshots__/productFullDetail.spec.js.snap +39 -0
  234. package/lib/components/ProductFullDetail/__tests__/productFullDetail.spec.js +3 -1
  235. package/lib/components/ProductFullDetail/productFullDetail.js +18 -3
  236. package/lib/components/ProductOptions/__tests__/__snapshots__/option.spec.js.snap +1 -1
  237. package/lib/components/ProductOptions/__tests__/__snapshots__/options.spec.js.snap +2 -2
  238. package/lib/components/ProductOptions/__tests__/__snapshots__/swatch.spec.js.snap +44 -2
  239. package/lib/components/ProductOptions/__tests__/__snapshots__/swatchList.spec.js.snap +22 -1
  240. package/lib/components/ProductOptions/__tests__/swatch.spec.js +0 -2
  241. package/lib/components/ProductOptions/option.js +2 -2
  242. package/lib/components/ProductOptions/swatch.js +7 -5
  243. package/lib/components/ProductOptions/swatch.module.css +11 -0
  244. package/lib/components/ProductOptions/tile.js +1 -0
  245. package/lib/components/ProductSort/__tests__/__snapshots__/sortItem.spec.js.snap +14 -0
  246. package/lib/components/ProductSort/__tests__/sortItem.spec.js +61 -0
  247. package/lib/components/ProductSort/productSort.js +84 -40
  248. package/lib/components/ProductSort/sortItem.js +26 -11
  249. package/lib/components/RadioGroup/radio.module.css +13 -5
  250. package/lib/components/RadioGroup/radioGroup.js +2 -1
  251. package/lib/components/Rating/__tests__/__snapshots__/rating.spec.js.snap +27 -0
  252. package/lib/components/Rating/__tests__/rating.spec.js +13 -0
  253. package/lib/components/Rating/index.js +1 -0
  254. package/lib/components/Rating/rating.js +30 -0
  255. package/lib/components/Rating/rating.module.css +21 -0
  256. package/lib/components/RichContent/richContent.module.css +52 -59
  257. package/lib/components/SearchBar/autocomplete.js +3 -0
  258. package/lib/components/SearchBar/searchBar.js +1 -1
  259. package/lib/components/SearchBar/searchField.js +1 -0
  260. package/lib/components/SearchBar/suggestedCategory.js +1 -1
  261. package/lib/components/SearchBar/suggestedProduct.js +6 -1
  262. package/lib/components/SearchPage/__tests__/__snapshots__/searchPage.spec.js.snap +41 -1
  263. package/lib/components/SearchPage/__tests__/searchPage.spec.js +8 -0
  264. package/lib/components/SearchPage/searchPage.js +12 -6
  265. package/lib/components/Shimmer/shimmer.js +11 -2
  266. package/lib/components/Shimmer/shimmer.module.css +4 -8
  267. package/lib/components/SignIn/__tests__/__snapshots__/signIn.spec.js.snap +126 -0
  268. package/lib/components/SignIn/__tests__/signIn.spec.js +11 -0
  269. package/lib/components/SignIn/signIn.gql.js +8 -4
  270. package/lib/components/SignIn/signIn.js +24 -4
  271. package/lib/components/TextArea/textArea.module.css +9 -0
  272. package/lib/components/TextInput/textInput.module.css +4 -0
  273. package/lib/components/ToastContainer/toast.js +23 -3
  274. package/lib/components/ToastContainer/toast.module.css +3 -0
  275. package/lib/components/Trigger/trigger.js +9 -2
  276. package/lib/components/Wishlist/AddToListButton/addToListButton.ee.js +1 -0
  277. package/lib/components/Wishlist/WishlistDialog/CreateWishlistForm/createWishlistForm.js +2 -0
  278. package/lib/components/Wishlist/WishlistDialog/WishlistLineItem/wishlistLineItem.js +1 -0
  279. package/lib/components/Wishlist/WishlistDialog/wishlistDialog.js +1 -0
  280. package/lib/components/WishlistPage/__tests__/__snapshots__/wishlistPage.spec.js.snap +5 -5
  281. package/lib/components/WishlistPage/createWishlist.ee.js +2 -0
  282. package/lib/components/WishlistPage/wishlist.js +8 -3
  283. package/lib/components/WishlistPage/wishlistItem.js +17 -4
  284. package/lib/components/WishlistPage/wishlistPage.js +5 -3
  285. package/lib/defaultRoutes.json +6 -0
  286. package/lib/targets/__tests__/venia-ui-targets.spec.js +2 -0
  287. package/lib/util/__tests__/shrinkGETQuery.spec.js +1 -1
  288. package/lib/util/apolloCache.js +2 -2
  289. package/lib/util/formValidators.js +10 -8
  290. package/lib/util/toCamelCase.js +3 -0
  291. package/package.json +17 -14
  292. package/upward.yml +19 -40
@@ -44,7 +44,9 @@ const CartTrigger = props => {
44
44
  : classes.triggerContainer;
45
45
 
46
46
  const maybeItemCounter = itemCount ? (
47
- <span className={classes.counter}>{itemCountDisplay}</span>
47
+ <span className={classes.counter} data-cy="CartTrigger-counter">
48
+ {itemCountDisplay}
49
+ </span>
48
50
  ) : null;
49
51
 
50
52
  const cartTrigger = hideCartTrigger ? null : (
@@ -57,6 +59,7 @@ const CartTrigger = props => {
57
59
  aria-label={buttonAriaLabel}
58
60
  className={classes.trigger}
59
61
  onClick={handleTriggerClick}
62
+ data-cy="CartTrigger-trigger"
60
63
  >
61
64
  <Icon src={ShoppingCartIcon} />
62
65
  {maybeItemCounter}
@@ -56,7 +56,7 @@ const Header = props => {
56
56
  <CurrencySwitcher />
57
57
  </div>
58
58
  </div>
59
- <header className={rootClass}>
59
+ <header className={rootClass} data-cy="Header-root">
60
60
  <div className={classes.toolbar}>
61
61
  <div className={classes.primaryActions}>
62
62
  <NavTrigger />
@@ -19,6 +19,7 @@ const NavigationTrigger = props => {
19
19
  return (
20
20
  <button
21
21
  className={classes.root}
22
+ data-cy="Header-NavigationTrigger-root"
22
23
  aria-label={formatMessage({
23
24
  id: 'navigationTrigger.ariaLabel',
24
25
  defaultMessage: 'Toggle navigation panel'
@@ -30,6 +30,7 @@ const SearchTrigger = React.forwardRef((props, ref) => {
30
30
  return (
31
31
  <button
32
32
  className={searchClass}
33
+ data-cy="SearchTrigger-button"
33
34
  aria-label={searchText}
34
35
  onClick={handleClick}
35
36
  ref={ref}
@@ -3,8 +3,9 @@ import { CartPageFragment } from '@magento/peregrine/lib/talons/CartPage/cartPag
3
3
 
4
4
  export const REMOVE_ITEM_MUTATION = gql`
5
5
  mutation RemoveItemForOptions($cartId: String!, $itemId: ID!) {
6
- removeItemFromCart(input: { cart_id: $cartId, cart_item_uid: $itemId })
7
- @connection(key: "removeItemFromCart") {
6
+ removeItemFromCart(
7
+ input: { cart_id: $cartId, cart_item_uid: $itemId }
8
+ ) {
8
9
  cart {
9
10
  id
10
11
  # If this mutation causes "free" to become available we need to know.
@@ -30,7 +31,7 @@ export const UPDATE_ITEM_MUTATION = gql`
30
31
  cart_id: $cartId
31
32
  cart_items: [{ cart_item_uid: $itemId, quantity: $quantity }]
32
33
  }
33
- ) @connection(key: "updateCartItems") {
34
+ ) {
34
35
  cart {
35
36
  id
36
37
  # If this mutation causes "free" to become available we need to know.
@@ -1,17 +1,20 @@
1
1
  import { gql } from '@apollo/client';
2
2
 
3
3
  export const EditFormFragment = gql`
4
+ # eslint-disable-next-line @graphql-eslint/require-id-when-available
4
5
  fragment EditFormFragment on ProductInterface {
5
- id
6
+ uid
6
7
  name
7
8
  sku
8
9
  url_key
9
10
  __typename
11
+ # eslint-disable-next-line @graphql-eslint/require-id-when-available
10
12
  ... on ConfigurableProduct {
13
+ # eslint-disable-next-line @graphql-eslint/require-id-when-available
11
14
  configurable_options {
12
15
  attribute_code
13
16
  attribute_id
14
- id
17
+ uid
15
18
  label
16
19
  values {
17
20
  default_label
@@ -32,8 +35,9 @@ export const EditFormFragment = gql`
32
35
  code
33
36
  value_index
34
37
  }
38
+ # eslint-disable-next-line @graphql-eslint/require-id-when-available
35
39
  product {
36
- id
40
+ uid
37
41
  media_gallery_entries {
38
42
  id
39
43
  disabled
@@ -18,6 +18,7 @@ const Kebab = props => {
18
18
  <div className={classes.root}>
19
19
  <button
20
20
  className={classes.kebab}
21
+ data-cy="Kebab-button"
21
22
  onClick={handleKebabClick}
22
23
  ref={kebabRef}
23
24
  >
@@ -19,7 +19,12 @@ const ProductOptions = props => {
19
19
  <dt className={classes.optionName}>
20
20
  {optionLabelString}
21
21
  </dt>
22
- <dd className={classes.optionValue}>{value_label}</dd>
22
+ <dd
23
+ className={classes.optionValue}
24
+ data-cy="ProductOptions-optionValue"
25
+ >
26
+ {value_label}
27
+ </dd>
23
28
  </div>
24
29
  );
25
30
  }),
@@ -17,9 +17,16 @@ const icons = new Map()
17
17
  .set('Trash', TrashIcon);
18
18
 
19
19
  const Section = props => {
20
- const { icon, isFilled, onClick, text } = props;
21
-
22
- const classes = useStyle(defaultClasses, props.classes);
20
+ const {
21
+ icon,
22
+ isFilled,
23
+ onClick,
24
+ text,
25
+ classes: propClasses,
26
+ ...restProps
27
+ } = props;
28
+
29
+ const classes = useStyle(defaultClasses, propClasses);
23
30
  const iconClasses = { root: classes.icon };
24
31
  const iconSrc = icons.get(icon);
25
32
 
@@ -28,8 +35,11 @@ const Section = props => {
28
35
  }
29
36
 
30
37
  return (
31
- <li className={classes.menuItem}>
32
- <button onMouseDown={onClick}>
38
+ <li className={classes.menuItem} {...restProps}>
39
+ <button
40
+ onMouseDown={onClick}
41
+ data-cy="LegacyMiniCart-Section-button"
42
+ >
33
43
  <Icon classes={iconClasses} size={16} src={iconSrc} />
34
44
  <span className={classes.text}>{text}</span>
35
45
  </button>
@@ -10,11 +10,13 @@ const removeProps = (props, exclude) => {
10
10
  };
11
11
 
12
12
  /**
13
- * Use for links to pages within your app.
14
- *
15
13
  * @kind functional component
16
- * @param {props} props React component props
17
- * @returns {RouterLink} the `Link` component from `react-router-dom`. We add a `ref` to prefetch pages when the link enters the viewport.
14
+ *
15
+ * @property {bool} prefetchType `true` activates prefetching the target page when the link becomes visible in the viewport.
16
+ * @property {string} to From [react-router-dom Link](https://knowbody.github.io/react-router-docs/api/Link.html). The absolute path to the target page of the link. Uses the `to` prop from the `react-router-dom Link`.
17
+ *
18
+ * @example <caption>Basic usage</caption>
19
+ * <Link prefetchType={true} to="/about/">About Us</Link>
18
20
  */
19
21
  const Link = props => {
20
22
  const talonProps = useLink(props);
@@ -13,11 +13,11 @@ import defaultClasses from './mask.module.css';
13
13
  *
14
14
  */
15
15
  const Mask = props => {
16
- const { dismiss, isActive } = props;
17
- const classes = useStyle(defaultClasses, props.classes);
16
+ const { dismiss, isActive, classes: propClasses, ...restProps } = props;
17
+ const classes = useStyle(defaultClasses, propClasses);
18
18
  const className = isActive ? classes.root_active : classes.root;
19
19
 
20
- return <button className={className} onClick={dismiss} />;
20
+ return <button className={className} onClick={dismiss} {...restProps} />;
21
21
  };
22
22
 
23
23
  export default Mask;
@@ -29,6 +29,7 @@ jest.mock('@magento/peregrine/lib/talons/MegaMenu/useMegaMenuItem', () => ({
29
29
  return {
30
30
  isFocused: false,
31
31
  isActive: false,
32
+ handleMenuItemFocus: jest.fn(),
32
33
  handleCloseSubMenu: jest.fn(),
33
34
  isMenuActive: false,
34
35
  handleKeyDown: mockHandleKeyDown
@@ -14,6 +14,9 @@ exports[`#MegaMenu renders menu if in viewport 1`] = `
14
14
  >
15
15
  <div
16
16
  className="megaMenuItem"
17
+ onMouseEnter={[Function]}
18
+ onMouseLeave={[Function]}
19
+ onTouchStart={[Function]}
17
20
  >
18
21
  <a
19
22
  aria-label="Category: Women. 1 sub-categories"
@@ -76,6 +79,9 @@ exports[`#MegaMenu renders menu if in viewport 1`] = `
76
79
  </div>
77
80
  <div
78
81
  className="megaMenuItem"
82
+ onMouseEnter={[Function]}
83
+ onMouseLeave={[Function]}
84
+ onTouchStart={[Function]}
79
85
  >
80
86
  <a
81
87
  className="megaMenuLink"
@@ -88,6 +94,9 @@ exports[`#MegaMenu renders menu if in viewport 1`] = `
88
94
  </div>
89
95
  <div
90
96
  className="megaMenuItem"
97
+ onMouseEnter={[Function]}
98
+ onMouseLeave={[Function]}
99
+ onTouchStart={[Function]}
91
100
  >
92
101
  <a
93
102
  className="megaMenuLink"
@@ -3,6 +3,9 @@
3
3
  exports[`Mega menu item renders correctly it does not render submenu when item does not have children 1`] = `
4
4
  <div
5
5
  className="megaMenuItem"
6
+ onMouseEnter={[Function]}
7
+ onMouseLeave={[Function]}
8
+ onTouchStart={[Function]}
6
9
  >
7
10
  <mock-Submenu
8
11
  categoryUrlSuffix=".html"
@@ -34,6 +37,9 @@ exports[`Mega menu item renders correctly it does not render submenu when item d
34
37
  exports[`Mega menu item renders correctly it renders correctly 1`] = `
35
38
  <div
36
39
  className="megaMenuItem"
40
+ onMouseEnter={[Function]}
41
+ onMouseLeave={[Function]}
42
+ onTouchStart={[Function]}
37
43
  >
38
44
  <mock-Submenu
39
45
  categoryUrlSuffix=".html"
@@ -30,6 +30,7 @@ exports[`Submenu renders correctly it renders correctly 1`] = `
30
30
  }
31
31
  }
32
32
  categoryUrlSuffix=".html"
33
+ handleCloseSubMenu={[MockFunction handleCloseSubMenu]}
33
34
  index={0}
34
35
  keyboardProps={Object {}}
35
36
  />
@@ -44,6 +45,7 @@ exports[`Submenu renders correctly it renders correctly 1`] = `
44
45
  }
45
46
  }
46
47
  categoryUrlSuffix=".html"
48
+ handleCloseSubMenu={[MockFunction handleCloseSubMenu]}
47
49
  index={1}
48
50
  keyboardProps={
49
51
  Object {
@@ -20,7 +20,8 @@ const MegaMenu = props => {
20
20
  disableFocus,
21
21
  handleSubMenuFocus,
22
22
  categoryUrlSuffix,
23
- handleNavigate
23
+ handleNavigate,
24
+ handleClickOutside
24
25
  } = useMegaMenu({ mainNavRef });
25
26
 
26
27
  const classes = useStyle(defaultClasses, props.classes);
@@ -57,9 +58,11 @@ const MegaMenu = props => {
57
58
  categoryUrlSuffix={categoryUrlSuffix}
58
59
  mainNavWidth={mainNavWidth}
59
60
  onNavigate={handleNavigate}
60
- key={category.id}
61
+ key={category.uid}
61
62
  subMenuState={subMenuState}
62
63
  disableFocus={disableFocus}
64
+ handleSubMenuFocus={handleSubMenuFocus}
65
+ handleClickOutside={handleClickOutside}
63
66
  />
64
67
  );
65
68
  })
@@ -69,6 +72,7 @@ const MegaMenu = props => {
69
72
  <nav
70
73
  ref={mainNavRef}
71
74
  className={classes.megaMenu}
75
+ data-cy="MegaMenu-megaMenu"
72
76
  role="navigation"
73
77
  onFocus={handleSubMenuFocus}
74
78
  >
@@ -15,7 +15,7 @@ import Icon from '../Icon';
15
15
  * The MegaMenuItem component displays mega menu item
16
16
  *
17
17
  * @param {MegaMenuCategory} props.category
18
- * @param {int} props.activeCategoryId - id of active category
18
+ * @param {String} props.activeCategoryId - uid of active category
19
19
  * @param {int} props.mainNavWidth - width of the main nav. It's used for setting min-width of the submenu
20
20
  * @param {function} props.onNavigate - function called when clicking on Link
21
21
  */
@@ -27,7 +27,9 @@ const MegaMenuItem = props => {
27
27
  categoryUrlSuffix,
28
28
  subMenuState,
29
29
  disableFocus,
30
- onNavigate
30
+ onNavigate,
31
+ handleSubMenuFocus,
32
+ handleClickOutside
31
33
  } = props;
32
34
 
33
35
  const classes = useStyle(defaultClasses, props.classes);
@@ -45,6 +47,7 @@ const MegaMenuItem = props => {
45
47
  const {
46
48
  isFocused,
47
49
  isActive,
50
+ handleMenuItemFocus,
48
51
  handleCloseSubMenu,
49
52
  isMenuActive,
50
53
  handleKeyDown
@@ -89,13 +92,29 @@ const MegaMenuItem = props => {
89
92
  : {};
90
93
 
91
94
  return (
92
- <div className={megaMenuItemClassname}>
95
+ <div
96
+ className={megaMenuItemClassname}
97
+ data-cy="MegaMenu-MegaMenuItem-megaMenuItem"
98
+ onMouseEnter={() => {
99
+ handleSubMenuFocus();
100
+ handleMenuItemFocus();
101
+ }}
102
+ onTouchStart={() => {
103
+ handleSubMenuFocus();
104
+ handleMenuItemFocus();
105
+ }}
106
+ onMouseLeave={e => {
107
+ handleClickOutside(e);
108
+ handleCloseSubMenu();
109
+ }}
110
+ >
93
111
  <Link
94
112
  {...linkAttributes}
95
113
  onKeyDown={handleKeyDown}
96
114
  className={
97
115
  isActive ? classes.megaMenuLinkActive : classes.megaMenuLink
98
116
  }
117
+ data-cy="MegaMenu-MegaMenuItem-link"
99
118
  to={categoryUrl}
100
119
  onClick={onNavigate}
101
120
  >
@@ -112,7 +131,7 @@ export default MegaMenuItem;
112
131
  MegaMenuItem.propTypes = {
113
132
  category: PropTypes.shape({
114
133
  children: PropTypes.array,
115
- id: PropTypes.number.isRequired,
134
+ uid: PropTypes.string.isRequired,
116
135
  include_in_menu: PropTypes.number,
117
136
  isActive: PropTypes.bool.isRequired,
118
137
  name: PropTypes.string.isRequired,
@@ -120,8 +139,10 @@ MegaMenuItem.propTypes = {
120
139
  position: PropTypes.number.isRequired,
121
140
  url_path: PropTypes.string.isRequired
122
141
  }).isRequired,
123
- activeCategoryId: PropTypes.number,
142
+ activeCategoryId: PropTypes.string,
124
143
  mainNavWidth: PropTypes.number.isRequired,
125
144
  categoryUrlSuffix: PropTypes.string,
126
- onNavigate: PropTypes.func.isRequired
145
+ onNavigate: PropTypes.func.isRequired,
146
+ handleSubMenuFocus: PropTypes.func.isRequired,
147
+ handleClickOutside: PropTypes.func.isRequired
127
148
  };
@@ -13,11 +13,6 @@
13
13
  text-decoration: underline;
14
14
  }
15
15
 
16
- .megaMenuItem:hover > div,
17
- .megaMenuItem:focus > div {
18
- display: flex;
19
- }
20
-
21
16
  .megaMenuItem_active {
22
17
  composes: megaMenuItem;
23
18
  display: flex;
@@ -46,10 +46,11 @@ const Submenu = props => {
46
46
  <SubmenuColumn
47
47
  index={index}
48
48
  keyboardProps={keyboardProps}
49
- key={category.id}
49
+ key={category.uid}
50
50
  category={category}
51
51
  categoryUrlSuffix={categoryUrlSuffix}
52
52
  onNavigate={onNavigate}
53
+ handleCloseSubMenu={handleCloseSubMenu}
53
54
  />
54
55
  );
55
56
  });
@@ -72,7 +73,7 @@ Submenu.propTypes = {
72
73
  items: PropTypes.arrayOf(
73
74
  PropTypes.shape({
74
75
  children: PropTypes.array.isRequired,
75
- id: PropTypes.number.isRequired,
76
+ uid: PropTypes.string.isRequired,
76
77
  include_in_menu: PropTypes.number.isRequired,
77
78
  isActive: PropTypes.bool.isRequired,
78
79
  name: PropTypes.string.isRequired,
@@ -83,5 +84,6 @@ Submenu.propTypes = {
83
84
  ).isRequired,
84
85
  mainNavWidth: PropTypes.number.isRequired,
85
86
  categoryUrlSuffix: PropTypes.string,
86
- onNavigate: PropTypes.func.isRequired
87
+ onNavigate: PropTypes.func.isRequired,
88
+ handleCloseSubMenu: PropTypes.func.isRequired
87
89
  };
@@ -14,7 +14,12 @@ import PropTypes from 'prop-types';
14
14
  * @param {function} props.onNavigate - function called when clicking on Link
15
15
  */
16
16
  const SubmenuColumn = props => {
17
- const { category, categoryUrlSuffix, onNavigate } = props;
17
+ const {
18
+ category,
19
+ categoryUrlSuffix,
20
+ onNavigate,
21
+ handleCloseSubMenu
22
+ } = props;
18
23
  const classes = useStyle(defaultClasses, props.classes);
19
24
 
20
25
  const categoryUrl = resourceUrl(
@@ -40,6 +45,7 @@ const SubmenuColumn = props => {
40
45
  <Link
41
46
  {...keyboardProps}
42
47
  className={isActive ? classes.linkActive : classes.link}
48
+ data-cy="MegaMenu-SubmenuColumn-link"
43
49
  to={categoryUrl}
44
50
  onClick={onNavigate}
45
51
  >
@@ -60,8 +66,12 @@ const SubmenuColumn = props => {
60
66
  <Link
61
67
  {...keyboardProps}
62
68
  className={classes.link}
69
+ data-cy="MegaMenu-SubmenuColumn-link"
63
70
  to={categoryUrl}
64
- onClick={onNavigate}
71
+ onClick={() => {
72
+ handleCloseSubMenu();
73
+ onNavigate();
74
+ }}
65
75
  >
66
76
  <span className={classes.heading}>{category.name}</span>
67
77
  </Link>
@@ -75,7 +85,7 @@ export default SubmenuColumn;
75
85
  SubmenuColumn.propTypes = {
76
86
  category: PropTypes.shape({
77
87
  children: PropTypes.array,
78
- id: PropTypes.number.isRequired,
88
+ uid: PropTypes.string.isRequired,
79
89
  include_in_menu: PropTypes.number,
80
90
  isActive: PropTypes.bool.isRequired,
81
91
  name: PropTypes.string.isRequired,
@@ -84,5 +94,6 @@ SubmenuColumn.propTypes = {
84
94
  url_path: PropTypes.string.isRequired
85
95
  }).isRequired,
86
96
  categoryUrlSuffix: PropTypes.string,
87
- onNavigate: PropTypes.func.isRequired
97
+ onNavigate: PropTypes.func.isRequired,
98
+ handleCloseSubMenu: PropTypes.func.isRequired
88
99
  };
@@ -67,7 +67,7 @@ exports[`Should disable delete icon while loading 1`] = `
67
67
  className="quantity"
68
68
  >
69
69
  <mock-FormattedMessage
70
- defaultMessage="Qty :"
70
+ defaultMessage="Qty : {quantity}"
71
71
  id="productList.quantity"
72
72
  values={
73
73
  Object {
@@ -213,7 +213,7 @@ exports[`Should render correctly 1`] = `
213
213
  className="quantity"
214
214
  >
215
215
  <mock-FormattedMessage
216
- defaultMessage="Qty :"
216
+ defaultMessage="Qty : {quantity}"
217
217
  id="productList.quantity"
218
218
  values={
219
219
  Object {
@@ -359,7 +359,7 @@ exports[`Should render correctly when configured to use variant thumbnail 1`] =
359
359
  className="quantity"
360
360
  >
361
361
  <mock-FormattedMessage
362
- defaultMessage="Qty :"
362
+ defaultMessage="Qty : {quantity}"
363
363
  id="productList.quantity"
364
364
  values={
365
365
  Object {
@@ -505,7 +505,7 @@ exports[`Should render correctly with out of stock product 1`] = `
505
505
  className="quantity"
506
506
  >
507
507
  <mock-FormattedMessage
508
- defaultMessage="Qty :"
508
+ defaultMessage="Qty : {quantity}"
509
509
  id="productList.quantity"
510
510
  values={
511
511
  Object {
@@ -7,12 +7,12 @@ exports[`Should render properly 1`] = `
7
7
  <Item
8
8
  closeMiniCart={[MockFunction closeMiniCart]}
9
9
  handleRemoveItem={[MockFunction handleRemoveItem]}
10
- id="1"
11
10
  product={
12
11
  Object {
13
12
  "name": "Simple Product",
14
13
  }
15
14
  }
15
+ uid="1"
16
16
  />
17
17
  </div>
18
18
  `;
@@ -15,7 +15,7 @@ const props = {
15
15
  handleRemoveItem: jest.fn().mockName('handleRemoveItem'),
16
16
  items: [
17
17
  {
18
- id: '1',
18
+ uid: '1',
19
19
  product: {
20
20
  name: 'Simple Product'
21
21
  }
@@ -53,11 +53,12 @@ const Item = props => {
53
53
  const configured_variant = configuredVariant(configurable_options, product);
54
54
 
55
55
  return (
56
- <div className={rootClass}>
56
+ <div className={rootClass} data-cy="MiniCart-Item-root">
57
57
  <Link
58
58
  className={classes.thumbnailContainer}
59
59
  to={itemLink}
60
60
  onClick={closeMiniCart}
61
+ data-cy="item-thumbnailContainer"
61
62
  >
62
63
  <Image
63
64
  alt={product.name}
@@ -77,6 +78,7 @@ const Item = props => {
77
78
  className={classes.name}
78
79
  to={itemLink}
79
80
  onClick={closeMiniCart}
81
+ data-cy="item-name"
80
82
  >
81
83
  {product.name}
82
84
  </Link>
@@ -89,7 +91,7 @@ const Item = props => {
89
91
  <span className={classes.quantity}>
90
92
  <FormattedMessage
91
93
  id={'productList.quantity'}
92
- defaultMessage={'Qty :'}
94
+ defaultMessage={'Qty : {quantity}'}
93
95
  values={{ quantity }}
94
96
  />
95
97
  </span>
@@ -109,6 +111,7 @@ const Item = props => {
109
111
  type="button"
110
112
  className={classes.deleteButton}
111
113
  disabled={isDeleting}
114
+ data-cy="MiniCart-Item-deleteButton"
112
115
  >
113
116
  <Icon
114
117
  size={16}
@@ -21,7 +21,7 @@ const ProductList = props => {
21
21
  if (items) {
22
22
  return items.map(item => (
23
23
  <Item
24
- key={item.id}
24
+ key={item.uid}
25
25
  {...item}
26
26
  closeMiniCart={closeMiniCart}
27
27
  handleRemoveItem={handleRemoveItem}
@@ -38,7 +38,11 @@ const ProductList = props => {
38
38
  storeUrlSuffix
39
39
  ]);
40
40
 
41
- return <div className={classes.root}>{cartItems}</div>;
41
+ return (
42
+ <div className={classes.root} data-cy="MiniCart-ProductList-root">
43
+ {cartItems}
44
+ </div>
45
+ );
42
46
  };
43
47
 
44
48
  export default ProductList;
@@ -46,7 +46,7 @@ exports[`it renders correctly 1`] = `
46
46
  className="quantity"
47
47
  >
48
48
  <mock-FormattedMessage
49
- defaultMessage="Items"
49
+ defaultMessage="{totalQuantity} Items"
50
50
  id="miniCart.totalQuantity"
51
51
  values={
52
52
  Object {
@@ -19,8 +19,9 @@ export const MINI_CART_QUERY = gql`
19
19
 
20
20
  export const REMOVE_ITEM_MUTATION = gql`
21
21
  mutation RemoveItemForMiniCart($cartId: String!, $itemId: ID!) {
22
- removeItemFromCart(input: { cart_id: $cartId, cart_item_uid: $itemId })
23
- @connection(key: "removeItemFromCart") {
22
+ removeItemFromCart(
23
+ input: { cart_id: $cartId, cart_item_uid: $itemId }
24
+ ) {
24
25
  cart {
25
26
  id
26
27
  ...MiniCartFragment