Skip to content

Commit 1a2c801

Browse files
committed
chore: update jest snapshots
1 parent e14506c commit 1a2c801

File tree

7 files changed

+171
-201
lines changed

7 files changed

+171
-201
lines changed

src/middlewares/__tests__/__snapshots__/auth-test.js.snap

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,53 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

33
exports[`middlewares/auth \`token\` option as string (with default \`prefix\` and \`header\`) 1`] = `
4-
Object {
5-
"body": "{\\"id\\":\\"1\\",\\"query\\":\\"\\",\\"variables\\":{}}",
6-
"headers": Object {
4+
{
5+
"body": "{"id":"1","query":"","variables":{}}",
6+
"headers": {
77
"Accept": "*/*",
88
"Authorization": "Bearer 123",
99
"Content-Type": "application/json",
1010
},
1111
"method": "POST",
12-
"signal": AbortSignal {},
1312
}
1413
`;
1514

1615
exports[`middlewares/auth \`token\` option as thunk (with custom \`prefix\` and \`header\`) 1`] = `
17-
Object {
18-
"body": "{\\"id\\":\\"1\\",\\"query\\":\\"\\",\\"variables\\":{}}",
19-
"headers": Object {
16+
{
17+
"body": "{"id":"1","query":"","variables":{}}",
18+
"headers": {
2019
"Accept": "*/*",
2120
"Content-Type": "application/json",
2221
"MyAuthorization": "MyBearer 333",
2322
},
2423
"method": "POST",
25-
"signal": AbortSignal {},
2624
}
2725
`;
2826

2927
exports[`middlewares/auth \`tokenRefreshPromise\` should be called on 401 response 1`] = `
30-
Array [
31-
Array [
28+
[
29+
[
3230
"/graphql",
33-
Object {
34-
"body": "{\\"id\\":\\"1\\",\\"query\\":\\"\\",\\"variables\\":{}}",
35-
"headers": Object {
31+
{
32+
"body": "{"id":"1","query":"","variables":{}}",
33+
"headers": {
3634
"Accept": "*/*",
3735
"Authorization": "Bearer 123",
3836
"Content-Type": "application/json",
3937
},
4038
"method": "POST",
41-
"signal": AbortSignal {},
4239
},
4340
],
44-
Array [
41+
[
4542
"/graphql",
46-
Object {
47-
"body": "{\\"id\\":\\"1\\",\\"query\\":\\"\\",\\"variables\\":{}}",
48-
"headers": Object {
43+
{
44+
"body": "{"id":"1","query":"","variables":{}}",
45+
"headers": {
4946
"Accept": "*/*",
5047
"Authorization": "Bearer ValidToken",
5148
"Content-Type": "application/json",
5249
},
5350
"method": "POST",
54-
"signal": AbortSignal {},
5551
},
5652
],
5753
]

src/middlewares/__tests__/__snapshots__/batch-test.js.snap

Lines changed: 48 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

33
exports[`middlewares/batch option \`allowMutations\` should batch mutations if \`allowMutations=true\` 1`] = `
4-
Object {
5-
"body": "[{\\"id\\":\\"1\\",\\"query\\":\\"mutation {}\\",\\"variables\\":{}},{\\"id\\":\\"2\\",\\"query\\":\\"mutation {}\\",\\"variables\\":{}}]",
6-
"headers": Object {
4+
{
5+
"body": "[{"id":"1","query":"mutation {}","variables":{}},{"id":"2","query":"mutation {}","variables":{}}]",
6+
"headers": {
77
"Accept": "*/*",
88
"Content-Type": "application/json",
99
},
@@ -13,38 +13,36 @@ Object {
1313
`;
1414

