From 95fbc2e40bc484b2e11cdeaee78c1eceb33adebd Mon Sep 17 00:00:00 2001 From: glo11372 Date: Thu, 29 Aug 2024 12:25:06 +0530 Subject: [PATCH 1/4] PWA-3273:Get Minimum Password Length from configuration --- .../talons/CreateAccount/createAccount.gql.js | 12 +++++++++++- .../talons/CreateAccount/useCreateAccount.js | 18 +++++++++++++++--- .../components/CreateAccount/createAccount.js | 6 ++++-- 3 files changed, 30 insertions(+), 6 deletions(-) diff --git a/packages/peregrine/lib/talons/CreateAccount/createAccount.gql.js b/packages/peregrine/lib/talons/CreateAccount/createAccount.gql.js index 4eed9375f0..e89288142a 100644 --- a/packages/peregrine/lib/talons/CreateAccount/createAccount.gql.js +++ b/packages/peregrine/lib/talons/CreateAccount/createAccount.gql.js @@ -126,6 +126,15 @@ export const MERGE_CARTS = gql` } ${CheckoutPageFragment} `; +export const GET_STORE_CONFIG_DATA = gql` + query GetStoreConfigData { + # eslint-disable-next-line @graphql-eslint/require-id-when-available + storeConfig { + store_code + minimum_password_length + } + } +`; export default { createAccountMutation: CREATE_ACCOUNT, @@ -133,5 +142,6 @@ export default { getCartDetailsQuery: GET_CART_DETAILS, getCustomerQuery: GET_CUSTOMER, mergeCartsMutation: MERGE_CARTS, - signInMutation: SIGN_IN + signInMutation: SIGN_IN, + getStoreConfigQuery: GET_STORE_CONFIG_DATA }; diff --git a/packages/peregrine/lib/talons/CreateAccount/useCreateAccount.js b/packages/peregrine/lib/talons/CreateAccount/useCreateAccount.js index 5bfca3e6bc..b7c9219775 100644 --- a/packages/peregrine/lib/talons/CreateAccount/useCreateAccount.js +++ b/packages/peregrine/lib/talons/CreateAccount/useCreateAccount.js @@ -1,5 +1,5 @@ import { useCallback, useMemo, useState } from 'react'; -import { useApolloClient, useMutation } from '@apollo/client'; +import { useApolloClient, useMutation, useQuery } from '@apollo/client'; import mergeOperations from '../../util/shallowMerge'; import { useUserContext } from '../../context/user'; @@ -37,7 +37,8 @@ export const useCreateAccount = props => { getCartDetailsQuery, getCustomerQuery, mergeCartsMutation, - signInMutation + signInMutation, + getStoreConfigQuery } = operations; const apolloClient = useApolloClient(); const [isSubmitting, setIsSubmitting] = useState(false); @@ -69,6 +70,15 @@ export const useCreateAccount = props => { fetchPolicy: 'no-cache' }); + const { data: storeConfigData } = useQuery(getStoreConfigQuery, { + fetchPolicy: 'cache-and-network', + nextFetchPolicy: 'cache-first' + }); + + const { minimum_password_length } = storeConfigData + ? storeConfigData.storeConfig + : null; + const fetchUserDetails = useAwaitQuery(getCustomerQuery); const fetchCartDetails = useAwaitQuery(getCartDetailsQuery); @@ -225,7 +235,8 @@ export const useCreateAccount = props => { handleCancelKeyPress, initialValues: sanitizedInitialValues, isDisabled: isSubmitting || isGettingDetails || recaptchaLoading, - recaptchaWidgetProps + recaptchaWidgetProps, + minimum_password_length }; }; @@ -239,6 +250,7 @@ export const useCreateAccount = props => { * * @property {GraphQLAST} customerQuery query to fetch customer details * @property {GraphQLAST} getCartDetailsQuery query to get cart details + * @property {GraphQLAST} getStoreConfigQuery query to get store config */ /** diff --git a/packages/venia-ui/lib/components/CreateAccount/createAccount.js b/packages/venia-ui/lib/components/CreateAccount/createAccount.js index 31fa9a17a1..990483db3c 100644 --- a/packages/venia-ui/lib/components/CreateAccount/createAccount.js +++ b/packages/venia-ui/lib/components/CreateAccount/createAccount.js @@ -35,8 +35,10 @@ const CreateAccount = props => { handleCancelKeyPress, isDisabled, initialValues, - recaptchaWidgetProps + recaptchaWidgetProps, + minimum_password_length } = talonProps; + const { formatMessage } = useIntl(); const classes = useStyle(defaultClasses, props.classes); @@ -164,7 +166,7 @@ const CreateAccount = props => { })} validate={combine([ isRequired, - [hasLengthAtLeast, 8], + [hasLengthAtLeast, minimum_password_length], validatePassword ])} validateOnBlur From 89f7a71f5ee20c6d72609aa30894a90d2c8021af Mon Sep 17 00:00:00 2001 From: glo11372 Date: Thu, 29 Aug 2024 15:11:30 +0530 Subject: [PATCH 2/4] PWA-3273 adding updated testcases --- .../useCreateAccount.spec.js.snap | 1 + .../__tests__/useCreateAccount.spec.js | 29 +++++++++++++++++-- .../__tests__/createAccount.spec.js | 6 +++- 3 files changed, 33 insertions(+), 3 deletions(-) diff --git a/packages/peregrine/lib/talons/CreateAccount/__tests__/__snapshots__/useCreateAccount.spec.js.snap b/packages/peregrine/lib/talons/CreateAccount/__tests__/__snapshots__/useCreateAccount.spec.js.snap index 47c2adbc08..6ebf851ed9 100644 --- a/packages/peregrine/lib/talons/CreateAccount/__tests__/__snapshots__/useCreateAccount.spec.js.snap +++ b/packages/peregrine/lib/talons/CreateAccount/__tests__/__snapshots__/useCreateAccount.spec.js.snap @@ -37,6 +37,7 @@ Object { "userName": "gooseton", }, "isDisabled": false, + "minimum_password_length": 8, "recaptchaWidgetProps": Object {}, } `; diff --git a/packages/peregrine/lib/talons/CreateAccount/__tests__/useCreateAccount.spec.js b/packages/peregrine/lib/talons/CreateAccount/__tests__/useCreateAccount.spec.js index 01dbabe7a7..fc70728da0 100644 --- a/packages/peregrine/lib/talons/CreateAccount/__tests__/useCreateAccount.spec.js +++ b/packages/peregrine/lib/talons/CreateAccount/__tests__/useCreateAccount.spec.js @@ -1,5 +1,5 @@ import React from 'react'; -import { useMutation, useApolloClient } from '@apollo/client'; +import { useMutation, useQuery, useApolloClient } from '@apollo/client'; import { act } from 'react-test-renderer'; import { useCartContext } from '../../../context/cart'; @@ -16,9 +16,17 @@ jest.mock('@apollo/client', () => { return { ...apolloClient, useMutation: jest.fn().mockReturnValue([jest.fn()]), - useApolloClient: jest.fn() + useApolloClient: jest.fn(), + useQuery: jest.fn() }; }); +// jest.mock('@apollo/client', () => { +// const apolloClient = jest.requireActual('@apollo/client'); +// return { +// ...apolloClient, +// useQuery: jest.fn() +// }; +// }); jest.mock('../../../../lib/hooks/useAwaitQuery', () => ({ useAwaitQuery: jest.fn().mockReturnValue(jest.fn()) })); @@ -91,7 +99,16 @@ const createAccountMutation = 'createAccountMutation'; const createCartMutation = 'createCartMutation'; const signInMutation = 'signInMutation'; const mergeCartsMutation = 'mergeCartsMutation'; +const getStoreConfigQuery = 'getStoreConfigQuery'; +const getStoreConfigQueryFn = jest.fn().mockReturnValue({ + data: { + storeConfig: { + store_code: 'default', + minimum_password_length: 8 + } + } +}); const customerQueryFn = jest.fn(); const getCartDetailsQueryFn = jest.fn(); const createAccountMutationFn = jest @@ -120,6 +137,7 @@ const defaultProps = { getCartDetailsQuery, getCustomerQuery, mergeCartsMutation, + getStoreConfigQuery, signInMutation }, initialValues: { @@ -143,6 +161,13 @@ const defaultFormValues = { }; beforeAll(() => { + useQuery.mockImplementation(query => { + if (query === getStoreConfigQuery) { + return getStoreConfigQueryFn(); + } else { + return [jest.fn(), {}]; + } + }); useAwaitQuery.mockImplementation(query => { if (query === getCustomerQuery) { return customerQueryFn(); diff --git a/packages/venia-ui/lib/components/CreateAccount/__tests__/createAccount.spec.js b/packages/venia-ui/lib/components/CreateAccount/__tests__/createAccount.spec.js index ad84b877d1..c174a60ae3 100644 --- a/packages/venia-ui/lib/components/CreateAccount/__tests__/createAccount.spec.js +++ b/packages/venia-ui/lib/components/CreateAccount/__tests__/createAccount.spec.js @@ -14,7 +14,11 @@ jest.mock('@apollo/client', () => ({ } ]), useQuery: jest.fn().mockImplementation(() => ({ - data: {}, + data: { + storeConfig: { + minimum_password_length: 8 // or whatever value is expected + } + }, loading: false, error: null })) From 8fa59722c508383cf0cf97d403d12a6524a2eb3d Mon Sep 17 00:00:00 2001 From: glo11372 Date: Mon, 2 Sep 2024 13:24:15 +0530 Subject: [PATCH 3/4] correcting minimum password code --- .../lib/talons/CreateAccount/useCreateAccount.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/peregrine/lib/talons/CreateAccount/useCreateAccount.js b/packages/peregrine/lib/talons/CreateAccount/useCreateAccount.js index b7c9219775..9559911447 100644 --- a/packages/peregrine/lib/talons/CreateAccount/useCreateAccount.js +++ b/packages/peregrine/lib/talons/CreateAccount/useCreateAccount.js @@ -75,9 +75,11 @@ export const useCreateAccount = props => { nextFetchPolicy: 'cache-first' }); - const { minimum_password_length } = storeConfigData - ? storeConfigData.storeConfig - : null; + const minimum_password_length = useMemo(() => { + if (storeConfigData) { + return storeConfigData.storeConfig.minimum_password_length; + } + }, [storeConfigData]); const fetchUserDetails = useAwaitQuery(getCustomerQuery); const fetchCartDetails = useAwaitQuery(getCartDetailsQuery); From b8fc6b4b354fb6c07185642502d00901e4d0fdd7 Mon Sep 17 00:00:00 2001 From: glo11372 <143005735+glo11372@users.noreply.github.com> Date: Thu, 19 Sep 2024 15:41:51 +0530 Subject: [PATCH 4/4] PWA-3341: Customet login (#4322) --- .../lib/store/actions/user/asyncActions.js | 8 +- .../useCreateAccount.spec.js.snap | 55 + .../__tests__/useCreateAccount.spec.js | 486 +- .../createAccount.gql.js | 5 +- .../OrderConfirmationPage/useCreateAccount.js | 34 +- .../useCreateAccount.spec.js.snap | 2 +- .../__tests__/useCreateAccount.spec.js | 18 +- .../talons/CreateAccount/createAccount.gql.js | 2 +- .../talons/CreateAccount/useCreateAccount.js | 25 +- .../__snapshots__/useSignIn.spec.js.snap | 75 + .../talons/SignIn/__tests__/useSignIn.spec.js | 7491 +---------------- .../peregrine/lib/talons/SignIn/signIn.gql.js | 5 +- .../peregrine/lib/talons/SignIn/useSignIn.js | 27 +- .../OrderConfirmationPage/createAccount.js | 5 +- .../components/CreateAccount/createAccount.js | 6 +- 15 files changed, 683 insertions(+), 7561 deletions(-) create mode 100644 packages/peregrine/lib/talons/SignIn/__tests__/__snapshots__/useSignIn.spec.js.snap diff --git a/packages/peregrine/lib/store/actions/user/asyncActions.js b/packages/peregrine/lib/store/actions/user/asyncActions.js index d3a2ccdb25..353187d66c 100755 --- a/packages/peregrine/lib/store/actions/user/asyncActions.js +++ b/packages/peregrine/lib/store/actions/user/asyncActions.js @@ -63,13 +63,17 @@ export const resetPassword = ({ email }) => dispatch(actions.resetPassword.receive()); }; -export const setToken = (token, customer_token_lifetime = 3600) => +export const setToken = (token, customerAccessTokenLifetime = 1) => async function thunk(...args) { const [dispatch] = args; // Store token in local storage. // TODO: Get correct token expire time from API - storage.setItem('signin_token', token, customer_token_lifetime); + storage.setItem( + 'signin_token', + token, + customerAccessTokenLifetime * 3600 + ); // Persist in store dispatch(actions.setToken(token)); diff --git a/packages/peregrine/lib/talons/CheckoutPage/OrderConfirmationPage/__tests__/__snapshots__/useCreateAccount.spec.js.snap b/packages/peregrine/lib/talons/CheckoutPage/OrderConfirmationPage/__tests__/__snapshots__/useCreateAccount.spec.js.snap index 59d4c64a3f..f64b802037 100644 --- a/packages/peregrine/lib/talons/CheckoutPage/OrderConfirmationPage/__tests__/__snapshots__/useCreateAccount.spec.js.snap +++ b/packages/peregrine/lib/talons/CheckoutPage/OrderConfirmationPage/__tests__/__snapshots__/useCreateAccount.spec.js.snap @@ -1,5 +1,12 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`errros should render properly 1`] = ` +Map { + "createAccountQuery" => "Create Account Mutation Error", + "signInMutation" => "Sign In Mutation Error", +} +`; + exports[`handle submit event creates an account, dispatches event, signs in, and generates a new cart 1`] = ` Object { "payload": Object { @@ -12,6 +19,30 @@ Object { } `; +exports[`handle submit event should dispatch create account event 1`] = ` +Object { + "payload": Object { + "email": "bender@planet.express", + "firstName": "Bender", + "isSubscribed": false, + "lastName": "Rodriguez", + }, + "type": "USER_CREATE_ACCOUNT", +} +`; + +exports[`handleSubmit should dispatch create account event 1`] = ` +Object { + "payload": Object { + "email": "bender@planet.express", + "firstName": "Bender", + "isSubscribed": false, + "lastName": "Rodriguez", + }, + "type": "USER_CREATE_ACCOUNT", +} +`; + exports[`returns the correct shape 1`] = ` Object { "errors": Map { @@ -29,6 +60,7 @@ Object { }, "isDisabled": false, "recaptchaWidgetProps": Object {}, + "minimumPasswordLength":8 } `; @@ -49,5 +81,28 @@ Object { }, "isDisabled": false, "recaptchaWidgetProps": Object {}, + minimumPasswordLength:8 +} +`; + +exports[`should return properly 1`] = ` +Object { + "errors": Map { + "createAccountQuery" => null, + "signInMutation" => null, + }, + "handleEnterKeyPress": [Function], + "handleSubmit": [Function], + "initialValues": Object { + "customer": Object { + "email": "gooston@goosemail.com", + "firstname": "Gooseton", + "lastname": "Jr", + }, + "userName": "gooseton", + }, + "isDisabled": false, + "minimumPasswordLength": 8, + "recaptchaWidgetProps": Object {}, } `; diff --git a/packages/peregrine/lib/talons/CheckoutPage/OrderConfirmationPage/__tests__/useCreateAccount.spec.js b/packages/peregrine/lib/talons/CheckoutPage/OrderConfirmationPage/__tests__/useCreateAccount.spec.js index f84bbc00a8..5389309839 100644 --- a/packages/peregrine/lib/talons/CheckoutPage/OrderConfirmationPage/__tests__/useCreateAccount.spec.js +++ b/packages/peregrine/lib/talons/CheckoutPage/OrderConfirmationPage/__tests__/useCreateAccount.spec.js @@ -1,248 +1,338 @@ import React from 'react'; -import { MockedProvider } from '@apollo/client/testing'; -import { renderHook, act } from '@testing-library/react-hooks'; +import { useMutation, useQuery, useApolloClient } from '@apollo/client'; +import { act } from 'react-test-renderer'; -import { useUserContext } from '../../../../context/user'; -import { useCartContext } from '../../../../context/cart'; +import { useCartContext } from '../../../../../lib/context/cart'; +import { useUserContext } from '../../../../../lib/context/user'; import { useAwaitQuery } from '../../../../hooks/useAwaitQuery'; - +import createTestInstance from '../../../../util/createTestInstance'; import { useCreateAccount } from '../useCreateAccount'; -import defaultOperations from '../createAccount.gql'; import { useEventingContext } from '../../../../context/eventing'; +jest.mock('@apollo/client', () => { + const apolloClient = jest.requireActual('@apollo/client'); + + return { + ...apolloClient, + useMutation: jest.fn().mockReturnValue([jest.fn()]), + useApolloClient: jest.fn(), + useQuery: jest.fn() + }; +}); +jest.mock('../../../../hooks/useAwaitQuery', () => ({ + useAwaitQuery: jest.fn().mockReturnValue(jest.fn()) +})); +jest.mock('../../../../../lib/context/user', () => ({ + useUserContext: jest + .fn() + .mockReturnValue([ + { isGettingDetails: false }, + { getUserDetails: jest.fn(), setToken: jest.fn() } + ]) +})); +jest.mock('../../../../../lib/context/cart', () => ({ + useCartContext: jest.fn().mockReturnValue([ + { cartId: '1234' }, + { + createCart: jest.fn(), + removeCart: jest.fn(), + getCartDetails: jest.fn() + } + ]) +})); +jest.mock('../../../../store/actions/cart', () => { + const cartActions = jest.requireActual( + '../../../store/actions/cart/actions' + ); + const retrieveCartId = jest.fn().mockReturnValue('12345'); -const createAccountVariables = { - email: 'bender@planet.express', - firstname: 'Bender', - lastname: 'Rodriguez', - password: '123456', - is_subscribed: false -}; -const createAccount = jest.fn(); -const createAccountMock = { - request: { - query: defaultOperations.createAccountMutation, - variables: createAccountVariables - }, - result: () => { - createAccount(); + return Object.assign(cartActions, { + retrieveCartId + }); +}); - return { - data: { - id: 'user_id' - } - }; - } -}; +jest.mock('../../../../hooks/useGoogleReCaptcha', () => ({ + useGoogleReCaptcha: jest.fn().mockReturnValue({ + recaptchaLoading: false, + generateReCaptchaData: jest.fn(() => {}), + recaptchaWidgetProps: {} + }) +})); -const createCartMock = { - request: { - query: defaultOperations.createCartMutation - }, - result: { - data: { - cartId: '1234' - } - } +jest.mock('@magento/peregrine/lib/context/eventing', () => ({ + useEventingContext: jest.fn().mockReturnValue([{}, { dispatch: jest.fn() }]) +})); + +const Component = props => { + const talonProps = useCreateAccount(props); + + return ; }; -const getCartDetailsMock = { - request: { - query: defaultOperations.getCartDetailsQuery, - variables: { - cartId: '1234' - } - }, - result: { - data: { - id: '1234' - } - } +const getTalonProps = props => { + const tree = createTestInstance(); + const { root } = tree; + const { talonProps } = root.findByType('i').props; + + const update = newProps => { + act(() => { + tree.update(); + }); + + return root.findByType('i').props.talonProps; + }; + + return { talonProps, tree, update }; }; -const getCustomerMock = { - request: { - query: defaultOperations.getCustomerQuery - }, - result: { - data: { - customer: { - id: '123' - } +const getCustomerQuery = 'getCustomerQuery'; +const getCartDetailsQuery = 'getCartDetailsQuery'; +const createAccountMutation = 'createAccountMutation'; +const createCartMutation = 'createCartMutation'; +const signInMutation = 'signInMutation'; +const mergeCartsMutation = 'mergeCartsMutation'; +const getStoreConfigQuery = 'getStoreConfigQuery'; + +const getStoreConfigQueryFn = jest.fn().mockReturnValue({ + data: { + storeConfig: { + store_code: 'default', + minimum_password_length: 8, + customer_access_token_lifetime: 1 } } -}; - -const signInVariables = { - email: 'bender@planet.express', - password: '123456' -}; -const authToken = 'auth-token-123'; -const customerTokenLifetime = 3600; -const signInMock = { - request: { - query: defaultOperations.signInMutation, - variables: signInVariables - }, - result: { +}); +const customerQueryFn = jest.fn(); +const getCartDetailsQueryFn = jest.fn(); +const createAccountMutationFn = jest + .fn() + .mockReturnValue([jest.fn(), { error: null }]); +const createCartMutationFn = jest.fn().mockReturnValue([jest.fn()]); +const signInMutationFn = jest.fn().mockReturnValue([ + jest.fn().mockReturnValue({ data: { generateCustomerToken: { - token: authToken, - customer_token_lifetime: customerTokenLifetime + token: 'customer token' } } - } + }), + { error: null } +]); +const mergeCartsMutationFn = jest.fn().mockReturnValue([jest.fn()]); +const clearCacheData = jest.fn(); +const client = { clearCacheData }; + +const defaultProps = { + operations: { + createAccountMutation, + createCartMutation, + getCartDetailsQuery, + getCustomerQuery, + mergeCartsMutation, + getStoreConfigQuery, + signInMutation + }, + initialValues: { + email: 'gooston@goosemail.com', + firstName: 'Gooseton', + lastName: 'Jr', + userName: 'gooseton' + }, + onSubmit: jest.fn(), + onCancel: jest.fn() }; -jest.mock('../../../../context/user'); -const mockGetUserDetails = jest.fn(); -const mockSetToken = jest.fn(); -useUserContext.mockImplementation(() => { - const data = { - isGettingDetails: false - }; +const defaultFormValues = { + customer: { + email: 'bender@planet.express', + firstname: 'Bender', + lastname: 'Rodriguez' + }, + password: '123456', + subscribe: false +}; +beforeAll(() => { + useQuery.mockImplementation(query => { + if (query === getStoreConfigQuery) { + return getStoreConfigQueryFn(); + } else { + return [jest.fn(), {}]; + } + }); + useAwaitQuery.mockImplementation(query => { + if (query === getCustomerQuery) { + return customerQueryFn(); + } else if (query === getCartDetailsQuery) { + return getCartDetailsQueryFn(); + } else { + return jest.fn(); + } + }); - const api = { - getUserDetails: mockGetUserDetails, - setToken: mockSetToken - }; + useMutation.mockImplementation(mutation => { + if (mutation === createAccountMutation) { + return createAccountMutationFn(); + } else if (mutation === createCartMutation) { + return createCartMutationFn(); + } else if (mutation === signInMutation) { + return signInMutationFn(); + } else if (mutation === mergeCartsMutation) { + return mergeCartsMutationFn(); + } else { + return [jest.fn()]; + } + }); - return [data, api]; + useApolloClient.mockReturnValue(client); }); +test('should return properly', () => { + const { talonProps } = getTalonProps({ + ...defaultProps + }); -jest.mock('../../../../context/cart'); -const mockCreateCart = jest.fn(); -const mockGetCartDetails = jest.fn(); -const mockRemoveCart = jest.fn(); -useCartContext.mockImplementation(() => { - const data = {}; - const api = { - createCart: mockCreateCart, - getCartDetails: mockGetCartDetails, - removeCart: mockRemoveCart - }; - - return [data, api]; + expect(talonProps).toMatchSnapshot(); }); -jest.mock('../../../../hooks/useAwaitQuery'); -useAwaitQuery.mockImplementation(jest.fn()); +// test('returns the correct shape with no initial values', async() => { +// const onSubmit = jest.fn(); +// const { talonProps } = getTalonProps({ +// ...defaultProps, +// onSubmit: handleSubmit +// }); +// // await talonProps.handleSubmit() +// expect(talonProps).toMatchSnapshot(); +// }); -jest.mock('../../../../hooks/useGoogleReCaptcha', () => ({ - useGoogleReCaptcha: jest.fn().mockReturnValue({ - recaptchaLoading: false, - generateReCaptchaData: jest.fn(() => {}), - recaptchaWidgetProps: {} - }) -})); +describe('handle submit event', () => { + it('should create a new account', async () => { + const createAccount = jest.fn().mockResolvedValueOnce(true); + createAccountMutationFn.mockReturnValueOnce([ + createAccount, + { error: null } + ]); + const { talonProps } = getTalonProps({ + ...defaultProps + }); -const handleSubmit = jest.fn(); + await talonProps.handleSubmit(defaultFormValues); -const initialProps = { - initialValues: { - email: 'philipfry@fake.email', - firstName: 'Philip', - lastName: 'Fry' - }, - onSubmit: handleSubmit -}; + expect(createAccount).toHaveBeenCalledWith({ + variables: { + email: defaultFormValues.customer.email, + firstname: defaultFormValues.customer.firstname, + lastname: defaultFormValues.customer.lastname, + password: defaultFormValues.password, + is_subscribed: !!defaultFormValues.subscribe + } + }); + }); + it('should dispatch create account event', async () => { + const mockDispatch = jest.fn(); -jest.mock('@magento/peregrine/lib/context/eventing', () => ({ - useEventingContext: jest.fn().mockReturnValue([{}, { dispatch: jest.fn() }]) -})); + useEventingContext.mockReturnValueOnce([ + {}, + { + dispatch: mockDispatch + } + ]); -const renderHookWithProviders = ({ - renderHookOptions = { initialProps }, - mocks = [ - createAccountMock, - signInMock, - createCartMock, - getCartDetailsMock, - getCustomerMock - ] -} = {}) => { - const wrapper = ({ children }) => ( - - {children} - - ); + const { talonProps } = getTalonProps({ + ...defaultProps + }); - return renderHook(useCreateAccount, { wrapper, ...renderHookOptions }); -}; + await talonProps.handleSubmit(defaultFormValues); -test('returns the correct shape', () => { - const { result } = renderHookWithProviders(); + expect(mockDispatch).toHaveBeenCalledTimes(1); + expect(mockDispatch.mock.calls[0][0]).toMatchSnapshot(); + }); + test('should signin after account creation', async () => { + const token = 'customertoken'; + const customer_token_lifetime = 1; + const signIn = jest.fn().mockReturnValue({ + data: { + generateCustomerToken: { + token + } + } + }); + signInMutationFn.mockReturnValueOnce([signIn, { error: null }]); + const setToken = jest.fn(); + useUserContext.mockReturnValueOnce([ + { isGettingDetails: false }, + { getUserDetails: jest.fn(), setToken } + ]); + + const { talonProps } = getTalonProps({ + ...defaultProps + }); - expect(result.current).toMatchSnapshot(); -}); + await talonProps.handleSubmit(defaultFormValues); -test('returns the correct shape with no initial values', () => { - const { result } = renderHookWithProviders({ - renderHookOptions: { - initialProps: { - onSubmit: handleSubmit + expect(signIn).toHaveBeenCalledWith({ + variables: { + email: defaultFormValues.customer.email, + password: defaultFormValues.password } - } + }); + expect(setToken).toHaveBeenCalledWith(token, customer_token_lifetime); }); - expect(result.current).toMatchSnapshot(); -}); + it('should create a new cart', async () => { + const createCart = jest.fn(); + useCartContext.mockReturnValueOnce([ + { cartId: '1234' }, + { + createCart, + removeCart: jest.fn(), + getCartDetails: jest.fn() + } + ]); -describe('handle submit event', () => { - const formValues = { - customer: { - email: 'bender@planet.express', - firstname: 'Bender', - lastname: 'Rodriguez' - }, - password: '123456', - subscribe: false - }; + const { talonProps } = getTalonProps({ + ...defaultProps + }); - it('creates an account, dispatches event, signs in, and generates a new cart', async () => { - const [, { dispatch }] = useEventingContext(); + await talonProps.handleSubmit(defaultFormValues); - const { result } = renderHookWithProviders(); + expect(createCart).toHaveBeenCalled(); + }); - await act(async () => { - await result.current.handleSubmit(formValues); - }); + it('should remove cart', async () => { + const removeCart = jest.fn(); + useCartContext.mockReturnValueOnce([ + { cartId: '1234' }, + { + createCart: jest.fn(), + removeCart, + getCartDetails: jest.fn() + } + ]); - expect(mockSetToken).toHaveBeenCalledWith('auth-token-123', 3600); - expect(createAccount).toHaveBeenCalled(); - expect(mockRemoveCart).toHaveBeenCalled(); - expect(mockCreateCart).toHaveBeenCalledWith({ - fetchCartId: expect.anything() + const { talonProps } = getTalonProps({ + ...defaultProps }); - expect(mockGetUserDetails).toHaveBeenCalled(); - expect(mockGetCartDetails).toHaveBeenCalled(); - expect(handleSubmit).toHaveBeenCalledTimes(1); - expect(result.current.isDisabled).toBeTruthy(); + await talonProps.handleSubmit(defaultFormValues); - expect(dispatch).toHaveBeenCalledTimes(1); - expect(dispatch.mock.calls[0][0]).toMatchSnapshot(); + expect(removeCart).toHaveBeenCalled(); }); - it('does not call the submit callback if it is not defined', async () => { - const { result } = renderHookWithProviders({ - renderHookOptions: { - initialProps: { - onSubmit: undefined - } - } - }); + it('should call onSubmit', async () => { + const onSubmit = jest.fn(); - await act(async () => { - await result.current.handleSubmit(formValues); + const { talonProps } = getTalonProps({ + ...defaultProps, + onSubmit }); - expect(handleSubmit).not.toHaveBeenCalled(); + await talonProps.handleSubmit(defaultFormValues); + + expect(onSubmit).toHaveBeenCalled(); }); it('resets the submitting state on error', async () => { const consoleErrorSpy = jest.spyOn(console, 'error'); - + const mockGetUserDetails = jest.fn(); useUserContext.mockImplementationOnce(() => { return [ { @@ -256,20 +346,20 @@ describe('handle submit event', () => { } ]; }); - const { result } = renderHookWithProviders(); - - await act(async () => { - await result.current.handleSubmit(formValues); + const { talonProps, update } = getTalonProps({ + ...defaultProps }); + const { isDisabled } = update; + await talonProps.handleSubmit(defaultFormValues); expect(consoleErrorSpy).toHaveBeenCalled(); - expect(result.current.isDisabled).toBeFalsy(); + expect(isDisabled).toBeFalsy(); }); it('does not log errors to console in production when an error happens', async () => { const consoleErrorSpy = jest.spyOn(console, 'error'); process.env.NODE_ENV = 'production'; - + const mockGetUserDetails = jest.fn(); useUserContext.mockImplementationOnce(() => { return [ { @@ -283,12 +373,10 @@ describe('handle submit event', () => { } ]; }); - const { result } = renderHookWithProviders(); - + const { talonProps } = getTalonProps(defaultProps); await act(async () => { - await result.current.handleSubmit(formValues); + await talonProps.handleSubmit(); }); - expect(consoleErrorSpy).not.toHaveBeenCalled(); }); }); diff --git a/packages/peregrine/lib/talons/CheckoutPage/OrderConfirmationPage/createAccount.gql.js b/packages/peregrine/lib/talons/CheckoutPage/OrderConfirmationPage/createAccount.gql.js index 6787d4682f..730eb08a89 100644 --- a/packages/peregrine/lib/talons/CheckoutPage/OrderConfirmationPage/createAccount.gql.js +++ b/packages/peregrine/lib/talons/CheckoutPage/OrderConfirmationPage/createAccount.gql.js @@ -1,4 +1,5 @@ import { gql } from '@apollo/client'; +import { GET_STORE_CONFIG_DATA } from '../../CreateAccount/createAccount.gql'; export const CREATE_ACCOUNT = gql` mutation CreateAccountAfterCheckout( @@ -44,7 +45,6 @@ export const SIGN_IN = gql` mutation SignInAfterCheckout($email: String!, $password: String!) { generateCustomerToken(email: $email, password: $password) { token - customer_token_lifetime } } `; @@ -111,5 +111,6 @@ export default { createCartMutation: CREATE_CART, getCartDetailsQuery: GET_CART_DETAILS, getCustomerQuery: GET_CUSTOMER, - signInMutation: SIGN_IN + signInMutation: SIGN_IN, + getStoreConfigQuery: GET_STORE_CONFIG_DATA }; diff --git a/packages/peregrine/lib/talons/CheckoutPage/OrderConfirmationPage/useCreateAccount.js b/packages/peregrine/lib/talons/CheckoutPage/OrderConfirmationPage/useCreateAccount.js index ef3a6d6169..b9176afb3f 100644 --- a/packages/peregrine/lib/talons/CheckoutPage/OrderConfirmationPage/useCreateAccount.js +++ b/packages/peregrine/lib/talons/CheckoutPage/OrderConfirmationPage/useCreateAccount.js @@ -1,5 +1,5 @@ import { useCallback, useMemo, useState } from 'react'; -import { useMutation } from '@apollo/client'; +import { useMutation, useQuery } from '@apollo/client'; import mergeOperations from '../../../util/shallowMerge'; import { useUserContext } from '../../../context/user'; @@ -39,7 +39,8 @@ export const useCreateAccount = props => { createCartMutation, getCartDetailsQuery, getCustomerQuery, - signInMutation + signInMutation, + getStoreConfigQuery } = operations; const [isSubmitting, setIsSubmitting] = useState(false); const [, { createCart, getCartDetails, removeCart }] = useCartContext(); @@ -65,6 +66,23 @@ export const useCreateAccount = props => { fetchPolicy: 'no-cache' }); + const { data: storeConfigData } = useQuery(getStoreConfigQuery, { + fetchPolicy: 'cache-and-network', + nextFetchPolicy: 'cache-first' + }); + + const { + minimumPasswordLength, + customerAccessTokenLifetime + } = useMemo(() => { + const storeConfig = storeConfigData?.storeConfig || {}; + + return { + minimumPasswordLength: storeConfig.minimum_password_length, + customerAccessTokenLifetime: + storeConfig.customer_access_token_lifetime + }; + }, [storeConfigData]); const fetchUserDetails = useAwaitQuery(getCustomerQuery); const fetchCartDetails = useAwaitQuery(getCartDetailsQuery); @@ -117,12 +135,8 @@ export const useCreateAccount = props => { ...recaptchaDataForSignIn }); const token = signInResponse.data.generateCustomerToken.token; - const customerTokenLifetime = - signInResponse.data.generateCustomerToken - .customer_token_lifetime; - - await (customerTokenLifetime - ? setToken(token, customerTokenLifetime) + await (customerAccessTokenLifetime + ? setToken(token, customerAccessTokenLifetime) : setToken(token)); // Clear guest cart from redux. @@ -152,6 +166,7 @@ export const useCreateAccount = props => { } }, [ + customerAccessTokenLifetime, createAccount, createCart, fetchCartDetails, @@ -200,6 +215,7 @@ export const useCreateAccount = props => { handleEnterKeyPress, isDisabled: isSubmitting || isGettingDetails || recaptchaLoading, initialValues: sanitizedInitialValues, - recaptchaWidgetProps + recaptchaWidgetProps, + minimumPasswordLength }; }; diff --git a/packages/peregrine/lib/talons/CreateAccount/__tests__/__snapshots__/useCreateAccount.spec.js.snap b/packages/peregrine/lib/talons/CreateAccount/__tests__/__snapshots__/useCreateAccount.spec.js.snap index 6ebf851ed9..7553782a17 100644 --- a/packages/peregrine/lib/talons/CreateAccount/__tests__/__snapshots__/useCreateAccount.spec.js.snap +++ b/packages/peregrine/lib/talons/CreateAccount/__tests__/__snapshots__/useCreateAccount.spec.js.snap @@ -37,7 +37,7 @@ Object { "userName": "gooseton", }, "isDisabled": false, - "minimum_password_length": 8, + "minimumPasswordLength": 8, "recaptchaWidgetProps": Object {}, } `; diff --git a/packages/peregrine/lib/talons/CreateAccount/__tests__/useCreateAccount.spec.js b/packages/peregrine/lib/talons/CreateAccount/__tests__/useCreateAccount.spec.js index fc70728da0..6c22e62abe 100644 --- a/packages/peregrine/lib/talons/CreateAccount/__tests__/useCreateAccount.spec.js +++ b/packages/peregrine/lib/talons/CreateAccount/__tests__/useCreateAccount.spec.js @@ -20,13 +20,6 @@ jest.mock('@apollo/client', () => { useQuery: jest.fn() }; }); -// jest.mock('@apollo/client', () => { -// const apolloClient = jest.requireActual('@apollo/client'); -// return { -// ...apolloClient, -// useQuery: jest.fn() -// }; -// }); jest.mock('../../../../lib/hooks/useAwaitQuery', () => ({ useAwaitQuery: jest.fn().mockReturnValue(jest.fn()) })); @@ -105,7 +98,8 @@ const getStoreConfigQueryFn = jest.fn().mockReturnValue({ data: { storeConfig: { store_code: 'default', - minimum_password_length: 8 + minimum_password_length: 8, + customer_access_token_lifetime: 1 } } }); @@ -119,8 +113,7 @@ const signInMutationFn = jest.fn().mockReturnValue([ jest.fn().mockReturnValue({ data: { generateCustomerToken: { - token: 'customer token', - customer_token_lifetime: 3600 + token: 'customer token' } } }), @@ -298,12 +291,11 @@ describe('handleSubmit', () => { test('should signin after account creation', async () => { const token = 'customertoken'; - const customer_token_lifetime = 3600; + const customer_token_lifetime = 1; const signIn = jest.fn().mockReturnValue({ data: { generateCustomerToken: { - token, - customer_token_lifetime + token } } }); diff --git a/packages/peregrine/lib/talons/CreateAccount/createAccount.gql.js b/packages/peregrine/lib/talons/CreateAccount/createAccount.gql.js index e89288142a..0400d0e0e4 100644 --- a/packages/peregrine/lib/talons/CreateAccount/createAccount.gql.js +++ b/packages/peregrine/lib/talons/CreateAccount/createAccount.gql.js @@ -45,7 +45,6 @@ export const SIGN_IN = gql` mutation SignInAfterCreate($email: String!, $password: String!) { generateCustomerToken(email: $email, password: $password) { token - customer_token_lifetime } } `; @@ -132,6 +131,7 @@ export const GET_STORE_CONFIG_DATA = gql` storeConfig { store_code minimum_password_length + customer_access_token_lifetime } } `; diff --git a/packages/peregrine/lib/talons/CreateAccount/useCreateAccount.js b/packages/peregrine/lib/talons/CreateAccount/useCreateAccount.js index 9559911447..68922ca694 100644 --- a/packages/peregrine/lib/talons/CreateAccount/useCreateAccount.js +++ b/packages/peregrine/lib/talons/CreateAccount/useCreateAccount.js @@ -75,10 +75,17 @@ export const useCreateAccount = props => { nextFetchPolicy: 'cache-first' }); - const minimum_password_length = useMemo(() => { - if (storeConfigData) { - return storeConfigData.storeConfig.minimum_password_length; - } + const { + minimumPasswordLength, + customerAccessTokenLifetime + } = useMemo(() => { + const storeConfig = storeConfigData?.storeConfig || {}; + + return { + minimumPasswordLength: storeConfig.minimum_password_length, + customerAccessTokenLifetime: + storeConfig.customer_access_token_lifetime + }; }, [storeConfigData]); const fetchUserDetails = useAwaitQuery(getCustomerQuery); @@ -148,11 +155,8 @@ export const useCreateAccount = props => { ...recaptchaDataForSignIn }); const token = signInResponse.data.generateCustomerToken.token; - const customerTokenLifetime = - signInResponse.data.generateCustomerToken - .customer_token_lifetime; - await (customerTokenLifetime - ? setToken(token, customerTokenLifetime) + await (customerAccessTokenLifetime + ? setToken(token, customerAccessTokenLifetime) : setToken(token)); // Clear all cart/customer data from cache and redux. await apolloClient.clearCacheData(apolloClient, 'cart'); @@ -193,6 +197,7 @@ export const useCreateAccount = props => { }, [ + customerAccessTokenLifetime, cartId, generateReCaptchaData, createAccount, @@ -238,7 +243,7 @@ export const useCreateAccount = props => { initialValues: sanitizedInitialValues, isDisabled: isSubmitting || isGettingDetails || recaptchaLoading, recaptchaWidgetProps, - minimum_password_length + minimumPasswordLength }; }; diff --git a/packages/peregrine/lib/talons/SignIn/__tests__/__snapshots__/useSignIn.spec.js.snap b/packages/peregrine/lib/talons/SignIn/__tests__/__snapshots__/useSignIn.spec.js.snap new file mode 100644 index 0000000000..fff8f0d9a3 --- /dev/null +++ b/packages/peregrine/lib/talons/SignIn/__tests__/__snapshots__/useSignIn.spec.js.snap @@ -0,0 +1,75 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`mutation error is returned by talon 1`] = ` +Map { + "getUserDetailsQuery" => "getDetails error from redux", + "signInMutation" => "Sign In Mutation Error", +} +`; + +exports[`returns correct shape 1`] = ` +Object { + "cartContext": Array [ + Object { + "cartId": "1234", + }, + Object { + "createCart": [MockFunction], + "getCartDetails": [MockFunction], + "removeCart": [MockFunction], + }, + ], + "errors": Map { + "getUserDetailsQuery" => "getDetails error from redux", + "signInMutation" => null, + }, + "eventingContext": Array [ + Object {}, + Object { + "dispatch": [MockFunction], + }, + ], + "fetchCartDetails": [MockFunction], + "fetchCartId": [MockFunction], + "fetchUserDetails": undefined, + "forgotPasswordHandleEnterKeyPress": [Function], + "googleReCaptcha": Object { + "generateReCaptchaData": [Function], + "recaptchaLoading": undefined, + "recaptchaWidgetProps": Object { + "containerElement": [Function], + "shouldRender": false, + }, + }, + "handleCreateAccount": [Function], + "handleEnterKeyPress": [Function], + "handleForgotPassword": [Function], + "handleSubmit": [Function], + "isBusy": undefined, + "isSigningIn": false, + "mergeCarts": [MockFunction], + "recaptchaWidgetProps": Object { + "containerElement": [Function], + "shouldRender": false, + }, + "setFormApi": [Function], + "setIsSigningIn": [Function], + "signInMutationResult": Array [ + [MockFunction], + Object { + "error": null, + }, + ], + "signinHandleEnterKeyPress": [Function], + "userContext": Array [ + Object { + "getDetailsError": "getDetails error from redux", + "isGettingDetails": false, + }, + Object { + "getUserDetails": [MockFunction], + "setToken": [MockFunction], + }, + ], +} +`; diff --git a/packages/peregrine/lib/talons/SignIn/__tests__/useSignIn.spec.js b/packages/peregrine/lib/talons/SignIn/__tests__/useSignIn.spec.js index 9f3ed201bb..42845b790a 100644 --- a/packages/peregrine/lib/talons/SignIn/__tests__/useSignIn.spec.js +++ b/packages/peregrine/lib/talons/SignIn/__tests__/useSignIn.spec.js @@ -1,19 +1,17 @@ import React from 'react'; -import { useApolloClient } from '@apollo/client'; -import { MockedProvider } from '@apollo/client/testing'; -import { renderHook, act } from '@testing-library/react-hooks'; - -import { useCartContext } from '../../../context/cart'; +import { useApolloClient, useQuery, useMutation } from '@apollo/client'; +import { act } from '@testing-library/react-hooks'; +import createTestInstance from '../../../util/createTestInstance'; import { useUserContext } from '../../../context/user'; -import defaultOperations from '../signIn.gql'; import { useSignIn } from '../useSignIn'; -import { useEventingContext } from '../../../context/eventing'; import { useAwaitQuery } from '../../../hooks/useAwaitQuery'; jest.mock('@apollo/client', () => { return { ...jest.requireActual('@apollo/client'), - useApolloClient: jest.fn() + useApolloClient: jest.fn(), + useMutation: jest.fn().mockReturnValue([jest.fn()]), + useQuery: jest.fn() }; }); jest.mock('../../../hooks/useAwaitQuery', () => ({ @@ -23,9 +21,9 @@ jest.mock('../../../store/actions/cart', () => ({ retrieveCartId: jest.fn().mockReturnValue('new-cart-id') })); -jest.mock('../../../context/cart', () => ({ +jest.mock('../../../../lib/context/cart', () => ({ useCartContext: jest.fn().mockReturnValue([ - { cartId: 'old-cart-id' }, + { cartId: '1234' }, { createCart: jest.fn(), removeCart: jest.fn(), @@ -34,7 +32,7 @@ jest.mock('../../../context/cart', () => ({ ]) })); -jest.mock('../../../context/user', () => ({ +jest.mock('../../../../lib/context/user', () => ({ useUserContext: jest.fn().mockReturnValue([ { isGettingDetails: false, @@ -43,7 +41,6 @@ jest.mock('../../../context/user', () => ({ { getUserDetails: jest.fn(), setToken: jest.fn() } ]) })); - jest.mock('../../../hooks/useGoogleReCaptcha', () => ({ useGoogleReCaptcha: jest.fn().mockReturnValue({ recaptchaLoading: false, @@ -56,43 +53,71 @@ jest.mock('@magento/peregrine/lib/context/eventing', () => ({ useEventingContext: jest.fn().mockReturnValue([{}, { dispatch: jest.fn() }]) })); +const Component = props => { + const talonProps = useSignIn(props); + + return ; +}; + +const getTalonProps = props => { + const tree = createTestInstance(); + const { root } = tree; + const { talonProps } = root.findByType('i').props; + + const update = newProps => { + act(() => { + tree.update(); + }); + + return root.findByType('i').props.talonProps; + }; + + return { talonProps, tree, update }; +}; + const signInVariables = { email: 'fry@planetexpress.com', password: 'slurm is the best' }; -const authToken = 'auth-token-123'; -const customerTokenLifetime = 3600; -const signInMock = { - request: { - query: defaultOperations.signInMutation, - variables: signInVariables - }, - result: { +const getCartDetailsQuery = 'getCartDetailsQuery'; +const getCustomerQuery = 'getCustomerQuery'; +const createCartMutation = 'createCartMutation'; +const signInMutation = 'signInMutation'; +const mergeCartsMutation = 'mergeCartsMutation'; +const getStoreConfigQuery = 'getStoreConfigQuery'; + +const getCartDetailsQueryFn = jest.fn(); +const customerQueryFn = jest.fn(); +const mergeCartsMutationFn = jest.fn().mockReturnValue([jest.fn()]); +const getStoreConfigQueryFn = jest.fn().mockReturnValue({ + data: { + storeConfig: { + store_code: 'default', + customer_access_token_lifetime: 1 + } + } +}); +const signInMutationFn = jest.fn().mockReturnValue([ + jest.fn().mockReturnValue({ data: { generateCustomerToken: { - token: authToken, - customer_token_lifetime: customerTokenLifetime + token: 'customer token' } } - } -}; - -const mergeCartsMock = { - request: { - query: defaultOperations.mergeCartsMutation, - variables: { - destinationCartId: 'new-cart-id', - sourceCartId: 'old-cart-id' - } + }), + { error: null } +]); + +const defaultProps = { + operations: { + createCartMutation, + getCustomerQuery, + mergeCartsMutation, + signInMutation, + getStoreConfigQuery }, - result: { - data: null - } -}; - -const initialProps = { - getCartDetailsQuery: 'getCartDetailsQuery', + getCartDetailsQuery: jest.fn(), setDefaultUsername: jest.fn(), showCreateAccount: jest.fn(), showForgotPassword: jest.fn(), @@ -102,7312 +127,160 @@ const initialProps = { const clearCacheData = jest.fn(); const client = { clearCacheData }; -const renderHookWithProviders = ({ - renderHookOptions = { initialProps }, - mocks = [signInMock, mergeCartsMock] -} = {}) => { - const wrapper = ({ children }) => ( - - {children} - - ); - - return renderHook(useSignIn, { wrapper, ...renderHookOptions }); -}; - beforeEach(() => { + useQuery.mockImplementation(query => { + if (query === getStoreConfigQuery) { + return getStoreConfigQueryFn(); + } else { + return [jest.fn(), {}]; + } + }); + useAwaitQuery.mockImplementation(query => { + if (query === getCustomerQuery) { + return customerQueryFn(); + } else if (query === getCartDetailsQuery) { + return getCartDetailsQueryFn(); + } else { + return jest.fn(); + } + }); + useMutation.mockImplementation(mutation => { + if (mutation === signInMutation) { + return signInMutationFn(); + } else if (mutation === mergeCartsMutation) { + return mergeCartsMutationFn(); + } else { + return [jest.fn()]; + } + }); useApolloClient.mockReturnValue(client); }); test('returns correct shape', () => { - const { result } = renderHookWithProviders(); + const { talonProps } = getTalonProps({ + ...defaultProps + }); - expect(result.current).toMatchInlineSnapshot(` - Object { - "cartContext": Array [ - Object { - "cartId": "old-cart-id", - }, - Object { - "createCart": [MockFunction], - "getCartDetails": [MockFunction], - "removeCart": [MockFunction], - }, - ], - "errors": Map { - "getUserDetailsQuery" => "getDetails error from redux", - "signInMutation" => undefined, - }, - "eventingContext": Array [ - Object {}, - Object { - "dispatch": [MockFunction], - }, - ], - "fetchCartDetails": undefined, - "fetchCartId": [Function], - "fetchUserDetails": undefined, - "forgotPasswordHandleEnterKeyPress": [Function], - "googleReCaptcha": Object { - "generateReCaptchaData": [Function], - "recaptchaLoading": true, - "recaptchaWidgetProps": Object { - "containerElement": [Function], - "shouldRender": false, - }, - }, - "handleCreateAccount": [Function], - "handleEnterKeyPress": [Function], - "handleForgotPassword": [Function], - "handleSubmit": [Function], - "isBusy": true, - "isSigningIn": false, - "mergeCarts": [Function], - "recaptchaWidgetProps": Object { - "containerElement": [Function], - "shouldRender": false, - }, - "setFormApi": [Function], - "setIsSigningIn": [Function], - "signInMutationResult": Array [ - [Function], - Object { - "called": false, - "client": ApolloClient { - "cache": InMemoryCache { - "addTypename": false, - "config": Object { - "addTypename": false, - "canonizeResults": false, - "dataIdFromObject": [Function], - "resultCaching": true, - }, - "data": Root { - "canRead": [Function], - "data": Object {}, - "getFieldValue": [Function], - "group": CacheGroup { - "caching": true, - "d": [Function], - "keyMaker": Trie { - "makeData": [Function], - "weakness": true, - }, - "parent": null, - }, - "policies": Policies { - "cache": [Circular], - "config": Object { - "cache": [Circular], - "dataIdFromObject": [Function], - "possibleTypes": undefined, - "typePolicies": undefined, - }, - "fuzzySubtypes": Map {}, - "rootIdsByTypename": Object { - "Mutation": "ROOT_MUTATION", - "Query": "ROOT_QUERY", - "Subscription": "ROOT_SUBSCRIPTION", - }, - "rootTypenamesById": Object { - "ROOT_MUTATION": "Mutation", - "ROOT_QUERY": "Query", - "ROOT_SUBSCRIPTION": "Subscription", - }, - "supertypeMap": Map {}, - "toBeAdded": Object {}, - "typePolicies": Object { - "Query": Object { - "fields": Object {}, - }, - }, - "usingPossibleTypes": false, - }, - "refs": Object {}, - "rootIds": Object {}, - "storageTrie": Trie { - "makeData": [Function], - "weakness": true, - }, - "stump": Stump { - "canRead": [Function], - "data": Object {}, - "getFieldValue": [Function], - "group": CacheGroup { - "caching": true, - "d": [Function], - "keyMaker": Trie { - "makeData": [Function], - "weak": WeakMap {}, - "weakness": true, - }, - "parent": CacheGroup { - "caching": true, - "d": [Function], - "keyMaker": Trie { - "makeData": [Function], - "weakness": true, - }, - "parent": null, - }, - }, - "id": "EntityStore.Stump", - "parent": [Circular], - "policies": Policies { - "cache": [Circular], - "config": Object { - "cache": [Circular], - "dataIdFromObject": [Function], - "possibleTypes": undefined, - "typePolicies": undefined, - }, - "fuzzySubtypes": Map {}, - "rootIdsByTypename": Object { - "Mutation": "ROOT_MUTATION", - "Query": "ROOT_QUERY", - "Subscription": "ROOT_SUBSCRIPTION", - }, - "rootTypenamesById": Object { - "ROOT_MUTATION": "Mutation", - "ROOT_QUERY": "Query", - "ROOT_SUBSCRIPTION": "Subscription", - }, - "supertypeMap": Map {}, - "toBeAdded": Object {}, - "typePolicies": Object { - "Query": Object { - "fields": Object {}, - }, - }, - "usingPossibleTypes": false, - }, - "refs": Object {}, - "replay": [Function], - "rootIds": Object {}, - "toReference": [Function], - }, - "toReference": [Function], - }, - "evict": [Function], - "getFragmentDoc": [Function], - "makeVar": [Function], - "maybeBroadcastWatch": [Function], - "modify": [Function], - "optimisticData": Stump { - "canRead": [Function], - "data": Object {}, - "getFieldValue": [Function], - "group": CacheGroup { - "caching": true, - "d": [Function], - "keyMaker": Trie { - "makeData": [Function], - "weak": WeakMap {}, - "weakness": true, - }, - "parent": CacheGroup { - "caching": true, - "d": [Function], - "keyMaker": Trie { - "makeData": [Function], - "weakness": true, - }, - "parent": null, - }, - }, - "id": "EntityStore.Stump", - "parent": Root { - "canRead": [Function], - "data": Object {}, - "getFieldValue": [Function], - "group": CacheGroup { - "caching": true, - "d": [Function], - "keyMaker": Trie { - "makeData": [Function], - "weakness": true, - }, - "parent": null, - }, - "policies": Policies { - "cache": [Circular], - "config": Object { - "cache": [Circular], - "dataIdFromObject": [Function], - "possibleTypes": undefined, - "typePolicies": undefined, - }, - "fuzzySubtypes": Map {}, - "rootIdsByTypename": Object { - "Mutation": "ROOT_MUTATION", - "Query": "ROOT_QUERY", - "Subscription": "ROOT_SUBSCRIPTION", - }, - "rootTypenamesById": Object { - "ROOT_MUTATION": "Mutation", - "ROOT_QUERY": "Query", - "ROOT_SUBSCRIPTION": "Subscription", - }, - "supertypeMap": Map {}, - "toBeAdded": Object {}, - "typePolicies": Object { - "Query": Object { - "fields": Object {}, - }, - }, - "usingPossibleTypes": false, - }, - "refs": Object {}, - "rootIds": Object {}, - "storageTrie": Trie { - "makeData": [Function], - "weakness": true, - }, - "stump": [Circular], - "toReference": [Function], - }, - "policies": Policies { - "cache": [Circular], - "config": Object { - "cache": [Circular], - "dataIdFromObject": [Function], - "possibleTypes": undefined, - "typePolicies": undefined, - }, - "fuzzySubtypes": Map {}, - "rootIdsByTypename": Object { - "Mutation": "ROOT_MUTATION", - "Query": "ROOT_QUERY", - "Subscription": "ROOT_SUBSCRIPTION", - }, - "rootTypenamesById": Object { - "ROOT_MUTATION": "Mutation", - "ROOT_QUERY": "Query", - "ROOT_SUBSCRIPTION": "Subscription", - }, - "supertypeMap": Map {}, - "toBeAdded": Object {}, - "typePolicies": Object { - "Query": Object { - "fields": Object {}, - }, - }, - "usingPossibleTypes": false, - }, - "refs": Object {}, - "replay": [Function], - "rootIds": Object {}, - "toReference": [Function], - }, - "policies": Policies { - "cache": [Circular], - "config": Object { - "cache": [Circular], - "dataIdFromObject": [Function], - "possibleTypes": undefined, - "typePolicies": undefined, - }, - "fuzzySubtypes": Map {}, - "rootIdsByTypename": Object { - "Mutation": "ROOT_MUTATION", - "Query": "ROOT_QUERY", - "Subscription": "ROOT_SUBSCRIPTION", - }, - "rootTypenamesById": Object { - "ROOT_MUTATION": "Mutation", - "ROOT_QUERY": "Query", - "ROOT_SUBSCRIPTION": "Subscription", - }, - "supertypeMap": Map {}, - "toBeAdded": Object {}, - "typePolicies": Object { - "Query": Object { - "fields": Object {}, - }, - }, - "usingPossibleTypes": false, - }, - "reset": [Function], - "storeReader": StoreReader { - "canon": ObjectCanon { - "empty": Object {}, - "keysByJSON": Map { - "[]" => Object { - "json": "[]", - "sorted": Array [], - }, - }, - "known": WeakSet {}, - "passes": WeakMap {}, - "pool": Trie { - "data": Object { - "keys": Object { - "json": "[]", - "sorted": Array [], - }, - }, - "makeData": [Function], - "weak": WeakMap {}, - "weakness": true, - }, - }, - "config": Object { - "addTypename": false, - "cache": [Circular], - "canonizeResults": false, - }, - "executeSelectionSet": [Function], - "executeSubSelectedArray": [Function], - "knownResults": WeakMap {}, - }, - "storeWriter": StoreWriter { - "cache": [Circular], - "reader": StoreReader { - "canon": ObjectCanon { - "empty": Object {}, - "keysByJSON": Map { - "[]" => Object { - "json": "[]", - "sorted": Array [], - }, - }, - "known": WeakSet {}, - "passes": WeakMap {}, - "pool": Trie { - "data": Object { - "keys": Object { - "json": "[]", - "sorted": Array [], - }, - }, - "makeData": [Function], - "weak": WeakMap {}, - "weakness": true, - }, - }, - "config": Object { - "addTypename": false, - "cache": [Circular], - "canonizeResults": false, - }, - "executeSelectionSet": [Function], - "executeSubSelectedArray": [Function], - "knownResults": WeakMap {}, - }, - }, - "txCount": 0, - "typenameDocumentCache": Map {}, - "watches": Set { - Object { - "callback": [Function], - "canonizeResults": undefined, - "optimistic": true, - "query": Object { - "definitions": Array [ - Object { - "directives": Array [], - "kind": "OperationDefinition", - "name": Object { - "kind": "Name", - "value": "GetReCaptchaV3Config", - }, - "operation": "query", - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "recaptchaV3Config", - }, - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "website_key", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "badge_position", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "language_code", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "forms", - }, - "selectionSet": undefined, - }, - ], - }, - }, - ], - }, - "variableDefinitions": Array [], - }, - ], - "kind": "Document", - "loc": Object { - "end": 173, - "start": 0, - }, - }, - "returnPartialData": true, - "variables": Object {}, - "watcher": QueryInfo { - "cache": [Circular], - "cancel": [Function], - "dirty": false, - "document": Object { - "definitions": Array [ - Object { - "directives": Array [], - "kind": "OperationDefinition", - "name": Object { - "kind": "Name", - "value": "GetReCaptchaV3Config", - }, - "operation": "query", - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "recaptchaV3Config", - }, - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "website_key", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "badge_position", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "language_code", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "forms", - }, - "selectionSet": undefined, - }, - ], - }, - }, - ], - }, - "variableDefinitions": Array [], - }, - ], - "kind": "Document", - "loc": Object { - "end": 173, - "start": 0, - }, - }, - "graphQLErrors": Array [], - "lastDiff": Object { - "diff": Object { - "complete": false, - "missing": Array [ - MissingFieldError { - "message": "Can't find field 'recaptchaV3Config' on ROOT_QUERY object", - "path": Object { - "recaptchaV3Config": "Can't find field 'recaptchaV3Config' on ROOT_QUERY object", - }, - "query": Object { - "definitions": Array [ - Object { - "directives": Array [], - "kind": "OperationDefinition", - "name": Object { - "kind": "Name", - "value": "GetReCaptchaV3Config", - }, - "operation": "query", - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "recaptchaV3Config", - }, - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "website_key", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "badge_position", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "language_code", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "forms", - }, - "selectionSet": undefined, - }, - ], - }, - }, - ], - }, - "variableDefinitions": Array [], - }, - ], - "kind": "Document", - "loc": Object { - "end": 173, - "start": 0, - }, - }, - "variables": Object {}, - }, - ], - "result": Object {}, - }, - "options": Object { - "canonizeResults": undefined, - "optimistic": true, - "query": Object { - "definitions": Array [ - Object { - "directives": Array [], - "kind": "OperationDefinition", - "name": Object { - "kind": "Name", - "value": "GetReCaptchaV3Config", - }, - "operation": "query", - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "recaptchaV3Config", - }, - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "website_key", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "badge_position", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "language_code", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "forms", - }, - "selectionSet": undefined, - }, - ], - }, - }, - ], - }, - "variableDefinitions": Array [], - }, - ], - "kind": "Document", - "loc": Object { - "end": 173, - "start": 0, - }, - }, - "returnPartialData": true, - "variables": Object {}, - }, - }, - "lastRequestId": 1, - "lastWatch": [Circular], - "listeners": Set { - [Function], - }, - "networkError": null, - "networkStatus": 1, - "observableQuery": ObservableQuery { - "_subscriber": [Function], - "concast": Concast { - "_subscriber": [Function], - "addCount": 1, - "cancel": [Function], - "handlers": Object { - "complete": [Function], - "error": [Function], - "next": [Function], - }, - "observers": Set { - Object { - "complete": [Function], - "error": [Function], - "next": [Function], - }, - Object { - "error": [Function], - "next": [Function], - }, - }, - "promise": Promise {}, - "reject": [Function], - "resolve": [Function], - "sources": Array [], - "sub": Subscription { - "_cleanup": [Function], - "_observer": Object { - "complete": [Function], - "error": [Function], - "next": [Function], - }, - "_queue": undefined, - "_state": "ready", - }, - }, - "initialFetchPolicy": "cache-and-network", - "isTornDown": false, - "last": Object { - "result": Object { - "loading": true, - "networkStatus": 1, - "partial": true, - }, - "variables": Object {}, - }, - "observer": Object { - "error": [Function], - "next": [Function], - }, - "observers": Set { - SubscriptionObserver { - "_subscription": Subscription { - "_cleanup": [Function], - "_observer": Object { - "complete": undefined, - "error": [Function], - "next": [Function], - }, - "_queue": Array [ - Object { - "type": "next", - "value": Object { - "loading": true, - "networkStatus": 1, - "partial": true, - }, - }, - ], - "_state": "buffering", - }, - }, - }, - "options": Object { - "fetchPolicy": "cache-and-network", - "notifyOnNetworkStatusChange": false, - "query": Object { - "definitions": Array [ - Object { - "directives": Array [], - "kind": "OperationDefinition", - "name": Object { - "kind": "Name", - "value": "GetReCaptchaV3Config", - }, - "operation": "query", - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "recaptchaV3Config", - }, - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "website_key", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "badge_position", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "language_code", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "forms", - }, - "selectionSet": undefined, - }, - ], - }, - }, - ], - }, - "variableDefinitions": Array [], - }, - ], - "kind": "Document", - "loc": Object { - "end": 173, - "start": 0, - }, - }, - "variables": Object {}, - }, - "queryId": "1", - "queryInfo": [Circular], - "queryManager": QueryManager { - "assumeImmutableResults": false, - "cache": [Circular], - "clientAwareness": Object { - "name": undefined, - "version": undefined, - }, - "fetchCancelFns": Map { - "1" => [Function], - }, - "inFlightLinkObservables": Map { - Object { - "definitions": Array [ - Object { - "directives": Array [], - "kind": "OperationDefinition", - "name": Object { - "kind": "Name", - "value": "GetReCaptchaV3Config", - }, - "operation": "query", - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "recaptchaV3Config", - }, - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "website_key", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "badge_position", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "language_code", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "forms", - }, - "selectionSet": undefined, - }, - ], - }, - }, - ], - }, - "variableDefinitions": Array [], - }, - ], - "kind": "Document", - "loc": Object { - "end": 173, - "start": 0, - }, - } => Map { - "{}" => Concast { - "_subscriber": [Function], - "addCount": 1, - "cancel": [Function], - "handlers": Object { - "complete": [Function], - "error": [Function], - "next": [Function], - }, - "observers": Set { - Object { - "complete": [Function], - "error": [Function], - "next": [Function], - }, - SubscriptionObserver { - "_subscription": Subscription { - "_cleanup": [Function], - "_observer": Object { - "complete": [Function], - "error": [Function], - "next": [Function], - }, - "_queue": undefined, - "_state": "ready", - }, - }, - }, - "promise": Promise {}, - "reject": [Function], - "resolve": [Function], - "sources": Array [], - "sub": Subscription { - "_cleanup": [Function], - "_observer": Object { - "complete": [Function], - "error": [Function], - "next": [Function], - }, - "_queue": undefined, - "_state": "ready", - }, - }, - }, - }, - "link": MockLink { - "addTypename": false, - "mockedResponsesByKey": Object { - "{\\"query\\":\\"mutation MergeCartsAfterSignIn($sourceCartId: String!, $destinationCartId: String!) {\\\\n mergeCarts(\\\\n source_cart_id: $sourceCartId\\\\n destination_cart_id: $destinationCartId\\\\n ) {\\\\n id\\\\n items {\\\\n uid\\\\n }\\\\n ...CheckoutPageFragment\\\\n }\\\\n}\\\\n\\\\nfragment CheckoutPageFragment on Cart {\\\\n id\\\\n items {\\\\n uid\\\\n product {\\\\n uid\\\\n stock_status\\\\n }\\\\n }\\\\n total_quantity\\\\n available_payment_methods {\\\\n code\\\\n }\\\\n}\\\\n\\"}": Array [ - Object { - "request": Object { - "query": Object { - "definitions": Array [ - Object { - "directives": Array [], - "kind": "OperationDefinition", - "name": Object { - "kind": "Name", - "value": "MergeCartsAfterSignIn", - }, - "operation": "mutation", - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [ - Object { - "kind": "Argument", - "name": Object { - "kind": "Name", - "value": "source_cart_id", - }, - "value": Object { - "kind": "Variable", - "name": Object { - "kind": "Name", - "value": "sourceCartId", - }, - }, - }, - Object { - "kind": "Argument", - "name": Object { - "kind": "Name", - "value": "destination_cart_id", - }, - "value": Object { - "kind": "Variable", - "name": Object { - "kind": "Name", - "value": "destinationCartId", - }, - }, - }, - ], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "mergeCarts", - }, - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "id", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "items", - }, - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "uid", - }, - "selectionSet": undefined, - }, - ], - }, - }, - Object { - "directives": Array [], - "kind": "FragmentSpread", - "name": Object { - "kind": "Name", - "value": "CheckoutPageFragment", - }, - }, - ], - }, - }, - ], - }, - "variableDefinitions": Array [ - Object { - "defaultValue": undefined, - "directives": Array [], - "kind": "VariableDefinition", - "type": Object { - "kind": "NonNullType", - "type": Object { - "kind": "NamedType", - "name": Object { - "kind": "Name", - "value": "String", - }, - }, - }, - "variable": Object { - "kind": "Variable", - "name": Object { - "kind": "Name", - "value": "sourceCartId", - }, - }, - }, - Object { - "defaultValue": undefined, - "directives": Array [], - "kind": "VariableDefinition", - "type": Object { - "kind": "NonNullType", - "type": Object { - "kind": "NamedType", - "name": Object { - "kind": "Name", - "value": "String", - }, - }, - }, - "variable": Object { - "kind": "Variable", - "name": Object { - "kind": "Name", - "value": "destinationCartId", - }, - }, - }, - ], - }, - Object { - "directives": Array [], - "kind": "FragmentDefinition", - "name": Object { - "kind": "Name", - "value": "CheckoutPageFragment", - }, - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "id", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "items", - }, - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "uid", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "product", - }, - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "uid", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "stock_status", - }, - "selectionSet": undefined, - }, - ], - }, - }, - ], - }, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "total_quantity", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "available_payment_methods", - }, - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "code", - }, - "selectionSet": undefined, - }, - ], - }, - }, - ], - }, - "typeCondition": Object { - "kind": "NamedType", - "name": Object { - "kind": "Name", - "value": "Cart", - }, - }, - }, - ], - "kind": "Document", - "loc": Object { - "end": 932, - "start": 0, - }, - }, - "variables": Object { - "destinationCartId": "new-cart-id", - "sourceCartId": "old-cart-id", - }, - }, - "result": Object { - "data": null, - }, - }, - ], - "{\\"query\\":\\"mutation SignIn($email: String!, $password: String!) {\\\\n generateCustomerToken(email: $email, password: $password) {\\\\n token\\\\n customer_token_lifetime\\\\n }\\\\n}\\\\n\\"}": Array [ - Object { - "request": Object { - "query": Object { - "definitions": Array [ - Object { - "directives": Array [], - "kind": "OperationDefinition", - "name": Object { - "kind": "Name", - "value": "SignIn", - }, - "operation": "mutation", - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [ - Object { - "kind": "Argument", - "name": Object { - "kind": "Name", - "value": "email", - }, - "value": Object { - "kind": "Variable", - "name": Object { - "kind": "Name", - "value": "email", - }, - }, - }, - Object { - "kind": "Argument", - "name": Object { - "kind": "Name", - "value": "password", - }, - "value": Object { - "kind": "Variable", - "name": Object { - "kind": "Name", - "value": "password", - }, - }, - }, - ], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "generateCustomerToken", - }, - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "token", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "customer_token_lifetime", - }, - "selectionSet": undefined, - }, - ], - }, - }, - ], - }, - "variableDefinitions": Array [ - Object { - "defaultValue": undefined, - "directives": Array [], - "kind": "VariableDefinition", - "type": Object { - "kind": "NonNullType", - "type": Object { - "kind": "NamedType", - "name": Object { - "kind": "Name", - "value": "String", - }, - }, - }, - "variable": Object { - "kind": "Variable", - "name": Object { - "kind": "Name", - "value": "email", - }, - }, - }, - Object { - "defaultValue": undefined, - "directives": Array [], - "kind": "VariableDefinition", - "type": Object { - "kind": "NonNullType", - "type": Object { - "kind": "NamedType", - "name": Object { - "kind": "Name", - "value": "String", - }, - }, - }, - "variable": Object { - "kind": "Variable", - "name": Object { - "kind": "Name", - "value": "password", - }, - }, - }, - ], - }, - ], - "kind": "Document", - "loc": Object { - "end": 198, - "start": 0, - }, - }, - "variables": Object { - "email": "fry@planetexpress.com", - "password": "slurm is the best", - }, - }, - "result": Object { - "data": Object { - "generateCustomerToken": Object { - "customer_token_lifetime": 3600, - "token": "auth-token-123", - }, - }, - }, - }, - ], - }, - "operation": Object { - "extensions": Object {}, - "operationName": "GetReCaptchaV3Config", - "query": Object { - "definitions": Array [ - Object { - "directives": Array [], - "kind": "OperationDefinition", - "name": Object { - "kind": "Name", - "value": "GetReCaptchaV3Config", - }, - "operation": "query", - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "recaptchaV3Config", - }, - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "website_key", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "badge_position", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "language_code", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "forms", - }, - "selectionSet": undefined, - }, - ], - }, - }, - ], - }, - "variableDefinitions": Array [], - }, - ], - "kind": "Document", - "loc": Object { - "end": 173, - "start": 0, - }, - }, - "variables": Object {}, - }, - }, - "localState": LocalState { - "cache": [Circular], - "client": [Circular], - }, - "mutationIdCounter": 1, - "mutationStore": Object {}, - "onBroadcast": [Function], - "queries": Map { - "1" => [Circular], - }, - "queryDeduplication": true, - "queryIdCounter": 2, - "requestIdCounter": 2, - "ssrMode": false, - "transformCache": WeakMap {}, - }, - "queryName": "GetReCaptchaV3Config", - "subscriptions": Set {}, - }, - "oqListener": [Function], - "queryId": "1", - "stopped": false, - "subscriptions": Set {}, - "variables": Object {}, - }, - }, - }, - }, - "clearStoreCallbacks": Array [], - "defaultOptions": Object {}, - "disableNetworkFetches": false, - "link": MockLink { - "addTypename": false, - "mockedResponsesByKey": Object { - "{\\"query\\":\\"mutation MergeCartsAfterSignIn($sourceCartId: String!, $destinationCartId: String!) {\\\\n mergeCarts(\\\\n source_cart_id: $sourceCartId\\\\n destination_cart_id: $destinationCartId\\\\n ) {\\\\n id\\\\n items {\\\\n uid\\\\n }\\\\n ...CheckoutPageFragment\\\\n }\\\\n}\\\\n\\\\nfragment CheckoutPageFragment on Cart {\\\\n id\\\\n items {\\\\n uid\\\\n product {\\\\n uid\\\\n stock_status\\\\n }\\\\n }\\\\n total_quantity\\\\n available_payment_methods {\\\\n code\\\\n }\\\\n}\\\\n\\"}": Array [ - Object { - "request": Object { - "query": Object { - "definitions": Array [ - Object { - "directives": Array [], - "kind": "OperationDefinition", - "name": Object { - "kind": "Name", - "value": "MergeCartsAfterSignIn", - }, - "operation": "mutation", - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [ - Object { - "kind": "Argument", - "name": Object { - "kind": "Name", - "value": "source_cart_id", - }, - "value": Object { - "kind": "Variable", - "name": Object { - "kind": "Name", - "value": "sourceCartId", - }, - }, - }, - Object { - "kind": "Argument", - "name": Object { - "kind": "Name", - "value": "destination_cart_id", - }, - "value": Object { - "kind": "Variable", - "name": Object { - "kind": "Name", - "value": "destinationCartId", - }, - }, - }, - ], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "mergeCarts", - }, - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "id", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "items", - }, - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "uid", - }, - "selectionSet": undefined, - }, - ], - }, - }, - Object { - "directives": Array [], - "kind": "FragmentSpread", - "name": Object { - "kind": "Name", - "value": "CheckoutPageFragment", - }, - }, - ], - }, - }, - ], - }, - "variableDefinitions": Array [ - Object { - "defaultValue": undefined, - "directives": Array [], - "kind": "VariableDefinition", - "type": Object { - "kind": "NonNullType", - "type": Object { - "kind": "NamedType", - "name": Object { - "kind": "Name", - "value": "String", - }, - }, - }, - "variable": Object { - "kind": "Variable", - "name": Object { - "kind": "Name", - "value": "sourceCartId", - }, - }, - }, - Object { - "defaultValue": undefined, - "directives": Array [], - "kind": "VariableDefinition", - "type": Object { - "kind": "NonNullType", - "type": Object { - "kind": "NamedType", - "name": Object { - "kind": "Name", - "value": "String", - }, - }, - }, - "variable": Object { - "kind": "Variable", - "name": Object { - "kind": "Name", - "value": "destinationCartId", - }, - }, - }, - ], - }, - Object { - "directives": Array [], - "kind": "FragmentDefinition", - "name": Object { - "kind": "Name", - "value": "CheckoutPageFragment", - }, - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "id", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "items", - }, - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "uid", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "product", - }, - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "uid", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "stock_status", - }, - "selectionSet": undefined, - }, - ], - }, - }, - ], - }, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "total_quantity", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "available_payment_methods", - }, - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "code", - }, - "selectionSet": undefined, - }, - ], - }, - }, - ], - }, - "typeCondition": Object { - "kind": "NamedType", - "name": Object { - "kind": "Name", - "value": "Cart", - }, - }, - }, - ], - "kind": "Document", - "loc": Object { - "end": 932, - "start": 0, - }, - }, - "variables": Object { - "destinationCartId": "new-cart-id", - "sourceCartId": "old-cart-id", - }, - }, - "result": Object { - "data": null, - }, - }, - ], - "{\\"query\\":\\"mutation SignIn($email: String!, $password: String!) {\\\\n generateCustomerToken(email: $email, password: $password) {\\\\n token\\\\n customer_token_lifetime\\\\n }\\\\n}\\\\n\\"}": Array [ - Object { - "request": Object { - "query": Object { - "definitions": Array [ - Object { - "directives": Array [], - "kind": "OperationDefinition", - "name": Object { - "kind": "Name", - "value": "SignIn", - }, - "operation": "mutation", - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [ - Object { - "kind": "Argument", - "name": Object { - "kind": "Name", - "value": "email", - }, - "value": Object { - "kind": "Variable", - "name": Object { - "kind": "Name", - "value": "email", - }, - }, - }, - Object { - "kind": "Argument", - "name": Object { - "kind": "Name", - "value": "password", - }, - "value": Object { - "kind": "Variable", - "name": Object { - "kind": "Name", - "value": "password", - }, - }, - }, - ], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "generateCustomerToken", - }, - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "token", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "customer_token_lifetime", - }, - "selectionSet": undefined, - }, - ], - }, - }, - ], - }, - "variableDefinitions": Array [ - Object { - "defaultValue": undefined, - "directives": Array [], - "kind": "VariableDefinition", - "type": Object { - "kind": "NonNullType", - "type": Object { - "kind": "NamedType", - "name": Object { - "kind": "Name", - "value": "String", - }, - }, - }, - "variable": Object { - "kind": "Variable", - "name": Object { - "kind": "Name", - "value": "email", - }, - }, - }, - Object { - "defaultValue": undefined, - "directives": Array [], - "kind": "VariableDefinition", - "type": Object { - "kind": "NonNullType", - "type": Object { - "kind": "NamedType", - "name": Object { - "kind": "Name", - "value": "String", - }, - }, - }, - "variable": Object { - "kind": "Variable", - "name": Object { - "kind": "Name", - "value": "password", - }, - }, - }, - ], - }, - ], - "kind": "Document", - "loc": Object { - "end": 198, - "start": 0, - }, - }, - "variables": Object { - "email": "fry@planetexpress.com", - "password": "slurm is the best", - }, - }, - "result": Object { - "data": Object { - "generateCustomerToken": Object { - "customer_token_lifetime": 3600, - "token": "auth-token-123", - }, - }, - }, - }, - ], - }, - "operation": Object { - "extensions": Object {}, - "operationName": "GetReCaptchaV3Config", - "query": Object { - "definitions": Array [ - Object { - "directives": Array [], - "kind": "OperationDefinition", - "name": Object { - "kind": "Name", - "value": "GetReCaptchaV3Config", - }, - "operation": "query", - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "recaptchaV3Config", - }, - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "website_key", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "badge_position", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "language_code", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "forms", - }, - "selectionSet": undefined, - }, - ], - }, - }, - ], - }, - "variableDefinitions": Array [], - }, - ], - "kind": "Document", - "loc": Object { - "end": 173, - "start": 0, - }, - }, - "variables": Object {}, - }, - }, - "localState": LocalState { - "cache": InMemoryCache { - "addTypename": false, - "config": Object { - "addTypename": false, - "canonizeResults": false, - "dataIdFromObject": [Function], - "resultCaching": true, - }, - "data": Root { - "canRead": [Function], - "data": Object {}, - "getFieldValue": [Function], - "group": CacheGroup { - "caching": true, - "d": [Function], - "keyMaker": Trie { - "makeData": [Function], - "weakness": true, - }, - "parent": null, - }, - "policies": Policies { - "cache": [Circular], - "config": Object { - "cache": [Circular], - "dataIdFromObject": [Function], - "possibleTypes": undefined, - "typePolicies": undefined, - }, - "fuzzySubtypes": Map {}, - "rootIdsByTypename": Object { - "Mutation": "ROOT_MUTATION", - "Query": "ROOT_QUERY", - "Subscription": "ROOT_SUBSCRIPTION", - }, - "rootTypenamesById": Object { - "ROOT_MUTATION": "Mutation", - "ROOT_QUERY": "Query", - "ROOT_SUBSCRIPTION": "Subscription", - }, - "supertypeMap": Map {}, - "toBeAdded": Object {}, - "typePolicies": Object { - "Query": Object { - "fields": Object {}, - }, - }, - "usingPossibleTypes": false, - }, - "refs": Object {}, - "rootIds": Object {}, - "storageTrie": Trie { - "makeData": [Function], - "weakness": true, - }, - "stump": Stump { - "canRead": [Function], - "data": Object {}, - "getFieldValue": [Function], - "group": CacheGroup { - "caching": true, - "d": [Function], - "keyMaker": Trie { - "makeData": [Function], - "weak": WeakMap {}, - "weakness": true, - }, - "parent": CacheGroup { - "caching": true, - "d": [Function], - "keyMaker": Trie { - "makeData": [Function], - "weakness": true, - }, - "parent": null, - }, - }, - "id": "EntityStore.Stump", - "parent": [Circular], - "policies": Policies { - "cache": [Circular], - "config": Object { - "cache": [Circular], - "dataIdFromObject": [Function], - "possibleTypes": undefined, - "typePolicies": undefined, - }, - "fuzzySubtypes": Map {}, - "rootIdsByTypename": Object { - "Mutation": "ROOT_MUTATION", - "Query": "ROOT_QUERY", - "Subscription": "ROOT_SUBSCRIPTION", - }, - "rootTypenamesById": Object { - "ROOT_MUTATION": "Mutation", - "ROOT_QUERY": "Query", - "ROOT_SUBSCRIPTION": "Subscription", - }, - "supertypeMap": Map {}, - "toBeAdded": Object {}, - "typePolicies": Object { - "Query": Object { - "fields": Object {}, - }, - }, - "usingPossibleTypes": false, - }, - "refs": Object {}, - "replay": [Function], - "rootIds": Object {}, - "toReference": [Function], - }, - "toReference": [Function], - }, - "evict": [Function], - "getFragmentDoc": [Function], - "makeVar": [Function], - "maybeBroadcastWatch": [Function], - "modify": [Function], - "optimisticData": Stump { - "canRead": [Function], - "data": Object {}, - "getFieldValue": [Function], - "group": CacheGroup { - "caching": true, - "d": [Function], - "keyMaker": Trie { - "makeData": [Function], - "weak": WeakMap {}, - "weakness": true, - }, - "parent": CacheGroup { - "caching": true, - "d": [Function], - "keyMaker": Trie { - "makeData": [Function], - "weakness": true, - }, - "parent": null, - }, - }, - "id": "EntityStore.Stump", - "parent": Root { - "canRead": [Function], - "data": Object {}, - "getFieldValue": [Function], - "group": CacheGroup { - "caching": true, - "d": [Function], - "keyMaker": Trie { - "makeData": [Function], - "weakness": true, - }, - "parent": null, - }, - "policies": Policies { - "cache": [Circular], - "config": Object { - "cache": [Circular], - "dataIdFromObject": [Function], - "possibleTypes": undefined, - "typePolicies": undefined, - }, - "fuzzySubtypes": Map {}, - "rootIdsByTypename": Object { - "Mutation": "ROOT_MUTATION", - "Query": "ROOT_QUERY", - "Subscription": "ROOT_SUBSCRIPTION", - }, - "rootTypenamesById": Object { - "ROOT_MUTATION": "Mutation", - "ROOT_QUERY": "Query", - "ROOT_SUBSCRIPTION": "Subscription", - }, - "supertypeMap": Map {}, - "toBeAdded": Object {}, - "typePolicies": Object { - "Query": Object { - "fields": Object {}, - }, - }, - "usingPossibleTypes": false, - }, - "refs": Object {}, - "rootIds": Object {}, - "storageTrie": Trie { - "makeData": [Function], - "weakness": true, - }, - "stump": [Circular], - "toReference": [Function], - }, - "policies": Policies { - "cache": [Circular], - "config": Object { - "cache": [Circular], - "dataIdFromObject": [Function], - "possibleTypes": undefined, - "typePolicies": undefined, - }, - "fuzzySubtypes": Map {}, - "rootIdsByTypename": Object { - "Mutation": "ROOT_MUTATION", - "Query": "ROOT_QUERY", - "Subscription": "ROOT_SUBSCRIPTION", - }, - "rootTypenamesById": Object { - "ROOT_MUTATION": "Mutation", - "ROOT_QUERY": "Query", - "ROOT_SUBSCRIPTION": "Subscription", - }, - "supertypeMap": Map {}, - "toBeAdded": Object {}, - "typePolicies": Object { - "Query": Object { - "fields": Object {}, - }, - }, - "usingPossibleTypes": false, - }, - "refs": Object {}, - "replay": [Function], - "rootIds": Object {}, - "toReference": [Function], - }, - "policies": Policies { - "cache": [Circular], - "config": Object { - "cache": [Circular], - "dataIdFromObject": [Function], - "possibleTypes": undefined, - "typePolicies": undefined, - }, - "fuzzySubtypes": Map {}, - "rootIdsByTypename": Object { - "Mutation": "ROOT_MUTATION", - "Query": "ROOT_QUERY", - "Subscription": "ROOT_SUBSCRIPTION", - }, - "rootTypenamesById": Object { - "ROOT_MUTATION": "Mutation", - "ROOT_QUERY": "Query", - "ROOT_SUBSCRIPTION": "Subscription", - }, - "supertypeMap": Map {}, - "toBeAdded": Object {}, - "typePolicies": Object { - "Query": Object { - "fields": Object {}, - }, - }, - "usingPossibleTypes": false, - }, - "reset": [Function], - "storeReader": StoreReader { - "canon": ObjectCanon { - "empty": Object {}, - "keysByJSON": Map { - "[]" => Object { - "json": "[]", - "sorted": Array [], - }, - }, - "known": WeakSet {}, - "passes": WeakMap {}, - "pool": Trie { - "data": Object { - "keys": Object { - "json": "[]", - "sorted": Array [], - }, - }, - "makeData": [Function], - "weak": WeakMap {}, - "weakness": true, - }, - }, - "config": Object { - "addTypename": false, - "cache": [Circular], - "canonizeResults": false, - }, - "executeSelectionSet": [Function], - "executeSubSelectedArray": [Function], - "knownResults": WeakMap {}, - }, - "storeWriter": StoreWriter { - "cache": [Circular], - "reader": StoreReader { - "canon": ObjectCanon { - "empty": Object {}, - "keysByJSON": Map { - "[]" => Object { - "json": "[]", - "sorted": Array [], - }, - }, - "known": WeakSet {}, - "passes": WeakMap {}, - "pool": Trie { - "data": Object { - "keys": Object { - "json": "[]", - "sorted": Array [], - }, - }, - "makeData": [Function], - "weak": WeakMap {}, - "weakness": true, - }, - }, - "config": Object { - "addTypename": false, - "cache": [Circular], - "canonizeResults": false, - }, - "executeSelectionSet": [Function], - "executeSubSelectedArray": [Function], - "knownResults": WeakMap {}, - }, - }, - "txCount": 0, - "typenameDocumentCache": Map {}, - "watches": Set { - Object { - "callback": [Function], - "canonizeResults": undefined, - "optimistic": true, - "query": Object { - "definitions": Array [ - Object { - "directives": Array [], - "kind": "OperationDefinition", - "name": Object { - "kind": "Name", - "value": "GetReCaptchaV3Config", - }, - "operation": "query", - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "recaptchaV3Config", - }, - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "website_key", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "badge_position", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "language_code", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "forms", - }, - "selectionSet": undefined, - }, - ], - }, - }, - ], - }, - "variableDefinitions": Array [], - }, - ], - "kind": "Document", - "loc": Object { - "end": 173, - "start": 0, - }, - }, - "returnPartialData": true, - "variables": Object {}, - "watcher": QueryInfo { - "cache": [Circular], - "cancel": [Function], - "dirty": false, - "document": Object { - "definitions": Array [ - Object { - "directives": Array [], - "kind": "OperationDefinition", - "name": Object { - "kind": "Name", - "value": "GetReCaptchaV3Config", - }, - "operation": "query", - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "recaptchaV3Config", - }, - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "website_key", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "badge_position", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "language_code", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "forms", - }, - "selectionSet": undefined, - }, - ], - }, - }, - ], - }, - "variableDefinitions": Array [], - }, - ], - "kind": "Document", - "loc": Object { - "end": 173, - "start": 0, - }, - }, - "graphQLErrors": Array [], - "lastDiff": Object { - "diff": Object { - "complete": false, - "missing": Array [ - MissingFieldError { - "message": "Can't find field 'recaptchaV3Config' on ROOT_QUERY object", - "path": Object { - "recaptchaV3Config": "Can't find field 'recaptchaV3Config' on ROOT_QUERY object", - }, - "query": Object { - "definitions": Array [ - Object { - "directives": Array [], - "kind": "OperationDefinition", - "name": Object { - "kind": "Name", - "value": "GetReCaptchaV3Config", - }, - "operation": "query", - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "recaptchaV3Config", - }, - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "website_key", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "badge_position", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "language_code", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "forms", - }, - "selectionSet": undefined, - }, - ], - }, - }, - ], - }, - "variableDefinitions": Array [], - }, - ], - "kind": "Document", - "loc": Object { - "end": 173, - "start": 0, - }, - }, - "variables": Object {}, - }, - ], - "result": Object {}, - }, - "options": Object { - "canonizeResults": undefined, - "optimistic": true, - "query": Object { - "definitions": Array [ - Object { - "directives": Array [], - "kind": "OperationDefinition", - "name": Object { - "kind": "Name", - "value": "GetReCaptchaV3Config", - }, - "operation": "query", - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "recaptchaV3Config", - }, - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "website_key", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "badge_position", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "language_code", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "forms", - }, - "selectionSet": undefined, - }, - ], - }, - }, - ], - }, - "variableDefinitions": Array [], - }, - ], - "kind": "Document", - "loc": Object { - "end": 173, - "start": 0, - }, - }, - "returnPartialData": true, - "variables": Object {}, - }, - }, - "lastRequestId": 1, - "lastWatch": [Circular], - "listeners": Set { - [Function], - }, - "networkError": null, - "networkStatus": 1, - "observableQuery": ObservableQuery { - "_subscriber": [Function], - "concast": Concast { - "_subscriber": [Function], - "addCount": 1, - "cancel": [Function], - "handlers": Object { - "complete": [Function], - "error": [Function], - "next": [Function], - }, - "observers": Set { - Object { - "complete": [Function], - "error": [Function], - "next": [Function], - }, - Object { - "error": [Function], - "next": [Function], - }, - }, - "promise": Promise {}, - "reject": [Function], - "resolve": [Function], - "sources": Array [], - "sub": Subscription { - "_cleanup": [Function], - "_observer": Object { - "complete": [Function], - "error": [Function], - "next": [Function], - }, - "_queue": undefined, - "_state": "ready", - }, - }, - "initialFetchPolicy": "cache-and-network", - "isTornDown": false, - "last": Object { - "result": Object { - "loading": true, - "networkStatus": 1, - "partial": true, - }, - "variables": Object {}, - }, - "observer": Object { - "error": [Function], - "next": [Function], - }, - "observers": Set { - SubscriptionObserver { - "_subscription": Subscription { - "_cleanup": [Function], - "_observer": Object { - "complete": undefined, - "error": [Function], - "next": [Function], - }, - "_queue": Array [ - Object { - "type": "next", - "value": Object { - "loading": true, - "networkStatus": 1, - "partial": true, - }, - }, - ], - "_state": "buffering", - }, - }, - }, - "options": Object { - "fetchPolicy": "cache-and-network", - "notifyOnNetworkStatusChange": false, - "query": Object { - "definitions": Array [ - Object { - "directives": Array [], - "kind": "OperationDefinition", - "name": Object { - "kind": "Name", - "value": "GetReCaptchaV3Config", - }, - "operation": "query", - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "recaptchaV3Config", - }, - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "website_key", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "badge_position", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "language_code", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "forms", - }, - "selectionSet": undefined, - }, - ], - }, - }, - ], - }, - "variableDefinitions": Array [], - }, - ], - "kind": "Document", - "loc": Object { - "end": 173, - "start": 0, - }, - }, - "variables": Object {}, - }, - "queryId": "1", - "queryInfo": [Circular], - "queryManager": QueryManager { - "assumeImmutableResults": false, - "cache": [Circular], - "clientAwareness": Object { - "name": undefined, - "version": undefined, - }, - "fetchCancelFns": Map { - "1" => [Function], - }, - "inFlightLinkObservables": Map { - Object { - "definitions": Array [ - Object { - "directives": Array [], - "kind": "OperationDefinition", - "name": Object { - "kind": "Name", - "value": "GetReCaptchaV3Config", - }, - "operation": "query", - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "recaptchaV3Config", - }, - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "website_key", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "badge_position", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "language_code", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "forms", - }, - "selectionSet": undefined, - }, - ], - }, - }, - ], - }, - "variableDefinitions": Array [], - }, - ], - "kind": "Document", - "loc": Object { - "end": 173, - "start": 0, - }, - } => Map { - "{}" => Concast { - "_subscriber": [Function], - "addCount": 1, - "cancel": [Function], - "handlers": Object { - "complete": [Function], - "error": [Function], - "next": [Function], - }, - "observers": Set { - Object { - "complete": [Function], - "error": [Function], - "next": [Function], - }, - SubscriptionObserver { - "_subscription": Subscription { - "_cleanup": [Function], - "_observer": Object { - "complete": [Function], - "error": [Function], - "next": [Function], - }, - "_queue": undefined, - "_state": "ready", - }, - }, - }, - "promise": Promise {}, - "reject": [Function], - "resolve": [Function], - "sources": Array [], - "sub": Subscription { - "_cleanup": [Function], - "_observer": Object { - "complete": [Function], - "error": [Function], - "next": [Function], - }, - "_queue": undefined, - "_state": "ready", - }, - }, - }, - }, - "link": MockLink { - "addTypename": false, - "mockedResponsesByKey": Object { - "{\\"query\\":\\"mutation MergeCartsAfterSignIn($sourceCartId: String!, $destinationCartId: String!) {\\\\n mergeCarts(\\\\n source_cart_id: $sourceCartId\\\\n destination_cart_id: $destinationCartId\\\\n ) {\\\\n id\\\\n items {\\\\n uid\\\\n }\\\\n ...CheckoutPageFragment\\\\n }\\\\n}\\\\n\\\\nfragment CheckoutPageFragment on Cart {\\\\n id\\\\n items {\\\\n uid\\\\n product {\\\\n uid\\\\n stock_status\\\\n }\\\\n }\\\\n total_quantity\\\\n available_payment_methods {\\\\n code\\\\n }\\\\n}\\\\n\\"}": Array [ - Object { - "request": Object { - "query": Object { - "definitions": Array [ - Object { - "directives": Array [], - "kind": "OperationDefinition", - "name": Object { - "kind": "Name", - "value": "MergeCartsAfterSignIn", - }, - "operation": "mutation", - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [ - Object { - "kind": "Argument", - "name": Object { - "kind": "Name", - "value": "source_cart_id", - }, - "value": Object { - "kind": "Variable", - "name": Object { - "kind": "Name", - "value": "sourceCartId", - }, - }, - }, - Object { - "kind": "Argument", - "name": Object { - "kind": "Name", - "value": "destination_cart_id", - }, - "value": Object { - "kind": "Variable", - "name": Object { - "kind": "Name", - "value": "destinationCartId", - }, - }, - }, - ], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "mergeCarts", - }, - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "id", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "items", - }, - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "uid", - }, - "selectionSet": undefined, - }, - ], - }, - }, - Object { - "directives": Array [], - "kind": "FragmentSpread", - "name": Object { - "kind": "Name", - "value": "CheckoutPageFragment", - }, - }, - ], - }, - }, - ], - }, - "variableDefinitions": Array [ - Object { - "defaultValue": undefined, - "directives": Array [], - "kind": "VariableDefinition", - "type": Object { - "kind": "NonNullType", - "type": Object { - "kind": "NamedType", - "name": Object { - "kind": "Name", - "value": "String", - }, - }, - }, - "variable": Object { - "kind": "Variable", - "name": Object { - "kind": "Name", - "value": "sourceCartId", - }, - }, - }, - Object { - "defaultValue": undefined, - "directives": Array [], - "kind": "VariableDefinition", - "type": Object { - "kind": "NonNullType", - "type": Object { - "kind": "NamedType", - "name": Object { - "kind": "Name", - "value": "String", - }, - }, - }, - "variable": Object { - "kind": "Variable", - "name": Object { - "kind": "Name", - "value": "destinationCartId", - }, - }, - }, - ], - }, - Object { - "directives": Array [], - "kind": "FragmentDefinition", - "name": Object { - "kind": "Name", - "value": "CheckoutPageFragment", - }, - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "id", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "items", - }, - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "uid", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "product", - }, - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "uid", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "stock_status", - }, - "selectionSet": undefined, - }, - ], - }, - }, - ], - }, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "total_quantity", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "available_payment_methods", - }, - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "code", - }, - "selectionSet": undefined, - }, - ], - }, - }, - ], - }, - "typeCondition": Object { - "kind": "NamedType", - "name": Object { - "kind": "Name", - "value": "Cart", - }, - }, - }, - ], - "kind": "Document", - "loc": Object { - "end": 932, - "start": 0, - }, - }, - "variables": Object { - "destinationCartId": "new-cart-id", - "sourceCartId": "old-cart-id", - }, - }, - "result": Object { - "data": null, - }, - }, - ], - "{\\"query\\":\\"mutation SignIn($email: String!, $password: String!) {\\\\n generateCustomerToken(email: $email, password: $password) {\\\\n token\\\\n customer_token_lifetime\\\\n }\\\\n}\\\\n\\"}": Array [ - Object { - "request": Object { - "query": Object { - "definitions": Array [ - Object { - "directives": Array [], - "kind": "OperationDefinition", - "name": Object { - "kind": "Name", - "value": "SignIn", - }, - "operation": "mutation", - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [ - Object { - "kind": "Argument", - "name": Object { - "kind": "Name", - "value": "email", - }, - "value": Object { - "kind": "Variable", - "name": Object { - "kind": "Name", - "value": "email", - }, - }, - }, - Object { - "kind": "Argument", - "name": Object { - "kind": "Name", - "value": "password", - }, - "value": Object { - "kind": "Variable", - "name": Object { - "kind": "Name", - "value": "password", - }, - }, - }, - ], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "generateCustomerToken", - }, - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "token", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "customer_token_lifetime", - }, - "selectionSet": undefined, - }, - ], - }, - }, - ], - }, - "variableDefinitions": Array [ - Object { - "defaultValue": undefined, - "directives": Array [], - "kind": "VariableDefinition", - "type": Object { - "kind": "NonNullType", - "type": Object { - "kind": "NamedType", - "name": Object { - "kind": "Name", - "value": "String", - }, - }, - }, - "variable": Object { - "kind": "Variable", - "name": Object { - "kind": "Name", - "value": "email", - }, - }, - }, - Object { - "defaultValue": undefined, - "directives": Array [], - "kind": "VariableDefinition", - "type": Object { - "kind": "NonNullType", - "type": Object { - "kind": "NamedType", - "name": Object { - "kind": "Name", - "value": "String", - }, - }, - }, - "variable": Object { - "kind": "Variable", - "name": Object { - "kind": "Name", - "value": "password", - }, - }, - }, - ], - }, - ], - "kind": "Document", - "loc": Object { - "end": 198, - "start": 0, - }, - }, - "variables": Object { - "email": "fry@planetexpress.com", - "password": "slurm is the best", - }, - }, - "result": Object { - "data": Object { - "generateCustomerToken": Object { - "customer_token_lifetime": 3600, - "token": "auth-token-123", - }, - }, - }, - }, - ], - }, - "operation": Object { - "extensions": Object {}, - "operationName": "GetReCaptchaV3Config", - "query": Object { - "definitions": Array [ - Object { - "directives": Array [], - "kind": "OperationDefinition", - "name": Object { - "kind": "Name", - "value": "GetReCaptchaV3Config", - }, - "operation": "query", - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "recaptchaV3Config", - }, - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "website_key", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "badge_position", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "language_code", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "forms", - }, - "selectionSet": undefined, - }, - ], - }, - }, - ], - }, - "variableDefinitions": Array [], - }, - ], - "kind": "Document", - "loc": Object { - "end": 173, - "start": 0, - }, - }, - "variables": Object {}, - }, - }, - "localState": [Circular], - "mutationIdCounter": 1, - "mutationStore": Object {}, - "onBroadcast": [Function], - "queries": Map { - "1" => [Circular], - }, - "queryDeduplication": true, - "queryIdCounter": 2, - "requestIdCounter": 2, - "ssrMode": false, - "transformCache": WeakMap {}, - }, - "queryName": "GetReCaptchaV3Config", - "subscriptions": Set {}, - }, - "oqListener": [Function], - "queryId": "1", - "stopped": false, - "subscriptions": Set {}, - "variables": Object {}, - }, - }, - }, - }, - "client": [Circular], - }, - "mutate": [Function], - "query": [Function], - "queryDeduplication": true, - "queryManager": QueryManager { - "assumeImmutableResults": false, - "cache": InMemoryCache { - "addTypename": false, - "config": Object { - "addTypename": false, - "canonizeResults": false, - "dataIdFromObject": [Function], - "resultCaching": true, - }, - "data": Root { - "canRead": [Function], - "data": Object {}, - "getFieldValue": [Function], - "group": CacheGroup { - "caching": true, - "d": [Function], - "keyMaker": Trie { - "makeData": [Function], - "weakness": true, - }, - "parent": null, - }, - "policies": Policies { - "cache": [Circular], - "config": Object { - "cache": [Circular], - "dataIdFromObject": [Function], - "possibleTypes": undefined, - "typePolicies": undefined, - }, - "fuzzySubtypes": Map {}, - "rootIdsByTypename": Object { - "Mutation": "ROOT_MUTATION", - "Query": "ROOT_QUERY", - "Subscription": "ROOT_SUBSCRIPTION", - }, - "rootTypenamesById": Object { - "ROOT_MUTATION": "Mutation", - "ROOT_QUERY": "Query", - "ROOT_SUBSCRIPTION": "Subscription", - }, - "supertypeMap": Map {}, - "toBeAdded": Object {}, - "typePolicies": Object { - "Query": Object { - "fields": Object {}, - }, - }, - "usingPossibleTypes": false, - }, - "refs": Object {}, - "rootIds": Object {}, - "storageTrie": Trie { - "makeData": [Function], - "weakness": true, - }, - "stump": Stump { - "canRead": [Function], - "data": Object {}, - "getFieldValue": [Function], - "group": CacheGroup { - "caching": true, - "d": [Function], - "keyMaker": Trie { - "makeData": [Function], - "weak": WeakMap {}, - "weakness": true, - }, - "parent": CacheGroup { - "caching": true, - "d": [Function], - "keyMaker": Trie { - "makeData": [Function], - "weakness": true, - }, - "parent": null, - }, - }, - "id": "EntityStore.Stump", - "parent": [Circular], - "policies": Policies { - "cache": [Circular], - "config": Object { - "cache": [Circular], - "dataIdFromObject": [Function], - "possibleTypes": undefined, - "typePolicies": undefined, - }, - "fuzzySubtypes": Map {}, - "rootIdsByTypename": Object { - "Mutation": "ROOT_MUTATION", - "Query": "ROOT_QUERY", - "Subscription": "ROOT_SUBSCRIPTION", - }, - "rootTypenamesById": Object { - "ROOT_MUTATION": "Mutation", - "ROOT_QUERY": "Query", - "ROOT_SUBSCRIPTION": "Subscription", - }, - "supertypeMap": Map {}, - "toBeAdded": Object {}, - "typePolicies": Object { - "Query": Object { - "fields": Object {}, - }, - }, - "usingPossibleTypes": false, - }, - "refs": Object {}, - "replay": [Function], - "rootIds": Object {}, - "toReference": [Function], - }, - "toReference": [Function], - }, - "evict": [Function], - "getFragmentDoc": [Function], - "makeVar": [Function], - "maybeBroadcastWatch": [Function], - "modify": [Function], - "optimisticData": Stump { - "canRead": [Function], - "data": Object {}, - "getFieldValue": [Function], - "group": CacheGroup { - "caching": true, - "d": [Function], - "keyMaker": Trie { - "makeData": [Function], - "weak": WeakMap {}, - "weakness": true, - }, - "parent": CacheGroup { - "caching": true, - "d": [Function], - "keyMaker": Trie { - "makeData": [Function], - "weakness": true, - }, - "parent": null, - }, - }, - "id": "EntityStore.Stump", - "parent": Root { - "canRead": [Function], - "data": Object {}, - "getFieldValue": [Function], - "group": CacheGroup { - "caching": true, - "d": [Function], - "keyMaker": Trie { - "makeData": [Function], - "weakness": true, - }, - "parent": null, - }, - "policies": Policies { - "cache": [Circular], - "config": Object { - "cache": [Circular], - "dataIdFromObject": [Function], - "possibleTypes": undefined, - "typePolicies": undefined, - }, - "fuzzySubtypes": Map {}, - "rootIdsByTypename": Object { - "Mutation": "ROOT_MUTATION", - "Query": "ROOT_QUERY", - "Subscription": "ROOT_SUBSCRIPTION", - }, - "rootTypenamesById": Object { - "ROOT_MUTATION": "Mutation", - "ROOT_QUERY": "Query", - "ROOT_SUBSCRIPTION": "Subscription", - }, - "supertypeMap": Map {}, - "toBeAdded": Object {}, - "typePolicies": Object { - "Query": Object { - "fields": Object {}, - }, - }, - "usingPossibleTypes": false, - }, - "refs": Object {}, - "rootIds": Object {}, - "storageTrie": Trie { - "makeData": [Function], - "weakness": true, - }, - "stump": [Circular], - "toReference": [Function], - }, - "policies": Policies { - "cache": [Circular], - "config": Object { - "cache": [Circular], - "dataIdFromObject": [Function], - "possibleTypes": undefined, - "typePolicies": undefined, - }, - "fuzzySubtypes": Map {}, - "rootIdsByTypename": Object { - "Mutation": "ROOT_MUTATION", - "Query": "ROOT_QUERY", - "Subscription": "ROOT_SUBSCRIPTION", - }, - "rootTypenamesById": Object { - "ROOT_MUTATION": "Mutation", - "ROOT_QUERY": "Query", - "ROOT_SUBSCRIPTION": "Subscription", - }, - "supertypeMap": Map {}, - "toBeAdded": Object {}, - "typePolicies": Object { - "Query": Object { - "fields": Object {}, - }, - }, - "usingPossibleTypes": false, - }, - "refs": Object {}, - "replay": [Function], - "rootIds": Object {}, - "toReference": [Function], - }, - "policies": Policies { - "cache": [Circular], - "config": Object { - "cache": [Circular], - "dataIdFromObject": [Function], - "possibleTypes": undefined, - "typePolicies": undefined, - }, - "fuzzySubtypes": Map {}, - "rootIdsByTypename": Object { - "Mutation": "ROOT_MUTATION", - "Query": "ROOT_QUERY", - "Subscription": "ROOT_SUBSCRIPTION", - }, - "rootTypenamesById": Object { - "ROOT_MUTATION": "Mutation", - "ROOT_QUERY": "Query", - "ROOT_SUBSCRIPTION": "Subscription", - }, - "supertypeMap": Map {}, - "toBeAdded": Object {}, - "typePolicies": Object { - "Query": Object { - "fields": Object {}, - }, - }, - "usingPossibleTypes": false, - }, - "reset": [Function], - "storeReader": StoreReader { - "canon": ObjectCanon { - "empty": Object {}, - "keysByJSON": Map { - "[]" => Object { - "json": "[]", - "sorted": Array [], - }, - }, - "known": WeakSet {}, - "passes": WeakMap {}, - "pool": Trie { - "data": Object { - "keys": Object { - "json": "[]", - "sorted": Array [], - }, - }, - "makeData": [Function], - "weak": WeakMap {}, - "weakness": true, - }, - }, - "config": Object { - "addTypename": false, - "cache": [Circular], - "canonizeResults": false, - }, - "executeSelectionSet": [Function], - "executeSubSelectedArray": [Function], - "knownResults": WeakMap {}, - }, - "storeWriter": StoreWriter { - "cache": [Circular], - "reader": StoreReader { - "canon": ObjectCanon { - "empty": Object {}, - "keysByJSON": Map { - "[]" => Object { - "json": "[]", - "sorted": Array [], - }, - }, - "known": WeakSet {}, - "passes": WeakMap {}, - "pool": Trie { - "data": Object { - "keys": Object { - "json": "[]", - "sorted": Array [], - }, - }, - "makeData": [Function], - "weak": WeakMap {}, - "weakness": true, - }, - }, - "config": Object { - "addTypename": false, - "cache": [Circular], - "canonizeResults": false, - }, - "executeSelectionSet": [Function], - "executeSubSelectedArray": [Function], - "knownResults": WeakMap {}, - }, - }, - "txCount": 0, - "typenameDocumentCache": Map {}, - "watches": Set { - Object { - "callback": [Function], - "canonizeResults": undefined, - "optimistic": true, - "query": Object { - "definitions": Array [ - Object { - "directives": Array [], - "kind": "OperationDefinition", - "name": Object { - "kind": "Name", - "value": "GetReCaptchaV3Config", - }, - "operation": "query", - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "recaptchaV3Config", - }, - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "website_key", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "badge_position", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "language_code", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "forms", - }, - "selectionSet": undefined, - }, - ], - }, - }, - ], - }, - "variableDefinitions": Array [], - }, - ], - "kind": "Document", - "loc": Object { - "end": 173, - "start": 0, - }, - }, - "returnPartialData": true, - "variables": Object {}, - "watcher": QueryInfo { - "cache": [Circular], - "cancel": [Function], - "dirty": false, - "document": Object { - "definitions": Array [ - Object { - "directives": Array [], - "kind": "OperationDefinition", - "name": Object { - "kind": "Name", - "value": "GetReCaptchaV3Config", - }, - "operation": "query", - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "recaptchaV3Config", - }, - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "website_key", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "badge_position", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "language_code", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "forms", - }, - "selectionSet": undefined, - }, - ], - }, - }, - ], - }, - "variableDefinitions": Array [], - }, - ], - "kind": "Document", - "loc": Object { - "end": 173, - "start": 0, - }, - }, - "graphQLErrors": Array [], - "lastDiff": Object { - "diff": Object { - "complete": false, - "missing": Array [ - MissingFieldError { - "message": "Can't find field 'recaptchaV3Config' on ROOT_QUERY object", - "path": Object { - "recaptchaV3Config": "Can't find field 'recaptchaV3Config' on ROOT_QUERY object", - }, - "query": Object { - "definitions": Array [ - Object { - "directives": Array [], - "kind": "OperationDefinition", - "name": Object { - "kind": "Name", - "value": "GetReCaptchaV3Config", - }, - "operation": "query", - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "recaptchaV3Config", - }, - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "website_key", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "badge_position", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "language_code", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "forms", - }, - "selectionSet": undefined, - }, - ], - }, - }, - ], - }, - "variableDefinitions": Array [], - }, - ], - "kind": "Document", - "loc": Object { - "end": 173, - "start": 0, - }, - }, - "variables": Object {}, - }, - ], - "result": Object {}, - }, - "options": Object { - "canonizeResults": undefined, - "optimistic": true, - "query": Object { - "definitions": Array [ - Object { - "directives": Array [], - "kind": "OperationDefinition", - "name": Object { - "kind": "Name", - "value": "GetReCaptchaV3Config", - }, - "operation": "query", - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "recaptchaV3Config", - }, - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "website_key", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "badge_position", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "language_code", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "forms", - }, - "selectionSet": undefined, - }, - ], - }, - }, - ], - }, - "variableDefinitions": Array [], - }, - ], - "kind": "Document", - "loc": Object { - "end": 173, - "start": 0, - }, - }, - "returnPartialData": true, - "variables": Object {}, - }, - }, - "lastRequestId": 1, - "lastWatch": [Circular], - "listeners": Set { - [Function], - }, - "networkError": null, - "networkStatus": 1, - "observableQuery": ObservableQuery { - "_subscriber": [Function], - "concast": Concast { - "_subscriber": [Function], - "addCount": 1, - "cancel": [Function], - "handlers": Object { - "complete": [Function], - "error": [Function], - "next": [Function], - }, - "observers": Set { - Object { - "complete": [Function], - "error": [Function], - "next": [Function], - }, - Object { - "error": [Function], - "next": [Function], - }, - }, - "promise": Promise {}, - "reject": [Function], - "resolve": [Function], - "sources": Array [], - "sub": Subscription { - "_cleanup": [Function], - "_observer": Object { - "complete": [Function], - "error": [Function], - "next": [Function], - }, - "_queue": undefined, - "_state": "ready", - }, - }, - "initialFetchPolicy": "cache-and-network", - "isTornDown": false, - "last": Object { - "result": Object { - "loading": true, - "networkStatus": 1, - "partial": true, - }, - "variables": Object {}, - }, - "observer": Object { - "error": [Function], - "next": [Function], - }, - "observers": Set { - SubscriptionObserver { - "_subscription": Subscription { - "_cleanup": [Function], - "_observer": Object { - "complete": undefined, - "error": [Function], - "next": [Function], - }, - "_queue": Array [ - Object { - "type": "next", - "value": Object { - "loading": true, - "networkStatus": 1, - "partial": true, - }, - }, - ], - "_state": "buffering", - }, - }, - }, - "options": Object { - "fetchPolicy": "cache-and-network", - "notifyOnNetworkStatusChange": false, - "query": Object { - "definitions": Array [ - Object { - "directives": Array [], - "kind": "OperationDefinition", - "name": Object { - "kind": "Name", - "value": "GetReCaptchaV3Config", - }, - "operation": "query", - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "recaptchaV3Config", - }, - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "website_key", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "badge_position", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "language_code", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "forms", - }, - "selectionSet": undefined, - }, - ], - }, - }, - ], - }, - "variableDefinitions": Array [], - }, - ], - "kind": "Document", - "loc": Object { - "end": 173, - "start": 0, - }, - }, - "variables": Object {}, - }, - "queryId": "1", - "queryInfo": [Circular], - "queryManager": [Circular], - "queryName": "GetReCaptchaV3Config", - "subscriptions": Set {}, - }, - "oqListener": [Function], - "queryId": "1", - "stopped": false, - "subscriptions": Set {}, - "variables": Object {}, - }, - }, - }, - }, - "clientAwareness": Object { - "name": undefined, - "version": undefined, - }, - "fetchCancelFns": Map { - "1" => [Function], - }, - "inFlightLinkObservables": Map { - Object { - "definitions": Array [ - Object { - "directives": Array [], - "kind": "OperationDefinition", - "name": Object { - "kind": "Name", - "value": "GetReCaptchaV3Config", - }, - "operation": "query", - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "recaptchaV3Config", - }, - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "website_key", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "badge_position", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "language_code", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "forms", - }, - "selectionSet": undefined, - }, - ], - }, - }, - ], - }, - "variableDefinitions": Array [], - }, - ], - "kind": "Document", - "loc": Object { - "end": 173, - "start": 0, - }, - } => Map { - "{}" => Concast { - "_subscriber": [Function], - "addCount": 1, - "cancel": [Function], - "handlers": Object { - "complete": [Function], - "error": [Function], - "next": [Function], - }, - "observers": Set { - Object { - "complete": [Function], - "error": [Function], - "next": [Function], - }, - SubscriptionObserver { - "_subscription": Subscription { - "_cleanup": [Function], - "_observer": Object { - "complete": [Function], - "error": [Function], - "next": [Function], - }, - "_queue": undefined, - "_state": "ready", - }, - }, - }, - "promise": Promise {}, - "reject": [Function], - "resolve": [Function], - "sources": Array [], - "sub": Subscription { - "_cleanup": [Function], - "_observer": Object { - "complete": [Function], - "error": [Function], - "next": [Function], - }, - "_queue": undefined, - "_state": "ready", - }, - }, - }, - }, - "link": MockLink { - "addTypename": false, - "mockedResponsesByKey": Object { - "{\\"query\\":\\"mutation MergeCartsAfterSignIn($sourceCartId: String!, $destinationCartId: String!) {\\\\n mergeCarts(\\\\n source_cart_id: $sourceCartId\\\\n destination_cart_id: $destinationCartId\\\\n ) {\\\\n id\\\\n items {\\\\n uid\\\\n }\\\\n ...CheckoutPageFragment\\\\n }\\\\n}\\\\n\\\\nfragment CheckoutPageFragment on Cart {\\\\n id\\\\n items {\\\\n uid\\\\n product {\\\\n uid\\\\n stock_status\\\\n }\\\\n }\\\\n total_quantity\\\\n available_payment_methods {\\\\n code\\\\n }\\\\n}\\\\n\\"}": Array [ - Object { - "request": Object { - "query": Object { - "definitions": Array [ - Object { - "directives": Array [], - "kind": "OperationDefinition", - "name": Object { - "kind": "Name", - "value": "MergeCartsAfterSignIn", - }, - "operation": "mutation", - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [ - Object { - "kind": "Argument", - "name": Object { - "kind": "Name", - "value": "source_cart_id", - }, - "value": Object { - "kind": "Variable", - "name": Object { - "kind": "Name", - "value": "sourceCartId", - }, - }, - }, - Object { - "kind": "Argument", - "name": Object { - "kind": "Name", - "value": "destination_cart_id", - }, - "value": Object { - "kind": "Variable", - "name": Object { - "kind": "Name", - "value": "destinationCartId", - }, - }, - }, - ], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "mergeCarts", - }, - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "id", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "items", - }, - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "uid", - }, - "selectionSet": undefined, - }, - ], - }, - }, - Object { - "directives": Array [], - "kind": "FragmentSpread", - "name": Object { - "kind": "Name", - "value": "CheckoutPageFragment", - }, - }, - ], - }, - }, - ], - }, - "variableDefinitions": Array [ - Object { - "defaultValue": undefined, - "directives": Array [], - "kind": "VariableDefinition", - "type": Object { - "kind": "NonNullType", - "type": Object { - "kind": "NamedType", - "name": Object { - "kind": "Name", - "value": "String", - }, - }, - }, - "variable": Object { - "kind": "Variable", - "name": Object { - "kind": "Name", - "value": "sourceCartId", - }, - }, - }, - Object { - "defaultValue": undefined, - "directives": Array [], - "kind": "VariableDefinition", - "type": Object { - "kind": "NonNullType", - "type": Object { - "kind": "NamedType", - "name": Object { - "kind": "Name", - "value": "String", - }, - }, - }, - "variable": Object { - "kind": "Variable", - "name": Object { - "kind": "Name", - "value": "destinationCartId", - }, - }, - }, - ], - }, - Object { - "directives": Array [], - "kind": "FragmentDefinition", - "name": Object { - "kind": "Name", - "value": "CheckoutPageFragment", - }, - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "id", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "items", - }, - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "uid", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "product", - }, - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "uid", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "stock_status", - }, - "selectionSet": undefined, - }, - ], - }, - }, - ], - }, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "total_quantity", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "available_payment_methods", - }, - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "code", - }, - "selectionSet": undefined, - }, - ], - }, - }, - ], - }, - "typeCondition": Object { - "kind": "NamedType", - "name": Object { - "kind": "Name", - "value": "Cart", - }, - }, - }, - ], - "kind": "Document", - "loc": Object { - "end": 932, - "start": 0, - }, - }, - "variables": Object { - "destinationCartId": "new-cart-id", - "sourceCartId": "old-cart-id", - }, - }, - "result": Object { - "data": null, - }, - }, - ], - "{\\"query\\":\\"mutation SignIn($email: String!, $password: String!) {\\\\n generateCustomerToken(email: $email, password: $password) {\\\\n token\\\\n customer_token_lifetime\\\\n }\\\\n}\\\\n\\"}": Array [ - Object { - "request": Object { - "query": Object { - "definitions": Array [ - Object { - "directives": Array [], - "kind": "OperationDefinition", - "name": Object { - "kind": "Name", - "value": "SignIn", - }, - "operation": "mutation", - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [ - Object { - "kind": "Argument", - "name": Object { - "kind": "Name", - "value": "email", - }, - "value": Object { - "kind": "Variable", - "name": Object { - "kind": "Name", - "value": "email", - }, - }, - }, - Object { - "kind": "Argument", - "name": Object { - "kind": "Name", - "value": "password", - }, - "value": Object { - "kind": "Variable", - "name": Object { - "kind": "Name", - "value": "password", - }, - }, - }, - ], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "generateCustomerToken", - }, - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "token", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "customer_token_lifetime", - }, - "selectionSet": undefined, - }, - ], - }, - }, - ], - }, - "variableDefinitions": Array [ - Object { - "defaultValue": undefined, - "directives": Array [], - "kind": "VariableDefinition", - "type": Object { - "kind": "NonNullType", - "type": Object { - "kind": "NamedType", - "name": Object { - "kind": "Name", - "value": "String", - }, - }, - }, - "variable": Object { - "kind": "Variable", - "name": Object { - "kind": "Name", - "value": "email", - }, - }, - }, - Object { - "defaultValue": undefined, - "directives": Array [], - "kind": "VariableDefinition", - "type": Object { - "kind": "NonNullType", - "type": Object { - "kind": "NamedType", - "name": Object { - "kind": "Name", - "value": "String", - }, - }, - }, - "variable": Object { - "kind": "Variable", - "name": Object { - "kind": "Name", - "value": "password", - }, - }, - }, - ], - }, - ], - "kind": "Document", - "loc": Object { - "end": 198, - "start": 0, - }, - }, - "variables": Object { - "email": "fry@planetexpress.com", - "password": "slurm is the best", - }, - }, - "result": Object { - "data": Object { - "generateCustomerToken": Object { - "customer_token_lifetime": 3600, - "token": "auth-token-123", - }, - }, - }, - }, - ], - }, - "operation": Object { - "extensions": Object {}, - "operationName": "GetReCaptchaV3Config", - "query": Object { - "definitions": Array [ - Object { - "directives": Array [], - "kind": "OperationDefinition", - "name": Object { - "kind": "Name", - "value": "GetReCaptchaV3Config", - }, - "operation": "query", - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "recaptchaV3Config", - }, - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "website_key", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "badge_position", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "language_code", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "forms", - }, - "selectionSet": undefined, - }, - ], - }, - }, - ], - }, - "variableDefinitions": Array [], - }, - ], - "kind": "Document", - "loc": Object { - "end": 173, - "start": 0, - }, - }, - "variables": Object {}, - }, - }, - "localState": LocalState { - "cache": InMemoryCache { - "addTypename": false, - "config": Object { - "addTypename": false, - "canonizeResults": false, - "dataIdFromObject": [Function], - "resultCaching": true, - }, - "data": Root { - "canRead": [Function], - "data": Object {}, - "getFieldValue": [Function], - "group": CacheGroup { - "caching": true, - "d": [Function], - "keyMaker": Trie { - "makeData": [Function], - "weakness": true, - }, - "parent": null, - }, - "policies": Policies { - "cache": [Circular], - "config": Object { - "cache": [Circular], - "dataIdFromObject": [Function], - "possibleTypes": undefined, - "typePolicies": undefined, - }, - "fuzzySubtypes": Map {}, - "rootIdsByTypename": Object { - "Mutation": "ROOT_MUTATION", - "Query": "ROOT_QUERY", - "Subscription": "ROOT_SUBSCRIPTION", - }, - "rootTypenamesById": Object { - "ROOT_MUTATION": "Mutation", - "ROOT_QUERY": "Query", - "ROOT_SUBSCRIPTION": "Subscription", - }, - "supertypeMap": Map {}, - "toBeAdded": Object {}, - "typePolicies": Object { - "Query": Object { - "fields": Object {}, - }, - }, - "usingPossibleTypes": false, - }, - "refs": Object {}, - "rootIds": Object {}, - "storageTrie": Trie { - "makeData": [Function], - "weakness": true, - }, - "stump": Stump { - "canRead": [Function], - "data": Object {}, - "getFieldValue": [Function], - "group": CacheGroup { - "caching": true, - "d": [Function], - "keyMaker": Trie { - "makeData": [Function], - "weak": WeakMap {}, - "weakness": true, - }, - "parent": CacheGroup { - "caching": true, - "d": [Function], - "keyMaker": Trie { - "makeData": [Function], - "weakness": true, - }, - "parent": null, - }, - }, - "id": "EntityStore.Stump", - "parent": [Circular], - "policies": Policies { - "cache": [Circular], - "config": Object { - "cache": [Circular], - "dataIdFromObject": [Function], - "possibleTypes": undefined, - "typePolicies": undefined, - }, - "fuzzySubtypes": Map {}, - "rootIdsByTypename": Object { - "Mutation": "ROOT_MUTATION", - "Query": "ROOT_QUERY", - "Subscription": "ROOT_SUBSCRIPTION", - }, - "rootTypenamesById": Object { - "ROOT_MUTATION": "Mutation", - "ROOT_QUERY": "Query", - "ROOT_SUBSCRIPTION": "Subscription", - }, - "supertypeMap": Map {}, - "toBeAdded": Object {}, - "typePolicies": Object { - "Query": Object { - "fields": Object {}, - }, - }, - "usingPossibleTypes": false, - }, - "refs": Object {}, - "replay": [Function], - "rootIds": Object {}, - "toReference": [Function], - }, - "toReference": [Function], - }, - "evict": [Function], - "getFragmentDoc": [Function], - "makeVar": [Function], - "maybeBroadcastWatch": [Function], - "modify": [Function], - "optimisticData": Stump { - "canRead": [Function], - "data": Object {}, - "getFieldValue": [Function], - "group": CacheGroup { - "caching": true, - "d": [Function], - "keyMaker": Trie { - "makeData": [Function], - "weak": WeakMap {}, - "weakness": true, - }, - "parent": CacheGroup { - "caching": true, - "d": [Function], - "keyMaker": Trie { - "makeData": [Function], - "weakness": true, - }, - "parent": null, - }, - }, - "id": "EntityStore.Stump", - "parent": Root { - "canRead": [Function], - "data": Object {}, - "getFieldValue": [Function], - "group": CacheGroup { - "caching": true, - "d": [Function], - "keyMaker": Trie { - "makeData": [Function], - "weakness": true, - }, - "parent": null, - }, - "policies": Policies { - "cache": [Circular], - "config": Object { - "cache": [Circular], - "dataIdFromObject": [Function], - "possibleTypes": undefined, - "typePolicies": undefined, - }, - "fuzzySubtypes": Map {}, - "rootIdsByTypename": Object { - "Mutation": "ROOT_MUTATION", - "Query": "ROOT_QUERY", - "Subscription": "ROOT_SUBSCRIPTION", - }, - "rootTypenamesById": Object { - "ROOT_MUTATION": "Mutation", - "ROOT_QUERY": "Query", - "ROOT_SUBSCRIPTION": "Subscription", - }, - "supertypeMap": Map {}, - "toBeAdded": Object {}, - "typePolicies": Object { - "Query": Object { - "fields": Object {}, - }, - }, - "usingPossibleTypes": false, - }, - "refs": Object {}, - "rootIds": Object {}, - "storageTrie": Trie { - "makeData": [Function], - "weakness": true, - }, - "stump": [Circular], - "toReference": [Function], - }, - "policies": Policies { - "cache": [Circular], - "config": Object { - "cache": [Circular], - "dataIdFromObject": [Function], - "possibleTypes": undefined, - "typePolicies": undefined, - }, - "fuzzySubtypes": Map {}, - "rootIdsByTypename": Object { - "Mutation": "ROOT_MUTATION", - "Query": "ROOT_QUERY", - "Subscription": "ROOT_SUBSCRIPTION", - }, - "rootTypenamesById": Object { - "ROOT_MUTATION": "Mutation", - "ROOT_QUERY": "Query", - "ROOT_SUBSCRIPTION": "Subscription", - }, - "supertypeMap": Map {}, - "toBeAdded": Object {}, - "typePolicies": Object { - "Query": Object { - "fields": Object {}, - }, - }, - "usingPossibleTypes": false, - }, - "refs": Object {}, - "replay": [Function], - "rootIds": Object {}, - "toReference": [Function], - }, - "policies": Policies { - "cache": [Circular], - "config": Object { - "cache": [Circular], - "dataIdFromObject": [Function], - "possibleTypes": undefined, - "typePolicies": undefined, - }, - "fuzzySubtypes": Map {}, - "rootIdsByTypename": Object { - "Mutation": "ROOT_MUTATION", - "Query": "ROOT_QUERY", - "Subscription": "ROOT_SUBSCRIPTION", - }, - "rootTypenamesById": Object { - "ROOT_MUTATION": "Mutation", - "ROOT_QUERY": "Query", - "ROOT_SUBSCRIPTION": "Subscription", - }, - "supertypeMap": Map {}, - "toBeAdded": Object {}, - "typePolicies": Object { - "Query": Object { - "fields": Object {}, - }, - }, - "usingPossibleTypes": false, - }, - "reset": [Function], - "storeReader": StoreReader { - "canon": ObjectCanon { - "empty": Object {}, - "keysByJSON": Map { - "[]" => Object { - "json": "[]", - "sorted": Array [], - }, - }, - "known": WeakSet {}, - "passes": WeakMap {}, - "pool": Trie { - "data": Object { - "keys": Object { - "json": "[]", - "sorted": Array [], - }, - }, - "makeData": [Function], - "weak": WeakMap {}, - "weakness": true, - }, - }, - "config": Object { - "addTypename": false, - "cache": [Circular], - "canonizeResults": false, - }, - "executeSelectionSet": [Function], - "executeSubSelectedArray": [Function], - "knownResults": WeakMap {}, - }, - "storeWriter": StoreWriter { - "cache": [Circular], - "reader": StoreReader { - "canon": ObjectCanon { - "empty": Object {}, - "keysByJSON": Map { - "[]" => Object { - "json": "[]", - "sorted": Array [], - }, - }, - "known": WeakSet {}, - "passes": WeakMap {}, - "pool": Trie { - "data": Object { - "keys": Object { - "json": "[]", - "sorted": Array [], - }, - }, - "makeData": [Function], - "weak": WeakMap {}, - "weakness": true, - }, - }, - "config": Object { - "addTypename": false, - "cache": [Circular], - "canonizeResults": false, - }, - "executeSelectionSet": [Function], - "executeSubSelectedArray": [Function], - "knownResults": WeakMap {}, - }, - }, - "txCount": 0, - "typenameDocumentCache": Map {}, - "watches": Set { - Object { - "callback": [Function], - "canonizeResults": undefined, - "optimistic": true, - "query": Object { - "definitions": Array [ - Object { - "directives": Array [], - "kind": "OperationDefinition", - "name": Object { - "kind": "Name", - "value": "GetReCaptchaV3Config", - }, - "operation": "query", - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "recaptchaV3Config", - }, - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "website_key", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "badge_position", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "language_code", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "forms", - }, - "selectionSet": undefined, - }, - ], - }, - }, - ], - }, - "variableDefinitions": Array [], - }, - ], - "kind": "Document", - "loc": Object { - "end": 173, - "start": 0, - }, - }, - "returnPartialData": true, - "variables": Object {}, - "watcher": QueryInfo { - "cache": [Circular], - "cancel": [Function], - "dirty": false, - "document": Object { - "definitions": Array [ - Object { - "directives": Array [], - "kind": "OperationDefinition", - "name": Object { - "kind": "Name", - "value": "GetReCaptchaV3Config", - }, - "operation": "query", - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "recaptchaV3Config", - }, - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "website_key", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "badge_position", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "language_code", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "forms", - }, - "selectionSet": undefined, - }, - ], - }, - }, - ], - }, - "variableDefinitions": Array [], - }, - ], - "kind": "Document", - "loc": Object { - "end": 173, - "start": 0, - }, - }, - "graphQLErrors": Array [], - "lastDiff": Object { - "diff": Object { - "complete": false, - "missing": Array [ - MissingFieldError { - "message": "Can't find field 'recaptchaV3Config' on ROOT_QUERY object", - "path": Object { - "recaptchaV3Config": "Can't find field 'recaptchaV3Config' on ROOT_QUERY object", - }, - "query": Object { - "definitions": Array [ - Object { - "directives": Array [], - "kind": "OperationDefinition", - "name": Object { - "kind": "Name", - "value": "GetReCaptchaV3Config", - }, - "operation": "query", - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "recaptchaV3Config", - }, - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "website_key", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "badge_position", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "language_code", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "forms", - }, - "selectionSet": undefined, - }, - ], - }, - }, - ], - }, - "variableDefinitions": Array [], - }, - ], - "kind": "Document", - "loc": Object { - "end": 173, - "start": 0, - }, - }, - "variables": Object {}, - }, - ], - "result": Object {}, - }, - "options": Object { - "canonizeResults": undefined, - "optimistic": true, - "query": Object { - "definitions": Array [ - Object { - "directives": Array [], - "kind": "OperationDefinition", - "name": Object { - "kind": "Name", - "value": "GetReCaptchaV3Config", - }, - "operation": "query", - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "recaptchaV3Config", - }, - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "website_key", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "badge_position", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "language_code", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "forms", - }, - "selectionSet": undefined, - }, - ], - }, - }, - ], - }, - "variableDefinitions": Array [], - }, - ], - "kind": "Document", - "loc": Object { - "end": 173, - "start": 0, - }, - }, - "returnPartialData": true, - "variables": Object {}, - }, - }, - "lastRequestId": 1, - "lastWatch": [Circular], - "listeners": Set { - [Function], - }, - "networkError": null, - "networkStatus": 1, - "observableQuery": ObservableQuery { - "_subscriber": [Function], - "concast": Concast { - "_subscriber": [Function], - "addCount": 1, - "cancel": [Function], - "handlers": Object { - "complete": [Function], - "error": [Function], - "next": [Function], - }, - "observers": Set { - Object { - "complete": [Function], - "error": [Function], - "next": [Function], - }, - Object { - "error": [Function], - "next": [Function], - }, - }, - "promise": Promise {}, - "reject": [Function], - "resolve": [Function], - "sources": Array [], - "sub": Subscription { - "_cleanup": [Function], - "_observer": Object { - "complete": [Function], - "error": [Function], - "next": [Function], - }, - "_queue": undefined, - "_state": "ready", - }, - }, - "initialFetchPolicy": "cache-and-network", - "isTornDown": false, - "last": Object { - "result": Object { - "loading": true, - "networkStatus": 1, - "partial": true, - }, - "variables": Object {}, - }, - "observer": Object { - "error": [Function], - "next": [Function], - }, - "observers": Set { - SubscriptionObserver { - "_subscription": Subscription { - "_cleanup": [Function], - "_observer": Object { - "complete": undefined, - "error": [Function], - "next": [Function], - }, - "_queue": Array [ - Object { - "type": "next", - "value": Object { - "loading": true, - "networkStatus": 1, - "partial": true, - }, - }, - ], - "_state": "buffering", - }, - }, - }, - "options": Object { - "fetchPolicy": "cache-and-network", - "notifyOnNetworkStatusChange": false, - "query": Object { - "definitions": Array [ - Object { - "directives": Array [], - "kind": "OperationDefinition", - "name": Object { - "kind": "Name", - "value": "GetReCaptchaV3Config", - }, - "operation": "query", - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "recaptchaV3Config", - }, - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "website_key", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "badge_position", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "language_code", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "forms", - }, - "selectionSet": undefined, - }, - ], - }, - }, - ], - }, - "variableDefinitions": Array [], - }, - ], - "kind": "Document", - "loc": Object { - "end": 173, - "start": 0, - }, - }, - "variables": Object {}, - }, - "queryId": "1", - "queryInfo": [Circular], - "queryManager": [Circular], - "queryName": "GetReCaptchaV3Config", - "subscriptions": Set {}, - }, - "oqListener": [Function], - "queryId": "1", - "stopped": false, - "subscriptions": Set {}, - "variables": Object {}, - }, - }, - }, - }, - "client": [Circular], - }, - "mutationIdCounter": 1, - "mutationStore": Object {}, - "onBroadcast": [Function], - "queries": Map { - "1" => QueryInfo { - "cache": InMemoryCache { - "addTypename": false, - "config": Object { - "addTypename": false, - "canonizeResults": false, - "dataIdFromObject": [Function], - "resultCaching": true, - }, - "data": Root { - "canRead": [Function], - "data": Object {}, - "getFieldValue": [Function], - "group": CacheGroup { - "caching": true, - "d": [Function], - "keyMaker": Trie { - "makeData": [Function], - "weakness": true, - }, - "parent": null, - }, - "policies": Policies { - "cache": [Circular], - "config": Object { - "cache": [Circular], - "dataIdFromObject": [Function], - "possibleTypes": undefined, - "typePolicies": undefined, - }, - "fuzzySubtypes": Map {}, - "rootIdsByTypename": Object { - "Mutation": "ROOT_MUTATION", - "Query": "ROOT_QUERY", - "Subscription": "ROOT_SUBSCRIPTION", - }, - "rootTypenamesById": Object { - "ROOT_MUTATION": "Mutation", - "ROOT_QUERY": "Query", - "ROOT_SUBSCRIPTION": "Subscription", - }, - "supertypeMap": Map {}, - "toBeAdded": Object {}, - "typePolicies": Object { - "Query": Object { - "fields": Object {}, - }, - }, - "usingPossibleTypes": false, - }, - "refs": Object {}, - "rootIds": Object {}, - "storageTrie": Trie { - "makeData": [Function], - "weakness": true, - }, - "stump": Stump { - "canRead": [Function], - "data": Object {}, - "getFieldValue": [Function], - "group": CacheGroup { - "caching": true, - "d": [Function], - "keyMaker": Trie { - "makeData": [Function], - "weak": WeakMap {}, - "weakness": true, - }, - "parent": CacheGroup { - "caching": true, - "d": [Function], - "keyMaker": Trie { - "makeData": [Function], - "weakness": true, - }, - "parent": null, - }, - }, - "id": "EntityStore.Stump", - "parent": [Circular], - "policies": Policies { - "cache": [Circular], - "config": Object { - "cache": [Circular], - "dataIdFromObject": [Function], - "possibleTypes": undefined, - "typePolicies": undefined, - }, - "fuzzySubtypes": Map {}, - "rootIdsByTypename": Object { - "Mutation": "ROOT_MUTATION", - "Query": "ROOT_QUERY", - "Subscription": "ROOT_SUBSCRIPTION", - }, - "rootTypenamesById": Object { - "ROOT_MUTATION": "Mutation", - "ROOT_QUERY": "Query", - "ROOT_SUBSCRIPTION": "Subscription", - }, - "supertypeMap": Map {}, - "toBeAdded": Object {}, - "typePolicies": Object { - "Query": Object { - "fields": Object {}, - }, - }, - "usingPossibleTypes": false, - }, - "refs": Object {}, - "replay": [Function], - "rootIds": Object {}, - "toReference": [Function], - }, - "toReference": [Function], - }, - "evict": [Function], - "getFragmentDoc": [Function], - "makeVar": [Function], - "maybeBroadcastWatch": [Function], - "modify": [Function], - "optimisticData": Stump { - "canRead": [Function], - "data": Object {}, - "getFieldValue": [Function], - "group": CacheGroup { - "caching": true, - "d": [Function], - "keyMaker": Trie { - "makeData": [Function], - "weak": WeakMap {}, - "weakness": true, - }, - "parent": CacheGroup { - "caching": true, - "d": [Function], - "keyMaker": Trie { - "makeData": [Function], - "weakness": true, - }, - "parent": null, - }, - }, - "id": "EntityStore.Stump", - "parent": Root { - "canRead": [Function], - "data": Object {}, - "getFieldValue": [Function], - "group": CacheGroup { - "caching": true, - "d": [Function], - "keyMaker": Trie { - "makeData": [Function], - "weakness": true, - }, - "parent": null, - }, - "policies": Policies { - "cache": [Circular], - "config": Object { - "cache": [Circular], - "dataIdFromObject": [Function], - "possibleTypes": undefined, - "typePolicies": undefined, - }, - "fuzzySubtypes": Map {}, - "rootIdsByTypename": Object { - "Mutation": "ROOT_MUTATION", - "Query": "ROOT_QUERY", - "Subscription": "ROOT_SUBSCRIPTION", - }, - "rootTypenamesById": Object { - "ROOT_MUTATION": "Mutation", - "ROOT_QUERY": "Query", - "ROOT_SUBSCRIPTION": "Subscription", - }, - "supertypeMap": Map {}, - "toBeAdded": Object {}, - "typePolicies": Object { - "Query": Object { - "fields": Object {}, - }, - }, - "usingPossibleTypes": false, - }, - "refs": Object {}, - "rootIds": Object {}, - "storageTrie": Trie { - "makeData": [Function], - "weakness": true, - }, - "stump": [Circular], - "toReference": [Function], - }, - "policies": Policies { - "cache": [Circular], - "config": Object { - "cache": [Circular], - "dataIdFromObject": [Function], - "possibleTypes": undefined, - "typePolicies": undefined, - }, - "fuzzySubtypes": Map {}, - "rootIdsByTypename": Object { - "Mutation": "ROOT_MUTATION", - "Query": "ROOT_QUERY", - "Subscription": "ROOT_SUBSCRIPTION", - }, - "rootTypenamesById": Object { - "ROOT_MUTATION": "Mutation", - "ROOT_QUERY": "Query", - "ROOT_SUBSCRIPTION": "Subscription", - }, - "supertypeMap": Map {}, - "toBeAdded": Object {}, - "typePolicies": Object { - "Query": Object { - "fields": Object {}, - }, - }, - "usingPossibleTypes": false, - }, - "refs": Object {}, - "replay": [Function], - "rootIds": Object {}, - "toReference": [Function], - }, - "policies": Policies { - "cache": [Circular], - "config": Object { - "cache": [Circular], - "dataIdFromObject": [Function], - "possibleTypes": undefined, - "typePolicies": undefined, - }, - "fuzzySubtypes": Map {}, - "rootIdsByTypename": Object { - "Mutation": "ROOT_MUTATION", - "Query": "ROOT_QUERY", - "Subscription": "ROOT_SUBSCRIPTION", - }, - "rootTypenamesById": Object { - "ROOT_MUTATION": "Mutation", - "ROOT_QUERY": "Query", - "ROOT_SUBSCRIPTION": "Subscription", - }, - "supertypeMap": Map {}, - "toBeAdded": Object {}, - "typePolicies": Object { - "Query": Object { - "fields": Object {}, - }, - }, - "usingPossibleTypes": false, - }, - "reset": [Function], - "storeReader": StoreReader { - "canon": ObjectCanon { - "empty": Object {}, - "keysByJSON": Map { - "[]" => Object { - "json": "[]", - "sorted": Array [], - }, - }, - "known": WeakSet {}, - "passes": WeakMap {}, - "pool": Trie { - "data": Object { - "keys": Object { - "json": "[]", - "sorted": Array [], - }, - }, - "makeData": [Function], - "weak": WeakMap {}, - "weakness": true, - }, - }, - "config": Object { - "addTypename": false, - "cache": [Circular], - "canonizeResults": false, - }, - "executeSelectionSet": [Function], - "executeSubSelectedArray": [Function], - "knownResults": WeakMap {}, - }, - "storeWriter": StoreWriter { - "cache": [Circular], - "reader": StoreReader { - "canon": ObjectCanon { - "empty": Object {}, - "keysByJSON": Map { - "[]" => Object { - "json": "[]", - "sorted": Array [], - }, - }, - "known": WeakSet {}, - "passes": WeakMap {}, - "pool": Trie { - "data": Object { - "keys": Object { - "json": "[]", - "sorted": Array [], - }, - }, - "makeData": [Function], - "weak": WeakMap {}, - "weakness": true, - }, - }, - "config": Object { - "addTypename": false, - "cache": [Circular], - "canonizeResults": false, - }, - "executeSelectionSet": [Function], - "executeSubSelectedArray": [Function], - "knownResults": WeakMap {}, - }, - }, - "txCount": 0, - "typenameDocumentCache": Map {}, - "watches": Set { - Object { - "callback": [Function], - "canonizeResults": undefined, - "optimistic": true, - "query": Object { - "definitions": Array [ - Object { - "directives": Array [], - "kind": "OperationDefinition", - "name": Object { - "kind": "Name", - "value": "GetReCaptchaV3Config", - }, - "operation": "query", - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "recaptchaV3Config", - }, - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "website_key", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "badge_position", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "language_code", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "forms", - }, - "selectionSet": undefined, - }, - ], - }, - }, - ], - }, - "variableDefinitions": Array [], - }, - ], - "kind": "Document", - "loc": Object { - "end": 173, - "start": 0, - }, - }, - "returnPartialData": true, - "variables": Object {}, - "watcher": [Circular], - }, - }, - }, - "cancel": [Function], - "dirty": false, - "document": Object { - "definitions": Array [ - Object { - "directives": Array [], - "kind": "OperationDefinition", - "name": Object { - "kind": "Name", - "value": "GetReCaptchaV3Config", - }, - "operation": "query", - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "recaptchaV3Config", - }, - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "website_key", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "badge_position", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "language_code", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "forms", - }, - "selectionSet": undefined, - }, - ], - }, - }, - ], - }, - "variableDefinitions": Array [], - }, - ], - "kind": "Document", - "loc": Object { - "end": 173, - "start": 0, - }, - }, - "graphQLErrors": Array [], - "lastDiff": Object { - "diff": Object { - "complete": false, - "missing": Array [ - MissingFieldError { - "message": "Can't find field 'recaptchaV3Config' on ROOT_QUERY object", - "path": Object { - "recaptchaV3Config": "Can't find field 'recaptchaV3Config' on ROOT_QUERY object", - }, - "query": Object { - "definitions": Array [ - Object { - "directives": Array [], - "kind": "OperationDefinition", - "name": Object { - "kind": "Name", - "value": "GetReCaptchaV3Config", - }, - "operation": "query", - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "recaptchaV3Config", - }, - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "website_key", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "badge_position", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "language_code", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "forms", - }, - "selectionSet": undefined, - }, - ], - }, - }, - ], - }, - "variableDefinitions": Array [], - }, - ], - "kind": "Document", - "loc": Object { - "end": 173, - "start": 0, - }, - }, - "variables": Object {}, - }, - ], - "result": Object {}, - }, - "options": Object { - "canonizeResults": undefined, - "optimistic": true, - "query": Object { - "definitions": Array [ - Object { - "directives": Array [], - "kind": "OperationDefinition", - "name": Object { - "kind": "Name", - "value": "GetReCaptchaV3Config", - }, - "operation": "query", - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "recaptchaV3Config", - }, - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "website_key", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "badge_position", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "language_code", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "forms", - }, - "selectionSet": undefined, - }, - ], - }, - }, - ], - }, - "variableDefinitions": Array [], - }, - ], - "kind": "Document", - "loc": Object { - "end": 173, - "start": 0, - }, - }, - "returnPartialData": true, - "variables": Object {}, - }, - }, - "lastRequestId": 1, - "lastWatch": Object { - "callback": [Function], - "canonizeResults": undefined, - "optimistic": true, - "query": Object { - "definitions": Array [ - Object { - "directives": Array [], - "kind": "OperationDefinition", - "name": Object { - "kind": "Name", - "value": "GetReCaptchaV3Config", - }, - "operation": "query", - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "recaptchaV3Config", - }, - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "website_key", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "badge_position", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "language_code", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "forms", - }, - "selectionSet": undefined, - }, - ], - }, - }, - ], - }, - "variableDefinitions": Array [], - }, - ], - "kind": "Document", - "loc": Object { - "end": 173, - "start": 0, - }, - }, - "returnPartialData": true, - "variables": Object {}, - "watcher": [Circular], - }, - "listeners": Set { - [Function], - }, - "networkError": null, - "networkStatus": 1, - "observableQuery": ObservableQuery { - "_subscriber": [Function], - "concast": Concast { - "_subscriber": [Function], - "addCount": 1, - "cancel": [Function], - "handlers": Object { - "complete": [Function], - "error": [Function], - "next": [Function], - }, - "observers": Set { - Object { - "complete": [Function], - "error": [Function], - "next": [Function], - }, - Object { - "error": [Function], - "next": [Function], - }, - }, - "promise": Promise {}, - "reject": [Function], - "resolve": [Function], - "sources": Array [], - "sub": Subscription { - "_cleanup": [Function], - "_observer": Object { - "complete": [Function], - "error": [Function], - "next": [Function], - }, - "_queue": undefined, - "_state": "ready", - }, - }, - "initialFetchPolicy": "cache-and-network", - "isTornDown": false, - "last": Object { - "result": Object { - "loading": true, - "networkStatus": 1, - "partial": true, - }, - "variables": Object {}, - }, - "observer": Object { - "error": [Function], - "next": [Function], - }, - "observers": Set { - SubscriptionObserver { - "_subscription": Subscription { - "_cleanup": [Function], - "_observer": Object { - "complete": undefined, - "error": [Function], - "next": [Function], - }, - "_queue": Array [ - Object { - "type": "next", - "value": Object { - "loading": true, - "networkStatus": 1, - "partial": true, - }, - }, - ], - "_state": "buffering", - }, - }, - }, - "options": Object { - "fetchPolicy": "cache-and-network", - "notifyOnNetworkStatusChange": false, - "query": Object { - "definitions": Array [ - Object { - "directives": Array [], - "kind": "OperationDefinition", - "name": Object { - "kind": "Name", - "value": "GetReCaptchaV3Config", - }, - "operation": "query", - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "recaptchaV3Config", - }, - "selectionSet": Object { - "kind": "SelectionSet", - "selections": Array [ - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "website_key", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "badge_position", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "language_code", - }, - "selectionSet": undefined, - }, - Object { - "alias": undefined, - "arguments": Array [], - "directives": Array [], - "kind": "Field", - "name": Object { - "kind": "Name", - "value": "forms", - }, - "selectionSet": undefined, - }, - ], - }, - }, - ], - }, - "variableDefinitions": Array [], - }, - ], - "kind": "Document", - "loc": Object { - "end": 173, - "start": 0, - }, - }, - "variables": Object {}, - }, - "queryId": "1", - "queryInfo": [Circular], - "queryManager": [Circular], - "queryName": "GetReCaptchaV3Config", - "subscriptions": Set {}, - }, - "oqListener": [Function], - "queryId": "1", - "stopped": false, - "subscriptions": Set {}, - "variables": Object {}, - }, - }, - "queryDeduplication": true, - "queryIdCounter": 2, - "requestIdCounter": 2, - "ssrMode": false, - "transformCache": WeakMap {}, - }, - "reFetchObservableQueries": [Function], - "resetStore": [Function], - "resetStoreCallbacks": Array [], - "typeDefs": undefined, - "version": "3.5.10", - "watchQuery": [Function], - }, - "loading": false, - "reset": [Function], - }, - ], - "signinHandleEnterKeyPress": [Function], - "userContext": Array [ - Object { - "getDetailsError": "getDetails error from redux", - "isGettingDetails": false, - }, - Object { - "getUserDetails": [MockFunction], - "setToken": [MockFunction], - }, - ], - } - `); + expect(talonProps).toMatchSnapshot(); +}); +test('should set isBusy to true', () => { + const { talonProps, update } = getTalonProps({ + ...defaultProps + }); + talonProps.handleSubmit(signInVariables); + + const { isBusy } = update(); + + expect(isBusy).toBeTruthy(); }); test('handleSubmit triggers waterfall of operations and actions', async () => { - useAwaitQuery.mockReturnValueOnce(() => ({ + const token = 'customertoken'; + const customer_token_lifetime = 1; + const signIn = jest.fn().mockReturnValue({ data: { - customer: { - email: 'john@fake.email' + generateCustomerToken: { + token } } - })); - - const [, { getCartDetails }] = useCartContext(); - const [, { getUserDetails, setToken }] = useUserContext(); - const [, { dispatch }] = useEventingContext(); - - const { result } = renderHookWithProviders(); - - await act(() => result.current.handleSubmit(signInVariables)); - - expect(result.current.isBusy).toBe(true); - expect(setToken).toHaveBeenCalledWith(authToken, customerTokenLifetime); - expect(getCartDetails).toHaveBeenCalled(); - expect(getUserDetails).toHaveBeenCalled(); - - expect(dispatch).toHaveBeenCalledTimes(1); - expect(dispatch.mock.calls[0][0]).toMatchInlineSnapshot(` - Object { - "payload": Object { - "email": "john@fake.email", - }, - "type": "USER_SIGN_IN", + }); + signInMutationFn.mockReturnValueOnce([signIn, { error: null }]); + const setToken = jest.fn(); + useUserContext.mockReturnValueOnce([ + { isGettingDetails: false }, + { getUserDetails: jest.fn(), setToken } + ]); + + const { talonProps } = getTalonProps({ + ...defaultProps + }); + + await talonProps.handleSubmit(signInVariables); + expect(signIn).toHaveBeenCalledWith({ + variables: { + email: signInVariables.email, + password: signInVariables.password } - `); + }); + expect(setToken).toHaveBeenCalledWith(token, customer_token_lifetime); }); test('handleSubmit exception is logged and resets state', async () => { - const errorMessage = 'Oh no! Something went wrong :('; - const [, { getUserDetails, setToken }] = useUserContext(); - setToken.mockRejectedValue(errorMessage); - jest.spyOn(console, 'error'); - - const { result } = renderHookWithProviders(); + const fetchUserDetails = jest.fn(); + customerQueryFn.mockReturnValueOnce(fetchUserDetails); + const getUserDetails = jest.fn(); + useUserContext.mockReturnValueOnce([ + { isGettingDetails: false }, + { getUserDetails: jest.fn(), setToken: jest.fn() } + ]); - await act(() => result.current.handleSubmit(signInVariables)); + const { talonProps } = getTalonProps({ + ...defaultProps + }); - expect(result.current.isBusy).toBe(false); + expect(talonProps.isBusy).toBeFalsy(); expect(getUserDetails).not.toHaveBeenCalled(); - expect(console.error).toHaveBeenCalledWith(errorMessage); }); -test('handleForgotPassword triggers callbacks', () => { +test('handleForgotPassword triggers callbacks', async () => { + const setDefaultUsername = jest.fn(); + const showForgotPassword = jest.fn(); + const { talonProps } = getTalonProps({ + ...defaultProps, + setDefaultUsername, + showForgotPassword + }); const mockUsername = 'fry@planetexpress.com'; const mockApi = { getValue: jest.fn().mockReturnValue(mockUsername) }; - - const { result } = renderHookWithProviders(); - act(() => result.current.setFormApi(mockApi)); - act(() => result.current.handleForgotPassword()); - - expect(initialProps.setDefaultUsername).toHaveBeenCalledWith(mockUsername); - expect(initialProps.showForgotPassword).toHaveBeenCalled(); + await talonProps.setFormApi(mockApi); + await talonProps.handleForgotPassword(); + expect(setDefaultUsername).toHaveBeenCalledWith(mockUsername); + expect(showForgotPassword).toHaveBeenCalled(); }); -test('handleCreateAccount triggers callbacks', () => { +test('handleCreateAccount triggers callbacks', async () => { + const setDefaultUsername = jest.fn(); + const showCreateAccount = jest.fn(); + const { talonProps } = getTalonProps({ + ...defaultProps, + setDefaultUsername, + showCreateAccount + }); const mockUsername = 'fry@planetexpress.com'; const mockApi = { getValue: jest.fn().mockReturnValue(mockUsername) }; - - const { result } = renderHookWithProviders(); - act(() => result.current.setFormApi(mockApi)); - act(() => result.current.handleCreateAccount()); - - expect(initialProps.setDefaultUsername).toHaveBeenCalledWith(mockUsername); - expect(initialProps.showCreateAccount).toHaveBeenCalled(); + await talonProps.setFormApi(mockApi); + await talonProps.handleCreateAccount(); + expect(setDefaultUsername).toHaveBeenCalledWith(mockUsername); + expect(showCreateAccount).toHaveBeenCalled(); }); test('mutation error is returned by talon', async () => { - const signInErrorMock = { - request: signInMock.request, - error: new Error('Uh oh! There was an error signing in :(') - }; - - const { result } = renderHookWithProviders({ mocks: [signInErrorMock] }); - await act(() => result.current.handleSubmit(signInVariables)); - - expect(result.current.errors.get('signInMutation')).toMatchInlineSnapshot( - `[Error: Uh oh! There was an error signing in :(]` - ); + const getUserDetailsQuery = jest.fn(); + getUserDetailsQuery.mockReturnValueOnce([ + jest.fn(), + { error: 'getDetails error from redux' } + ]); + signInMutationFn.mockReturnValueOnce([ + jest.fn(), + { error: 'Sign In Mutation Error' } + ]); + + const { talonProps } = getTalonProps({ + ...defaultProps + }); + + await talonProps.handleSubmit(signInVariables); + expect(talonProps.errors).toMatchSnapshot(); }); it('should call handleForgotPassword when Enter key is pressed', () => { - const { result } = renderHookWithProviders(); - const { forgotPasswordHandleEnterKeyPress } = result.current; - const enterKeyEvent = { key: 'Enter' }; - renderHook(() => forgotPasswordHandleEnterKeyPress(enterKeyEvent)); -}); - -it('should call handleEnterKeyPress when Enter key is pressed', () => { - const { result } = renderHookWithProviders(); - const { handleEnterKeyPress } = result.current; + const { talonProps } = getTalonProps({ + ...defaultProps + }); const enterKeyEvent = { key: 'Enter' }; - renderHook(() => handleEnterKeyPress(enterKeyEvent)); + talonProps.forgotPasswordHandleEnterKeyPress(enterKeyEvent); }); diff --git a/packages/peregrine/lib/talons/SignIn/signIn.gql.js b/packages/peregrine/lib/talons/SignIn/signIn.gql.js index b960c3452e..0c91e813b0 100644 --- a/packages/peregrine/lib/talons/SignIn/signIn.gql.js +++ b/packages/peregrine/lib/talons/SignIn/signIn.gql.js @@ -1,5 +1,6 @@ import { gql } from '@apollo/client'; import { CheckoutPageFragment } from '../CheckoutPage/checkoutPageFragments.gql'; +import { GET_STORE_CONFIG_DATA } from '../CreateAccount/createAccount.gql'; export const GET_CUSTOMER = gql` query GetCustomerAfterSignIn { @@ -17,7 +18,6 @@ export const SIGN_IN = gql` mutation SignIn($email: String!, $password: String!) { generateCustomerToken(email: $email, password: $password) { token - customer_token_lifetime } } `; @@ -52,5 +52,6 @@ export default { createCartMutation: CREATE_CART, getCustomerQuery: GET_CUSTOMER, mergeCartsMutation: MERGE_CARTS, - signInMutation: SIGN_IN + signInMutation: SIGN_IN, + getStoreConfigQuery: GET_STORE_CONFIG_DATA }; diff --git a/packages/peregrine/lib/talons/SignIn/useSignIn.js b/packages/peregrine/lib/talons/SignIn/useSignIn.js index afedbcc05a..34fb99f043 100644 --- a/packages/peregrine/lib/talons/SignIn/useSignIn.js +++ b/packages/peregrine/lib/talons/SignIn/useSignIn.js @@ -1,5 +1,5 @@ import { useCallback, useRef, useState, useMemo } from 'react'; -import { useApolloClient, useMutation } from '@apollo/client'; +import { useApolloClient, useMutation, useQuery } from '@apollo/client'; import { useGoogleReCaptcha } from '../../hooks/useGoogleReCaptcha/useGoogleReCaptcha'; import mergeOperations from '../../util/shallowMerge'; @@ -25,7 +25,8 @@ export const useSignIn = props => { createCartMutation, getCustomerQuery, mergeCartsMutation, - signInMutation + signInMutation, + getStoreConfigQuery } = operations; const apolloClient = useApolloClient(); @@ -61,6 +62,19 @@ export const useSignIn = props => { recaptchaWidgetProps } = googleReCaptcha; + const { data: storeConfigData } = useQuery(getStoreConfigQuery, { + fetchPolicy: 'cache-and-network', + nextFetchPolicy: 'cache-first' + }); + + const { customerAccessTokenLifetime } = useMemo(() => { + const storeConfig = storeConfigData?.storeConfig || {}; + + return { + customerAccessTokenLifetime: + storeConfig.customer_access_token_lifetime + }; + }, [storeConfigData]); const [fetchCartId] = useMutation(createCartMutation); const [mergeCarts] = useMutation(mergeCartsMutation); const fetchUserDetails = useAwaitQuery(getCustomerQuery); @@ -91,12 +105,8 @@ export const useSignIn = props => { }); const token = signInResponse.data.generateCustomerToken.token; - const customerTokenLifetime = - signInResponse.data.generateCustomerToken - .customer_token_lifetime; - - await (customerTokenLifetime - ? setToken(token, customerTokenLifetime) + await (customerAccessTokenLifetime + ? setToken(token, customerAccessTokenLifetime) : setToken(token)); // Clear all cart/customer data from cache and redux. @@ -143,6 +153,7 @@ export const useSignIn = props => { } }, [ + customerAccessTokenLifetime, cartId, generateReCaptchaData, signIn, diff --git a/packages/venia-ui/lib/components/CheckoutPage/OrderConfirmationPage/createAccount.js b/packages/venia-ui/lib/components/CheckoutPage/OrderConfirmationPage/createAccount.js index ef56003fa5..4256fccd6d 100644 --- a/packages/venia-ui/lib/components/CheckoutPage/OrderConfirmationPage/createAccount.js +++ b/packages/venia-ui/lib/components/CheckoutPage/OrderConfirmationPage/createAccount.js @@ -65,7 +65,8 @@ const CreateAccount = props => { handleSubmit, isDisabled, initialValues, - recaptchaWidgetProps + recaptchaWidgetProps, + minimumPasswordLength } = talonProps; return ( @@ -155,7 +156,7 @@ const CreateAccount = props => { data-cy="OrderConfirmationPage-CreateAccount-password" validate={combine([ isRequired, - [hasLengthAtLeast, 8], + [hasLengthAtLeast, minimumPasswordLength], validatePassword ])} validateOnBlur diff --git a/packages/venia-ui/lib/components/CreateAccount/createAccount.js b/packages/venia-ui/lib/components/CreateAccount/createAccount.js index 990483db3c..84ababb1fe 100644 --- a/packages/venia-ui/lib/components/CreateAccount/createAccount.js +++ b/packages/venia-ui/lib/components/CreateAccount/createAccount.js @@ -36,9 +36,9 @@ const CreateAccount = props => { isDisabled, initialValues, recaptchaWidgetProps, - minimum_password_length + minimumPasswordLength } = talonProps; - + console.log('minimumPasswordLength==', minimumPasswordLength); const { formatMessage } = useIntl(); const classes = useStyle(defaultClasses, props.classes); @@ -166,7 +166,7 @@ const CreateAccount = props => { })} validate={combine([ isRequired, - [hasLengthAtLeast, minimum_password_length], + [hasLengthAtLeast, minimumPasswordLength], validatePassword ])} validateOnBlur