@magento/venia-ui 11.7.0-beta1 → 11.7.1-alpha11

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.
@@ -88,17 +88,42 @@ jest.mock('@magento/peregrine/lib/util/createErrorRecord', () => ({
88
88
  })
89
89
  }));
90
90
 
91
- jest.mock('@apollo/client', () => ({
92
- useMutation: jest.fn().mockImplementation(() => [
93
- jest.fn().mockImplementation(() => {
94
- return {
95
- data: {
96
- createEmptyCart: 'cartIdFromGraphQL'
97
- }
98
- };
99
- })
100
- ])
101
- }));
91
+ jest.mock('@apollo/client', () => {
92
+ const actual = jest.requireActual('@apollo/client');
93
+ return {
94
+ ...actual,
95
+ useMutation: jest.fn().mockImplementation(() => [
96
+ jest.fn().mockImplementation(() => {
97
+ return {
98
+ data: {
99
+ createEmptyCart: 'cartIdFromGraphQL'
100
+ }
101
+ };
102
+ })
103
+ ])
104
+ };
105
+ });
106
+
107
+ jest.mock('@magento/peregrine/lib/context/user', () => {
108
+ const state = { isSignedIn: false, currentUser: null };
109
+ const api = {
110
+ signOut: jest.fn(),
111
+ getUserDetails: jest.fn()
112
+ };
113
+ const useUserContext = jest.fn(() => [state, api]);
114
+
115
+ return { useUserContext };
116
+ });
117
+
118
+ jest.mock(
119
+ '@magento/peregrine/lib/hooks/useCustomerWishlistSkus/useCustomerWishlistSkus',
120
+ () => ({
121
+ useCustomerWishlistSkus: jest.fn(() => ({
122
+ customerWishlistSkus: [],
123
+ loading: false
124
+ }))
125
+ })
126
+ );
102
127
 
103
128
  jest.mock('react-router-dom', () => ({
104
129
  useHistory: jest.fn()
@@ -1,11 +1,7 @@
1
1
  import React, { Fragment } from 'react';
2
2
  import { arrayOf, node, number, oneOfType, shape, string } from 'prop-types';
3
- import {
4
- Option as InformedOption,
5
- Select as InformedSelect,
6
- useFieldState
7
- } from 'informed';
8
-
3
+ import { Option as InformedOption, Select as InformedSelect } from 'informed';
4
+ import useFieldState from '@magento/peregrine/lib/hooks/hook-wrappers/useInformedFieldStateWrapper';
9
5
  import { useStyle } from '../../classify';
10
6
  import { FieldIcons, Message } from '../Field';
11
7
  import defaultClasses from './select.module.css';
@@ -12,7 +12,10 @@ const SummaryPaymentTypes = require('./SummaryPaymentTypes');
12
12
  const RootShimmerTypes = require('./RootShimmerTypes');
13
13
 
14
14
  module.exports = veniaTargets => {
15
- const venia = new Targetables(veniaTargets);
15
+ if (!veniaTargets) {
16
+ throw new Error('veniaTargets not provided — check local-intercept.js');
17
+ }
18
+ const venia = Targetables.using(veniaTargets);
16
19
 
17
20
  venia.setSpecialFeatures(
18
21
  'cssModules',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magento/venia-ui",
3
- "version": "11.7.0-beta1",
3
+ "version": "11.7.1-alpha11",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -80,8 +80,8 @@
80
80
  "peerDependencies": {
81
81
  "@apollo/client": "~3.5.0",
82
82
  "@magento/babel-preset-peregrine": "~1.3.3",
83
- "@magento/peregrine": "15.5.1-beta1",
84
- "@magento/pwa-buildpack": "~11.5.4",
83
+ "@magento/peregrine": "15.6.2-alpha11",
84
+ "@magento/pwa-buildpack": "11.5.5-alpha11",
85
85
  "apollo-cache-persist": "~0.1.1",
86
86
  "braintree-web-drop-in": "~1.43.0",
87
87
  "graphql": "~15.5.0",