1515
exports[`middlewares/batch option \`allowMutations\` should not batch mutations by default 1`] = `
16-
Array [
17-
Array [
16+
[
17+
[
1818
"/graphql",
19-
Object {
20-
"body": "{\\"id\\":\\"1\\",\\"query\\":\\"mutation {}\\",\\"variables\\":{}}",
21-
"headers": Object {
19+
{
20+
"body": "{"id":"1","query":"mutation {}","variables":{}}",
21+
"headers": {
2222
"Accept": "*/*",
2323
"Content-Type": "application/json",
2424
},
2525
"method": "POST",
26-
"signal": AbortSignal {},
2726
},
2827
],
29-
Array [
28+
[
3029
"/graphql",
31-
Object {
32-
"body": "{\\"id\\":\\"1\\",\\"query\\":\\"mutation {}\\",\\"variables\\":{}}",
33-
"headers": Object {
30+
{
31+
"body": "{"id":"1","query":"mutation {}","variables":{}}",
32+
"headers": {
3433
"Accept": "*/*",
3534
"Content-Type": "application/json",
3635
},
3736
"method": "POST",
38-
"signal": AbortSignal {},
3937
},
4038
],
4139
]
4240
`;
4341

4442
exports[`middlewares/batch option \`batchTimeout\` should gather different requests into one batch request 1`] = `
45-
Object {
46-
"body": "[{\\"id\\":\\"1\\",\\"query\\":\\"\\",\\"variables\\":{}},{\\"id\\":\\"3\\",\\"query\\":\\"\\",\\"variables\\":{}},{\\"id\\":\\"2\\",\\"query\\":\\"\\",\\"variables\\":{}}]",
47-
"headers": Object {
43+
{
44+
"body": "[{"id":"1","query":"","variables":{}},{"id":"3","query":"","variables":{}},{"id":"2","query":"","variables":{}}]",
45+
"headers": {
4846
"Accept": "*/*",
4947
"Content-Type": "application/json",
5048
},
@@ -54,24 +52,24 @@ Object {
5452
`;
5553

5654
exports[`middlewares/batch option \`batchTimeout\` should gather different requests into two batch request 1`] = `
57-
Array [
58-
Array [
55+
[
56+
[
5957
"/graphql/batch",
60-
Object {
61-
"body": "[{\\"id\\":\\"1\\",\\"query\\":\\"\\",\\"variables\\":{}},{\\"id\\":\\"4\\",\\"query\\":\\"\\",\\"variables\\":{}}]",
62-
"headers": Object {
58+
{
59+
"body": "[{"id":"1","query":"","variables":{}},{"id":"4","query":"","variables":{}}]",
60+
"headers": {
6361
"Accept": "*/*",
6462
"Content-Type": "application/json",
6563
},
6664
"method": "POST",
6765
"url": "/graphql/batch",
6866
},
6967
],
70-
Array [
68+
[
7169
"/graphql/batch",
72-
Object {
73-
"body": "[{\\"id\\":\\"2\\",\\"query\\":\\"\\",\\"variables\\":{}},{\\"id\\":\\"3\\",\\"query\\":\\"\\",\\"variables\\":{}}]",
74-
"headers": Object {
70+
{
71+
"body": "[{"id":"2","query":"","variables":{}},{"id":"3","query":"","variables":{}}]",
72+
"headers": {
7573
"Accept": "*/*",
7674
"Content-Type": "application/json",
7775
},
@@ -83,9 +81,9 @@ Array [
8381
`;
8482

8583
exports[`middlewares/batch should handle network failure 1`] = `
86-
Object {
87-
"body": "[{\\"id\\":\\"1\\",\\"query\\":\\"\\",\\"variables\\":{}},{\\"id\\":\\"2\\",\\"query\\":\\"\\",\\"variables\\":{}}]",
88-
"headers": Object {
84+
{
85+
"body": "[{"id":"1","query":"","variables":{}},{"id":"2","query":"","variables":{}}]",
86+
"headers": {
8987
"Accept": "*/*",
9088
"Content-Type": "application/json",
9189
},
@@ -95,9 +93,9 @@ Object {
9593
`;
9694

9795
exports[`middlewares/batch should handle responses without payload wrapper 1`] = `
98-
Object {
99-
"body": "[{\\"id\\":\\"1\\",\\"query\\":\\"\\",\\"variables\\":{}},{\\"id\\":\\"2\\",\\"query\\":\\"\\",\\"variables\\":{}}]",
100-
"headers": Object {
96+
{
97+
"body": "[{"id":"1","query":"","variables":{}},{"id":"2","query":"","variables":{}}]",
98+
"headers": {
10199
"Accept": "*/*",
102100
"Content-Type": "application/json",
103101
},
@@ -107,9 +105,9 @@ Object {
107105
`;
108106

