@magento/venia-ui 9.4.0-beta.1 → 9.5.0-alpha.2

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 (65) hide show
  1. package/i18n/en_US.json +2 -0
  2. package/lib/RootComponents/CMS/__tests__/cms.spec.js +4 -0
  3. package/lib/RootComponents/Category/__tests__/__snapshots__/categoryContent.spec.js.snap +9 -0
  4. package/lib/RootComponents/Category/category.js +19 -1
  5. package/lib/RootComponents/Category/categoryContent.js +1 -1
  6. package/lib/components/AccountInformationPage/__tests__/__snapshots__/accountInformationPage.spec.js.snap +1 -0
  7. package/lib/components/AccountInformationPage/accountInformationPage.js +1 -0
  8. package/lib/components/AddressBookPage/__tests__/__snapshots__/addressBookPage.spec.js.snap +3 -0
  9. package/lib/components/AddressBookPage/addressBookPage.js +5 -1
  10. package/lib/components/AddressBookPage/addressBookPage.module.css +3 -0
  11. package/lib/components/CartPage/__tests__/__snapshots__/cartPage.spec.js.snap +2 -0
  12. package/lib/components/CartPage/cartPage.js +5 -1
  13. package/lib/components/CheckoutPage/AddressBook/__tests__/__snapshots__/addressBook.spec.js.snap +2 -0
  14. package/lib/components/CheckoutPage/AddressBook/addressBook.js +1 -1
  15. package/lib/components/CheckoutPage/GuestSignIn/__tests__/__snapshots__/guestSignIn.spec.js.snap +3 -0
  16. package/lib/components/CheckoutPage/GuestSignIn/guestSignIn.js +1 -1
  17. package/lib/components/CheckoutPage/ItemsReview/itemsReview.js +1 -1
  18. package/lib/components/CheckoutPage/OrderSummary/__tests__/__snapshots__/orderSummary.spec.js.snap +1 -0
  19. package/lib/components/CheckoutPage/OrderSummary/orderSummary.js +1 -1
  20. package/lib/components/CheckoutPage/PaymentInformation/brainTreeDropIn.js +7 -2
  21. package/lib/components/CheckoutPage/__tests__/__snapshots__/checkoutPage.spec.js.snap +1 -0
  22. package/lib/components/CheckoutPage/checkoutPage.js +1 -0
  23. package/lib/components/CreateAccount/__tests__/createAccount.spec.js +4 -0
  24. package/lib/components/Footer/__tests__/__snapshots__/footer.spec.js.snap +1 -0
  25. package/lib/components/Footer/footer.js +8 -2
  26. package/lib/components/Gallery/__tests__/gallery.spec.js +3 -0
  27. package/lib/components/Gallery/__tests__/item.spec.js +3 -0
  28. package/lib/components/Gallery/item.js +5 -0
  29. package/lib/components/Header/__tests__/__snapshots__/cartTrigger.spec.js.snap +6 -0
  30. package/lib/components/Header/__tests__/__snapshots__/currencySwitcher.spec.js.snap +16 -2
  31. package/lib/components/Header/__tests__/__snapshots__/storeSwitcher.spec.js.snap +17 -0
  32. package/lib/components/Header/cartTrigger.js +2 -0
  33. package/lib/components/Header/currencySwitcher.js +8 -2
  34. package/lib/components/Header/header.js +5 -0
  35. package/lib/components/Header/storeSwitcher.js +9 -4
  36. package/lib/components/Logo/logo.js +0 -1
  37. package/lib/components/MiniCart/miniCart.js +1 -0
  38. package/lib/components/MyAccount/ResetPassword/__tests__/__snapshots__/resetPassword.spec.js.snap +12 -4
  39. package/lib/components/MyAccount/ResetPassword/resetPassword.js +1 -1
  40. package/lib/components/OrderHistoryPage/__tests__/__snapshots__/orderHistoryPage.spec.js.snap +5 -0
  41. package/lib/components/OrderHistoryPage/orderHistoryPage.js +3 -1
  42. package/lib/components/PageLoadingIndicator/__tests__/__snapshots__/pageLoadingIndicator.spec.js.snap +21 -0
  43. package/lib/components/PageLoadingIndicator/__tests__/pageLoadingIndicator.spec.js +4 -4
  44. package/lib/components/PageLoadingIndicator/pageLoadingIndicator.js +6 -2
  45. package/lib/components/PageLoadingIndicator/pageLoadingIndicator.module.css +6 -1
  46. package/lib/components/ProductFullDetail/__tests__/__snapshots__/productFullDetail.spec.js.snap +13 -0
  47. package/lib/components/ProductFullDetail/productFullDetail.js +1 -0
  48. package/lib/components/SavedPaymentsPage/__tests__/__snapshots__/savedPaymentsPage.spec.js.snap +2 -0
  49. package/lib/components/SavedPaymentsPage/savedPaymentsPage.js +3 -1
  50. package/lib/components/SearchBar/__tests__/autocomplete.spec.js +25 -10
  51. package/lib/components/SearchBar/__tests__/suggestedProduct.spec.js +3 -0
  52. package/lib/components/SearchBar/autocomplete.js +4 -0
  53. package/lib/components/SearchBar/suggestedProduct.js +20 -21
  54. package/lib/components/SearchPage/__tests__/__snapshots__/searchPage.spec.js.snap +22 -0
  55. package/lib/components/SearchPage/searchPage.js +11 -3
  56. package/lib/components/SignIn/__tests__/signIn.spec.js +4 -0
  57. package/lib/components/SortedByContainer/sortedByContainer.module.css +0 -2
  58. package/lib/components/StoreCodeRoute/__tests__/storeCodeRoute.spec.js +2 -2
  59. package/lib/components/StoreCodeRoute/storeCodeRoute.js +3 -3
  60. package/lib/components/WishlistPage/__tests__/__snapshots__/wishlistPage.spec.js.snap +5 -0
  61. package/lib/components/WishlistPage/wishlistPage.js +5 -1
  62. package/lib/index.module.css +14 -0
  63. package/lib/targets/__tests__/venia-ui-targets.spec.js +2 -2
  64. package/lib/tokens.module.css +1 -1
  65. package/package.json +6 -6
