@graphcommerce/react-hook-form 2.102.7 → 2.102.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -16,22 +16,6 @@ describe('useFormGqlMutation', () => {
|
|
|
16
16
|
register('address.street.hoi')
|
|
17
17
|
})
|
|
18
18
|
|
|
19
|
-
const address = {
|
|
20
|
-
cartId: '12',
|
|
21
|
-
customerNote: 'hoi',
|
|
22
|
-
address: {
|
|
23
|
-
firstname: 'Paul',
|
|
24
|
-
lastname: 'Hachmang',
|
|
25
|
-
company: 'Reach Digital',
|
|
26
|
-
country_code: 'NL',
|
|
27
|
-
street: ['Noordplein 85', '3e etage'],
|
|
28
|
-
city: 'Roelofarendsveen',
|
|
29
|
-
telephone: '0654716972',
|
|
30
|
-
postcode: '2371DJ',
|
|
31
|
-
save_in_address_book: 'true',
|
|
32
|
-
},
|
|
33
|
-
}
|
|
34
|
-
|
|
35
19
|
it('extracts required fields correctly', () => {
|
|
36
20
|
expect(required).toEqual({ address: true, cartId: true, customerNote: false })
|
|
37
21
|
})
|
|
@@ -2,22 +2,24 @@ import { TestShippingAddressFormDocument } from '../__mocks__/TestShippingAddres
|
|
|
2
2
|
import { handlerFactory } from '../src/useGqlDocumentHandler'
|
|
3
3
|
|
|
4
4
|
describe('useGqlDocumentHandler', () => {
|
|
5
|
-
const {
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
const {
|
|
6
|
+
required,
|
|
7
|
+
defaultVariables: defaults,
|
|
8
|
+
encode,
|
|
9
|
+
} = handlerFactory(TestShippingAddressFormDocument)
|
|
8
10
|
|
|
9
11
|
const address = {
|
|
10
12
|
cartId: '12',
|
|
11
13
|
customerNote: 'hoi',
|
|
12
14
|
address: {
|
|
13
|
-
firstname: '
|
|
14
|
-
lastname: '
|
|
15
|
-
company: '
|
|
15
|
+
firstname: 'Firstname',
|
|
16
|
+
lastname: 'Lastname',
|
|
17
|
+
company: 'GraphComemrce',
|
|
16
18
|
country_code: 'NL',
|
|
17
|
-
street: ['
|
|
18
|
-
city: '
|
|
19
|
-
telephone: '
|
|
20
|
-
postcode: '
|
|
19
|
+
street: ['Streetline 1', 'Streetline 2'],
|
|
20
|
+
city: 'City',
|
|
21
|
+
telephone: '0987654321',
|
|
22
|
+
postcode: '1234AB',
|
|
21
23
|
save_in_address_book: 'true',
|
|
22
24
|
},
|
|
23
25
|
}
|
|
@@ -35,14 +37,14 @@ describe('useGqlDocumentHandler', () => {
|
|
|
35
37
|
cartId: '12',
|
|
36
38
|
customerNote: 'hoi',
|
|
37
39
|
address: {
|
|
38
|
-
firstname: '
|
|
39
|
-
lastname: '
|
|
40
|
-
company: '
|
|
40
|
+
firstname: 'Firstname',
|
|
41
|
+
lastname: 'Lastname',
|
|
42
|
+
company: 'GraphComemrce',
|
|
41
43
|
country_code: 'NL',
|
|
42
|
-
street: ['
|
|
43
|
-
city: '
|
|
44
|
-
telephone: '
|
|
45
|
-
postcode: '
|
|
44
|
+
street: ['Streetline 1', 'Streetline 2'],
|
|
45
|
+
city: 'City',
|
|
46
|
+
telephone: '0987654321',
|
|
47
|
+
postcode: '1234AB',
|
|
46
48
|
save_in_address_book: true,
|
|
47
49
|
},
|
|
48
50
|
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphcommerce/react-hook-form",
|
|
3
|
-
"version": "2.102.
|
|
3
|
+
"version": "2.102.11",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": "14.x"
|
|
@@ -17,19 +17,19 @@
|
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@graphcommerce/browserslist-config-pwa": "^3.0.2",
|
|
20
|
-
"@graphcommerce/eslint-config-pwa": "^3.0
|
|
20
|
+
"@graphcommerce/eslint-config-pwa": "^3.1.0",
|
|
21
21
|
"@graphcommerce/prettier-config-pwa": "^3.0.3",
|
|
22
22
|
"@graphcommerce/typescript-config-pwa": "^3.1.1",
|
|
23
|
-
"@playwright/test": "^1.15.
|
|
23
|
+
"@playwright/test": "^1.15.2"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@apollo/client": "^3.4.16",
|
|
27
27
|
"@graphql-typed-document-node/core": "^3.1.0",
|
|
28
|
-
"graphql": "^15.6.
|
|
28
|
+
"graphql": "^15.6.1",
|
|
29
29
|
"react": "^17.0.2",
|
|
30
30
|
"react-dom": "^17.0.2",
|
|
31
|
-
"react-hook-form": "
|
|
32
|
-
"type-fest": "^2.
|
|
31
|
+
"react-hook-form": "7.16.2",
|
|
32
|
+
"type-fest": "^2.5.1"
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "04a7cc74c49054734b71484e1999af6abfe0ebe2"
|
|
35
35
|
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
import * as Types from '@graphcommerce/graphql';
|
|
3
|
-
|
|
4
|
-
import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';
|
|
5
|
-
|
|
6
|
-
export const TestShippingAddressFormDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"TestShippingAddressForm"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"cartId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"address"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"CartAddressInput"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"customerNote"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"defaultValue":{"kind":"StringValue","value":"joi","block":false}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"setShippingAddressesOnCart"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"cart_id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"cartId"}}},{"kind":"ObjectField","name":{"kind":"Name","value":"shipping_addresses"},"value":{"kind":"ListValue","values":[{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"address"},"value":{"kind":"Variable","name":{"kind":"Name","value":"address"}}},{"kind":"ObjectField","name":{"kind":"Name","value":"customer_notes"},"value":{"kind":"Variable","name":{"kind":"Name","value":"customerNote"}}}]}]}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"cart"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}}]}}]}}]} as unknown as DocumentNode<TestShippingAddressFormMutation, TestShippingAddressFormMutationVariables>;
|
|
7
|
-
export type TestShippingAddressFormMutationVariables = Types.Exact<{
|
|
8
|
-
cartId: Types.Scalars['String'];
|
|
9
|
-
address: Types.CartAddressInput;
|
|
10
|
-
customerNote?: Types.Maybe<Types.Scalars['String']>;
|
|
11
|
-
}>;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export type TestShippingAddressFormMutation = { setShippingAddressesOnCart?: { cart: { id: string } } | null | undefined };
|