109107
exports[`middlewares/batch should handle server errors for all requests 1`] = `
110-
Object {
111-
"body": "[{\\"id\\":\\"1\\",\\"query\\":\\"\\",\\"variables\\":{}},{\\"id\\":\\"2\\",\\"query\\":\\"\\",\\"variables\\":{}},{\\"id\\":\\"3\\",\\"query\\":\\"\\",\\"variables\\":{}}]",
112-
"headers": Object {
108+
{
109+
"body": "[{"id":"1","query":"","variables":{}},{"id":"2","query":"","variables":{}},{"id":"3","query":"","variables":{}}]",
110+
"headers": {
113111
"Accept": "*/*",
114112
"Content-Type": "application/json",
115113
},
@@ -119,9 +117,9 @@ Object {
119117
`;
120118

121119
exports[`middlewares/batch should handle server errors for one request 1`] = `
122-
Object {
123-
"body": "[{\\"id\\":\\"1\\",\\"query\\":\\"\\",\\"variables\\":{}},{\\"id\\":\\"2\\",\\"query\\":\\"\\",\\"variables\\":{}}]",
124-
"headers": Object {
120+
{
121+
"body": "[{"id":"1","query":"","variables":{}},{"id":"2","query":"","variables":{}}]",
122+
"headers": {
125123
"Accept": "*/*",
126124
"Content-Type": "application/json",
127125
},
@@ -131,21 +129,20 @@ Object {
131129
`;
132130

133131
exports[`middlewares/batch should make a successfull single request 1`] = `
134-
Object {
135-
"body": "{\\"id\\":\\"1\\",\\"query\\":\\"\\",\\"variables\\":{}}",
136-
"headers": Object {
132+
{
133+
"body": "{"id":"1","query":"","variables":{}}",
134+
"headers": {
137135
"Accept": "*/*",
138136
"Content-Type": "application/json",
139137
},
140138
"method": "POST",
141-
"signal": AbortSignal {},
142139
}
143140
`;
144141

145142
exports[`middlewares/batch should make a successfully batch request 1`] = `
146-
Object {
147-
"body": "[{\\"id\\":\\"1\\",\\"query\\":\\"\\",\\"variables\\":{}},{\\"id\\":\\"2\\",\\"query\\":\\"\\",\\"variables\\":{}}]",
148-
"headers": Object {
143+
{
144+
"body": "[{"id":"1","query":"","variables":{}},{"id":"2","query":"","variables":{}}]",
145+
"headers": {
149146
"Accept": "*/*",
150147
"Content-Type": "application/json",
151148
},
@@ -155,9 +152,9 @@ Object {
155152
`;
156153

157154
exports[`middlewares/batch should make a successfully batch request with duplicate request payloads 1`] = `
158-
Object {
159-
"body": "[{\\"id\\":\\"2\\",\\"query\\":\\"\\",\\"variables\\":{}},{\\"id\\":\\"2\\",\\"query\\":\\"duplicate\\",\\"variables\\":{\\"duplicate\\":true}}]",
160-
"headers": Object {
155+
{
156+
"body": "[{"id":"2","query":"","variables":{}},{"id":"2","query":"duplicate","variables":{"duplicate":true}}]",
157+
"headers": {
161158
"Accept": "*/*",
162159
"Content-Type": "application/json",
163160
},
@@ -167,9 +164,9 @@ Object {
167164
`;
168165

169166
exports[`middlewares/batch should reject if server does not return response for duplicate request payloads 1`] = `
170-
Object {
171-
"body": "[{\\"id\\":\\"1\\",\\"query\\":\\"\\",\\"variables\\":{}},{\\"id\\":\\"2\\",\\"query\\":\\"\\",\\"variables\\":{}},{\\"id\\":\\"3\\",\\"query\\":\\"\\",\\"variables\\":{}}]",
172-
"headers": Object {
167+
{
168+
"body": "[{"id":"1","query":"","variables":{}},{"id":"2","query":"","variables":{}},{"id":"3","query":"","variables":{}}]",
169+
"headers": {
173170
"Accept": "*/*",
174171
"Content-Type": "application/json",
175172
},

0 commit comments

Comments
 (0)