@@ -7,6 +7,7 @@ exports[`does not render group name when there is only one group 1`] = `
7
7
  className="root"
8
8
  >
9
9
  <button
10
+ aria-expanded={false}
10
11
  aria-label="Store 2"
11
12
  className="trigger"
12
13
  onClick={[MockFunction]}
@@ -21,9 +22,12 @@ exports[`does not render group name when there is only one group 1`] = `
21
22
  >
22
23
  <ul
23
24
  className="groupList"
25
+ role="listbox"
24
26
  >
25
27
  <li
28
+ aria-selected="Store 2"
26
29
  className="menuItem"
30
+ role="option"
27
31
  >
28
32
  <button
29
33
  className="root"
@@ -42,7 +46,9 @@ exports[`does not render group name when there is only one group 1`] = `
42
46
  </button>
43
47
  </li>
44
48
  <li
49
+ aria-selected="Store 2"
45
50
  className="menuItem"
51
+ role="option"
46
52
  >
47
53
  <button
48
54
  className="root"
@@ -91,6 +97,7 @@ exports[`renders the correct tree 1`] = `
91
97
  className="root"
92
98
  >
93
99
  <button
100
+ aria-expanded={false}
94
101
  aria-label="Store 2"
95
102
  className="trigger"
96
103
  onClick={[MockFunction]}
@@ -105,9 +112,12 @@ exports[`renders the correct tree 1`] = `
105
112
  >
106
113
  <ul
107
114
  className="groupList"
115
+ role="listbox"
108
116
  >
109
117
  <li
118
+ aria-selected="Store 2"
110
119
  className="menuItem"
120
+ role="option"
111
121
  >
112
122
  <button
113
123
  className="root"
@@ -126,7 +136,9 @@ exports[`renders the correct tree 1`] = `
126
136
  </button>
127
137
  </li>
128
138
  <li
139
+ aria-selected="Store 2"
129
140
  className="menuItem"
141
+ role="option"
130
142
  >
131
143
  <button
132
144
  className="root"
@@ -167,9 +179,12 @@ exports[`renders the correct tree 1`] = `
167
179
  </ul>
168
180
  <ul
169
181
  className="groupList"
182
+ role="listbox"
170
183
  >
171
184
  <li
185
+ aria-selected="Store 2"
172
186
  className="menuItem"
187
+ role="option"
173
188
  >
174
189
  <button
175
190
  className="root"
@@ -188,7 +203,9 @@ exports[`renders the correct tree 1`] = `
188
203
  </button>
189
204
  </li>
190
205
  <li
206
+ aria-selected="Store 2"
191
207
  className="menuItem"
208
+ role="option"
192
209
  >
193
210
  <button
194
211
  className="root"
@@ -56,6 +56,7 @@ const CartTrigger = props => {
56
56
  <Fragment>
57
57
  <div className={triggerClassName} ref={miniCartTriggerRef}>
58
58
  <button
59
+ aria-expanded={miniCartIsOpen}
59
60
  aria-label={buttonAriaLabel}
60
61
  className={classes.trigger}
61
62
  onClick={handleTriggerClick}
@@ -66,6 +67,7 @@ const CartTrigger = props => {
66
67
  </button>
67
68
  </div>
68
69
  <button
70
+ aria-expanded={miniCartIsOpen}
69
71
  aria-label={buttonAriaLabel}
70
72
  className={classes.link}
71
73
  onClick={handleLinkClick}
@@ -33,7 +33,12 @@ const CurrencySwitcher = props => {
33
33
 
34
34
  const currencies = availableCurrencies.map(code => {
35
35
  return (
36
- <li key={code} className={classes.menuItem}>
36
+ <li
37
+ role="option"
38
+ aria-selected={currentCurrencyCode}
39
+ key={code}
40
+ className={classes.menuItem}
41
+ >
37
42
  <SwitcherItem
38
43
  active={code === currentCurrencyCode}
39
44
  onClick={handleSwitchCurrency}
@@ -58,6 +63,7 @@ const CurrencySwitcher = props => {
58
63
  aria-label={currentCurrencyCode}
59
64
  onClick={handleTriggerClick}
60
65
  ref={currencyMenuTriggerRef}
66
+ aria-expanded={currencyMenuIsOpen}
61
67
  >
62
68
  <span className={classes.label}>
63
69
  <CurrencySymbol
@@ -69,7 +75,7 @@ const CurrencySwitcher = props => {
69
75
  </span>
70
76
  </button>
71
77
  <div ref={currencyMenuRef} className={menuClassName}>
72
- <ul>{currencies}</ul>
78
+ <ul role="listbox">{currencies}</ul>
73
79
  </div>
74
80
  </div>
75
81
  );
@@ -17,6 +17,7 @@ import StoreSwitcher from './storeSwitcher';
17
17
  import CurrencySwitcher from './currencySwitcher';
18
18
  import MegaMenu from '../MegaMenu';
19
19
  import PageLoadingIndicator from '../PageLoadingIndicator';
20
+ import { useIntl } from 'react-intl';
20
21
 
21
22
  const SearchBar = React.lazy(() => import('../SearchBar'));
22
23
 
@@ -51,6 +52,9 @@ const Header = props => {
51
52
  </Suspense>
52
53
  ) : null;
53
54
 
55
+ const { formatMessage } = useIntl();
56
+ const title = formatMessage({ id: 'logo.title', defaultMessage: 'Venia' });
57
+
54
58
  return (
55
59
  <Fragment>
56
60
  <div className={classes.switchersContainer}>
@@ -69,6 +73,7 @@ const Header = props => {
69
73
  isOnline={isOnline}
70
74
  />
71
75
  <Link
76
+ aria-label={title}
72
77
  to={resourceUrl('/')}
73
78
  className={classes.logoContainer}
74
79
  data-cy="Header-logoContainer"
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import { shape, string } from 'prop-types';
3
3
 
4
4
  import { useStoreSwitcher } from '@magento/peregrine/lib/talons/Header/useStoreSwitcher';
5
+ import { availableRoutes } from '@magento/venia-ui/lib/components/Routes/routes';
5
6
 
6
7
  import { useStyle } from '../../classify';
7
8
  import defaultClasses from './storeSwitcher.module.css';
@@ -19,7 +20,7 @@ const StoreSwitcher = props => {
19
20
  storeMenuTriggerRef,
20
21
  storeMenuIsOpen,
21
22
  handleTriggerClick
22
- } = useStoreSwitcher();
23
+ } = useStoreSwitcher({ availableRoutes });
23
24
 
24
25
  const classes = useStyle(defaultClasses, props.classes);
25
26
  const menuClassName = storeMenuIsOpen ? classes.menu_open : classes.menu;
@@ -33,7 +34,7 @@ const StoreSwitcher = props => {
33
34
 
34
35
  storeGroups.forEach((group, key) => {
35
36
  const stores = [];
36
- group.forEach(({ storeGroupName, storeName, isCurrent, code }) => {
37
+ group.forEach(({ storeGroupName, storeName, isCurrent, storeCode }) => {
37
38
  let label;
38
39
  if (hasOnlyOneGroup) {
39
40
  label = `${storeName}`;
@@ -42,14 +43,16 @@ const StoreSwitcher = props => {
42
43
  }
43
44
  stores.push(
44
45
  <li
45
- key={code}
46
+ aria-selected={currentStoreName}
47
+ role="option"
48
+ key={storeCode}
46
49
  className={classes.menuItem}
47
50
  data-cy="StoreSwitcher-view"
48
51
  >
49
52
  <SwitcherItem
50
53
  active={isCurrent}
51
54
  onClick={handleSwitchStore}
52
- option={code}
55
+ option={storeCode}
53
56
  >
54
57
  {label}
55
58
  </SwitcherItem>
@@ -59,6 +62,7 @@ const StoreSwitcher = props => {
59
62
 
60
63
  groups.push(
61
64
  <ul
65
+ role="listbox"
62
66
  className={classes.groupList}
63
67
  key={key}
64
68
  data-cy="StoreSwitcher-group"
@@ -84,6 +88,7 @@ const StoreSwitcher = props => {
84
88
  onClick={handleTriggerClick}
85
89
  ref={storeMenuTriggerRef}
86
90
  data-cy="StoreSwitcher-trigger"
91
+ aria-expanded={storeMenuIsOpen}
87
92
  >
88
93
  {triggerLabel}
89
94
  </button>
@@ -23,7 +23,6 @@ const Logo = props => {
23
23
 
24
24
  return (
25
25
  <Image
26
- alt={title}
27
26
  classes={{ image: classes.logo }}
28
27
  height={height}
29
28
  src={logo}
@@ -33,6 +33,7 @@ const MiniCart = React.forwardRef((props, ref) => {
33
33
  useScrollLock(isOpen);
34
34
 
35
35
  const talonProps = useMiniCart({
36
+ isOpen,
36
37
  setIsOpen,
37
38
  operations
38
39
  });
@@ -5,7 +5,9 @@ exports[`should render error message if token is falsy 1`] = `
5
5
  <mock-StoreTitle>
6
6
  Reset Password
7
7
  </mock-StoreTitle>
8
- <h1>
8
+ <h1
9
+ aria-live="polite"
10
+ >
9
11
  <mock-FormattedMessage
10
12
  defaultMessage="Reset Password"
11
13
  id="resetPassword.header"
@@ -27,7 +29,9 @@ exports[`should render formErrors 1`] = `
27
29
  <mock-StoreTitle>
28
30
  Reset Password
29
31
  </mock-StoreTitle>
30
- <h1>
32
+ <h1
33
+ aria-live="polite"
34
+ >
31
35
  <mock-FormattedMessage
32
36
  defaultMessage="Reset Password"
33
37
  id="resetPassword.header"
@@ -174,7 +178,9 @@ exports[`should render properly 1`] = `
174
178
  <mock-StoreTitle>
175
179
  Reset Password
176
180
  </mock-StoreTitle>
177
- <h1>
181
+ <h1
182
+ aria-live="polite"
183
+ >
178
184
  <mock-FormattedMessage
179
185
  defaultMessage="Reset Password"
180
186
  id="resetPassword.header"
@@ -321,7 +327,9 @@ exports[`should render success message if hasCompleted is true 1`] = `
321
327
  <mock-StoreTitle>
322
328
  Reset Password
323
329
  </mock-StoreTitle>
324
- <h1>
330
+ <h1
331
+ aria-live="polite"
332
+ >
325
333
  <mock-FormattedMessage
326
334
  defaultMessage="Reset Password"
327
335
  id="resetPassword.header"
@@ -113,7 +113,7 @@ const ResetPassword = props => {
113
113
  defaultMessage: 'Reset Password'
114
114
  })}
115
115
  </StoreTitle>
116
- <h1 className={classes.header}>
116
+ <h1 aria-live="polite" className={classes.header}>
117
117
  <FormattedMessage
118
118
  id="resetPassword.header"
119
119
  defaultMessage="Reset Password"
@@ -7,6 +7,7 @@ exports[`renders correctly with data 1`] = `
7
7
  >
8
8
  Title
9
9
  <h1
10
+ aria-live="polite"
10
11
  className="heading"
11
12
  >
12
13
  Order History
@@ -207,6 +208,7 @@ exports[`renders correctly without data 1`] = `
207
208
  >
208
209
  Title
209
210
  <h1
211
+ aria-live="polite"
210
212
  className="heading"
211
213
  >
212
214
  Order History
@@ -383,6 +385,7 @@ exports[`renders invalid order id message if order id is wrong 1`] = `
383
385
  >
384
386
  Title
385
387
  <h1
388
+ aria-live="polite"
386
389
  className="heading"
387
390
  >
388
391
  Order History
@@ -570,6 +573,7 @@ exports[`renders loading indicator 1`] = `
570
573
  >
571
574
  Title
572
575
  <h1
576
+ aria-live="polite"
573
577
  className="heading"
574
578
  >
575
579
  Order History
@@ -780,6 +784,7 @@ exports[`renders no orders message is orders is empty 1`] = `
780
784
  >
781
785
  Title
782
786
  <h1
787
+ aria-live="polite"
783
788
  className="heading"
784
789
  >
785
790
  Order History
@@ -160,7 +160,9 @@ const OrderHistoryPage = props => {
160
160
  <OrderHistoryContextProvider>
161
161
  <div className={classes.root}>
162
162
  <StoreTitle>{PAGE_TITLE}</StoreTitle>
163
- <h1 className={classes.heading}>{PAGE_TITLE}</h1>
163
+ <h1 aria-live="polite" className={classes.heading}>
164
+ {PAGE_TITLE}
165
+ </h1>
164
166
  <div className={classes.filterRow}>
165
167
  <span className={classes.pageInfo}>{pageInfoLabel}</span>
166
168
  <Form className={classes.search} onSubmit={handleSubmit}>
@@ -0,0 +1,21 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`#PageLoadingIndicator displays correctly depend on the position type when absolute is false and page is loading 1`] = `
4
+ <div
5
+ className="root_relative"
6
+ >
7
+ <div
8
+ className="indicator_undefined"
9
+ />
10
+ </div>
11
+ `;
12
+
13
+ exports[`#PageLoadingIndicator displays correctly depend on the position type when absolute is true and page is not loading 1`] = `
14
+ <div
15
+ className="root_absolute"
16
+ >
17
+ <div
18
+ className="indicator_undefined"
19
+ />
20
+ </div>
21
+ `;
@@ -38,8 +38,8 @@ describe('#PageLoadingIndicator does not render', () => {
38
38
  });
39
39
  });
40
40
 
41
- describe('#PageLoadingIndicator displays', () => {
42
- test('when page is loading', async () => {
41
+ describe('#PageLoadingIndicator displays correctly depend on the position type', () => {
42
+ test('when absolute is false and page is loading', async () => {
43
43
  givenPageLoading();
44
44
  let tree;
45
45
 
@@ -47,7 +47,7 @@ describe('#PageLoadingIndicator displays', () => {
47
47
  tree = create(<PageLoadingIndicator />);
48
48
  });
49
49
 
50
- expect(tree.toJSON()).not.toBeNull();
50
+ expect(tree.toJSON()).toMatchSnapshot();
51
51
  });
52
52
 
53
53
  test('when absolute is true and page is not loading', async () => {
@@ -58,6 +58,6 @@ describe('#PageLoadingIndicator displays', () => {
58
58
  tree = create(<PageLoadingIndicator absolute />);
59
59
  });
60
60
 
61
- expect(tree.toJSON()).not.toBeNull();
61
+ expect(tree.toJSON()).toMatchSnapshot();
62
62
  });
63
63
  });
@@ -14,7 +14,9 @@ const PageLoadingIndicator = props => {
14
14
  }
15
15
 
16
16
  return (
17
- <div className={absolute ? classes.root_absolute : classes.root}>
17
+ <div
18
+ className={absolute ? classes.root_absolute : classes.root_relative}
19
+ >
18
20
  <div className={classes[`indicator_${loadingState}`]} />
19
21
  </div>
20
22
  );
@@ -27,7 +29,9 @@ PageLoadingIndicator.defaultProps = {
27
29
 
28
30
  PageLoadingIndicator.propTypes = {
29
31
  classes: shape({
30
- root: string
32
+ root: string,
33
+ root_absolute: string,
34
+ root_relative: string
31
35
  }),
32
36
  absolute: bool
33
37
  };
@@ -1,11 +1,16 @@
1
1
  .root {
2
2
  composes: bg-gray-100 from global;
3
3
  composes: h-[2px] from global;
4
- composes: relative from global;
5
4
  composes: overflow-hidden from global;
6
5
  composes: w-full from global;
7
6
  }
8
7
 
8
+ .root_relative {
9
+ composes: root;
10
+
11
+ composes: relative from global;
12
+ }
13
+
9
14
  .root_absolute {
10
15
  composes: root;
11
16
 
@@ -18,6 +18,7 @@ exports[`it disables the add to cart button when the talon indicates 1`] = `
18
18
  className="title"
19
19
  >
20
20
  <h1
21
+ aria-live="polite"
21
22
  className="productName"
22
23
  >
23
24
  Flux Capacitor
@@ -193,6 +194,7 @@ exports[`it does not render options if the product is not a ConfigurableProduct
193
194
  className="title"
194
195
  >
195
196
  <h1
197
+ aria-live="polite"
196
198
  className="productName"
197
199
  >
198
200
  Flux Capacitor
@@ -338,6 +340,7 @@ exports[`it renders an error for an invalid cart 1`] = `
338
340
  className="title"
339
341
  >
340
342
  <h1
343
+ aria-live="polite"
341
344
  className="productName"
342
345
  >
343
346
  Flux Capacitor
@@ -517,6 +520,7 @@ exports[`it renders an error for an invalid user token when adding to cart 1`] =
517
520
  className="title"
518
521
  >
519
522
  <h1
523
+ aria-live="polite"
520
524
  className="productName"
521
525
  >
522
526
  Flux Capacitor
@@ -701,6 +705,7 @@ Array [
701
705
  className="title"
702
706
  >
703
707
  <h1
708
+ aria-live="polite"
704
709
  className="productName"
705
710
  >
706
711
  Flux Capacitor
@@ -877,6 +882,7 @@ exports[`it renders correctly 1`] = `
877
882
  className="title"
878
883
  >
879
884
  <h1
885
+ aria-live="polite"
880
886
  className="productName"
881
887
  >
882
888
  Flux Capacitor
@@ -1052,6 +1058,7 @@ exports[`it renders field level errors for quantity - message 1 1`] = `
1052
1058
  className="title"
1053
1059
  >
1054
1060
  <h1
1061
+ aria-live="polite"
1055
1062
  className="productName"
1056
1063
  >
1057
1064
  Flux Capacitor
@@ -1227,6 +1234,7 @@ exports[`it renders field level errors for quantity - message 2 1`] = `
1227
1234
  className="title"
1228
1235
  >
1229
1236
  <h1
1237
+ aria-live="polite"
1230
1238
  className="productName"
1231
1239
  >
1232
1240
  Flux Capacitor
@@ -1402,6 +1410,7 @@ exports[`it renders field level errors for quantity - message 3 1`] = `
1402
1410
  className="title"
1403
1411
  >
1404
1412
  <h1
1413
+ aria-live="polite"
1405
1414
  className="productName"
1406
1415
  >
1407
1416
  Flux Capacitor
@@ -1577,6 +1586,7 @@ exports[`it renders form level errors 1`] = `
1577
1586
  className="title"
1578
1587
  >
1579
1588
  <h1
1589
+ aria-live="polite"
1580
1590
  className="productName"
1581
1591
  >
1582
1592
  Flux Capacitor
@@ -1756,6 +1766,7 @@ exports[`it renders message with unsupported product type 1`] = `
1756
1766
  className="title"
1757
1767
  >
1758
1768
  <h1
1769
+ aria-live="polite"
1759
1770
  className="productName"
1760
1771
  >
1761
1772
  Flux Capacitor
@@ -1944,6 +1955,7 @@ exports[`out of stock disabled CTA button is rendered if out of stock 1`] = `
1944
1955
  className="title"
1945
1956
  >
1946
1957
  <h1
1958
+ aria-live="polite"
1947
1959
  className="productName"
1948
1960
  >
1949
1961
  Flux Capacitor
@@ -2089,6 +2101,7 @@ exports[`renders a WishlistButton with props 1`] = `
2089
2101
  className="title"
2090
2102
  >
2091
2103
  <h1
2104
+ aria-live="polite"
2092
2105
  className="productName"
2093
2106
  >
2094
2107
  Flux Capacitor
@@ -229,6 +229,7 @@ const ProductFullDetail = props => {
229
229
  </section>
230
230
  <section className={classes.title}>
231
231
  <h1
232
+ aria-live="polite"
232
233
  className={classes.productName}
233
234
  data-cy="ProductFullDetail-productName"
234
235
  >
@@ -6,6 +6,7 @@ exports[`renders correctly when there are existing saved payments 1`] = `
6
6
  >
7
7
  Title
8
8
  <h1
9
+ aria-live="polite"
9
10
  className="heading"
10
11
  >
11
12
  Saved Payments
@@ -37,6 +38,7 @@ exports[`renders correctly when there are no existing saved payments 1`] = `
37
38
  >
38
39
  Title
39
40
  <h1
41
+ aria-live="polite"
40
42
  className="heading"
41
43
  >
42
44
  Saved Payments
@@ -55,7 +55,9 @@ const SavedPaymentsPage = props => {
55
55
  return (
56
56
  <div className={classes.root}>
57
57
  <StoreTitle>{title}</StoreTitle>
58
- <h1 className={classes.heading}>{title}</h1>
58
+ <h1 aria-live="polite" className={classes.heading}>
59
+ {title}
60
+ </h1>
59
61
  <div className={classes.content}>{savedPaymentElements}</div>
60
62
  <div className={classes.noPayments}>{noSavedPayments}</div>
61
63
  </div>
@@ -1,6 +1,9 @@
1
1
  import React from 'react';
2
+ import { InMemoryCache } from '@apollo/client';
3
+ import { MockedProvider } from '@apollo/client/testing';
2
4
  import { Form } from 'informed';
3
5
  import { createTestInstance } from '@magento/peregrine';
6
+ import typePolicies from '@magento/peregrine/lib/Apollo/policies';
4
7
 
5
8
  import Autocomplete from '../autocomplete';
6
9
  import { IntlProvider } from 'react-intl';
@@ -8,13 +11,23 @@ import { IntlProvider } from 'react-intl';
8
11
  jest.mock('../../../classify');
9
12
  jest.mock('../suggestions', () => () => null);
10
13
 
14
+ jest.mock('@magento/peregrine/lib/context/eventing', () => ({
15
+ useEventingContext: jest.fn().mockReturnValue([{}, { dispatch: jest.fn() }])
16
+ }));
17
+
18
+ const cache = new InMemoryCache({
19
+ typePolicies
20
+ });
21
+
11
22
  test('renders correctly', () => {
12
23
  const { root } = createTestInstance(
13
- <IntlProvider locale="en-US">
14
- <Form>
15
- <Autocomplete visible={false} />
16
- </Form>
17
- </IntlProvider>
24
+ <MockedProvider addTypename={true} cache={cache}>
25
+ <IntlProvider locale="en-US">
26
+ <Form>
27
+ <Autocomplete visible={false} />
28
+ </Form>
29
+ </IntlProvider>
30
+ </MockedProvider>
18
31
  );
19
32
 
20
33
  expect(root.findByProps({ className: 'root_hidden' })).toBeTruthy();
@@ -24,11 +37,13 @@ test('renders correctly', () => {
24
37
 
25
38
  test('renders correctly when visible', () => {
26
39
  const { root } = createTestInstance(
27
- <IntlProvider locale="en-US">
28
- <Form>
29
- <Autocomplete visible={true} />
30
- </Form>
31
- </IntlProvider>
40
+ <MockedProvider addTypename={true} cache={cache}>
41
+ <IntlProvider locale="en-US">
42
+ <Form>
43
+ <Autocomplete visible={true} />
44
+ </Form>
45
+ </IntlProvider>
46
+ </MockedProvider>
32
47
  );
33
48
 
34
49
  expect(root.findByProps({ className: 'root_visible' })).toBeTruthy();
@@ -7,6 +7,9 @@ jest.mock('react-router-dom', () => ({
7
7
  Link: ({ children }) => children
8
8
  }));
9
9
  jest.mock('@magento/peregrine/lib/util/makeUrl');
10
+ jest.mock('@magento/peregrine/lib/context/eventing', () => ({
11
+ useEventingContext: jest.fn().mockReturnValue([{}, { dispatch: jest.fn() }])
12
+ }));
10
13
 
11
14
  const defaultProps = {
12
15
  handleOnProductOpen: jest.fn(),
@@ -26,6 +26,7 @@ const GET_AUTOCOMPLETE_RESULTS = gql`
26
26
  items {
27
27
  id
28
28
  uid
29
+ sku
29
30
  name
30
31
  small_image {
31
32
  url
@@ -46,6 +47,9 @@ const GET_AUTOCOMPLETE_RESULTS = gql`
46
47
  currency
47
48
  value
48
49
  }
50
+ discount {
51
+ amount_off
52
+ }
49
53
  }
50
54
  }
51
55
  }