-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathverify.v2.integration.errors.test.ts
339 lines (335 loc) · 19.7 KB
/
verify.v2.integration.errors.test.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
/**
* @jest-environment node
*/
import { rest } from "msw";
import { setupServer } from "msw/node";
import { documentMainnetValid } from "../test/fixtures/v2/documentMainnetValid";
import { INFURA_API_KEY } from "./config";
import { isValid, openAttestationVerifiers, verificationBuilder, verify } from "./index";
const verifyHomestead = verify;
const verifySepolia = verificationBuilder(openAttestationVerifiers, { network: "sepolia" });
describe("Handling HTTP response errors", () => {
const server = setupServer(); // Placing the following tests in a separate block due to how msw intercepts ALL connections
beforeAll(() => server.listen()); // Enable API mocking before tests
beforeEach(() => {
jest.resetModules();
process.env = {
PROVIDER_NETWORK: "",
PROVIDER_API_KEY: "",
PROVIDER_ENDPOINT_TYPE: "",
PROVIDER_ENDPOINT_URL: "",
};
});
afterEach(() => server.resetHandlers()); // Reset any runtime request handlers we may add during the tests
afterAll(() => server.close()); // Disable API mocking after the tests are done
it("should return SERVER_ERROR when Ethers cannot connect to Infura with a valid certificate (HTTP 429)", async () => {
process.env.PROVIDER_API_KEY = INFURA_API_KEY;
server.use(
rest.post(`https://mainnet.infura.io/v3/${INFURA_API_KEY}`, (req, res, ctx) => {
return res(
ctx.status(429, "Mocked rate limit error"),
ctx.json({ jsonrpc: "2.0", result: "0xs0meR4nd0mErr0r", id: 1 })
);
})
);
const results = await verifyHomestead(documentMainnetValid);
expect(results).toMatchInlineSnapshot(`
Array [
Object {
"data": true,
"name": "OpenAttestationHash",
"status": "VALID",
"type": "DOCUMENT_INTEGRITY",
},
Object {
"name": "OpenAttestationEthereumTokenRegistryStatus",
"reason": Object {
"code": 4,
"codeString": "SKIPPED",
"message": "Document issuers doesn't have \\\"tokenRegistry\\\" property or TOKEN_REGISTRY method",
},
"status": "SKIPPED",
"type": "DOCUMENT_STATUS",
},
Object {
"data": [Error: missing revert data in call exception; Transaction reverted without a reason string [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ] (data="0x", transaction={"to":"0x007d40224F6562461633ccFBaffd359EbB2FC9Ba","data":"0x163aa6311a040999254caaf7a33cba67ec6a9b862da1dacf8a0d1e3bb76347060fc615d6","accessList":null}, error={"reason":"failed response","code":"SERVER_ERROR","requestBody":"{\\"method\\":\\"eth_call\\",\\"params\\":[{\\"to\\":\\"0x007d40224f6562461633ccfbaffd359ebb2fc9ba\\",\\"data\\":\\"0x163aa6311a040999254caaf7a33cba67ec6a9b862da1dacf8a0d1e3bb76347060fc615d6\\"},\\"latest\\"],\\"id\\":43,\\"jsonrpc\\":\\"2.0\\"}","requestMethod":"POST","url":"https://mainnet.infura.io/v3/bb46da3f80e040e8ab73c0a9ff365d18"}, code=CALL_EXCEPTION, version=providers/5.7.2)],
"name": "OpenAttestationEthereumDocumentStoreStatus",
"reason": Object {
"code": 0,
"codeString": "UNEXPECTED_ERROR",
"message": "missing revert data in call exception; Transaction reverted without a reason string [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ] (data=\\"0x\\", transaction={\\"to\\":\\"0x007d40224F6562461633ccFBaffd359EbB2FC9Ba\\",\\"data\\":\\"0x163aa6311a040999254caaf7a33cba67ec6a9b862da1dacf8a0d1e3bb76347060fc615d6\\",\\"accessList\\":null}, error={\\"reason\\":\\"failed response\\",\\"code\\":\\"SERVER_ERROR\\",\\"requestBody\\":\\"{\\\\\\"method\\\\\\":\\\\\\"eth_call\\\\\\",\\\\\\"params\\\\\\":[{\\\\\\"to\\\\\\":\\\\\\"0x007d40224f6562461633ccfbaffd359ebb2fc9ba\\\\\\",\\\\\\"data\\\\\\":\\\\\\"0x163aa6311a040999254caaf7a33cba67ec6a9b862da1dacf8a0d1e3bb76347060fc615d6\\\\\\"},\\\\\\"latest\\\\\\"],\\\\\\"id\\\\\\":43,\\\\\\"jsonrpc\\\\\\":\\\\\\"2.0\\\\\\"}\\",\\"requestMethod\\":\\"POST\\",\\"url\\":\\"https://mainnet.infura.io/v3/bb46da3f80e040e8ab73c0a9ff365d18\\"}, code=CALL_EXCEPTION, version=providers/5.7.2)",
},
"status": "ERROR",
"type": "DOCUMENT_STATUS",
},
Object {
"name": "OpenAttestationDidSignedDocumentStatus",
"reason": Object {
"code": 0,
"codeString": "SKIPPED",
"message": "Document was not signed by DID directly",
},
"status": "SKIPPED",
"type": "DOCUMENT_STATUS",
},
Object {
"name": "OpenAttestationDnsTxtIdentityProof",
"reason": Object {
"code": 2,
"codeString": "SKIPPED",
"message": "Document issuers doesn't have \\\"documentStore\\\" / \\\"tokenRegistry\\\" property or doesn't use DNS-TXT type",
},
"status": "SKIPPED",
"type": "ISSUER_IDENTITY",
},
Object {
"name": "OpenAttestationDnsDidIdentityProof",
"reason": Object {
"code": 0,
"codeString": "SKIPPED",
"message": "Document was not issued using DNS-DID",
},
"status": "SKIPPED",
"type": "ISSUER_IDENTITY",
},
]
`);
// it's not valid on ISSUER_IDENTITY (skipped) so making sure the rest is valid
expect(isValid(results)).toStrictEqual(false);
expect(isValid(results, ["DOCUMENT_INTEGRITY"])).toStrictEqual(true);
expect(isValid(results, ["DOCUMENT_STATUS"])).toStrictEqual(false); // Because of SERVER_ERROR
}, 60000);
it("should return SERVER_ERROR when Ethers cannot connect to Infura with a valid certificate (HTTP 502)", async () => {
process.env.PROVIDER_API_KEY = INFURA_API_KEY;
server.use(
rest.post(`https://mainnet.infura.io/v3/${INFURA_API_KEY}`, (req, res, ctx) => {
return res(
ctx.status(502, "Mocked rate limit error"),
ctx.json({ jsonrpc: "2.0", result: "0xs0meR4nd0mErr0r", id: 2 })
);
})
);
const results = await verifyHomestead(documentMainnetValid);
expect(results).toMatchInlineSnapshot(`
Array [
Object {
"data": true,
"name": "OpenAttestationHash",
"status": "VALID",
"type": "DOCUMENT_INTEGRITY",
},
Object {
"name": "OpenAttestationEthereumTokenRegistryStatus",
"reason": Object {
"code": 4,
"codeString": "SKIPPED",
"message": "Document issuers doesn't have \\\"tokenRegistry\\\" property or TOKEN_REGISTRY method",
},
"status": "SKIPPED",
"type": "DOCUMENT_STATUS",
},
Object {
"data": [Error: missing revert data in call exception; Transaction reverted without a reason string [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ] (data="0x", transaction={"to":"0x007d40224F6562461633ccFBaffd359EbB2FC9Ba","data":"0x163aa6311a040999254caaf7a33cba67ec6a9b862da1dacf8a0d1e3bb76347060fc615d6","accessList":null}, error={"reason":"bad response","code":"SERVER_ERROR","status":502,"headers":{"x-powered-by":"msw","content-type":"application/json"},"body":"{\\"jsonrpc\\":\\"2.0\\",\\"result\\":\\"0xs0meR4nd0mErr0r\\",\\"id\\":2}","requestBody":"{\\"method\\":\\"eth_call\\",\\"params\\":[{\\"to\\":\\"0x007d40224f6562461633ccfbaffd359ebb2fc9ba\\",\\"data\\":\\"0x163aa6311a040999254caaf7a33cba67ec6a9b862da1dacf8a0d1e3bb76347060fc615d6\\"},\\"latest\\"],\\"id\\":43,\\"jsonrpc\\":\\"2.0\\"}","requestMethod":"POST","url":"https://mainnet.infura.io/v3/bb46da3f80e040e8ab73c0a9ff365d18"}, code=CALL_EXCEPTION, version=providers/5.7.2)],
"name": "OpenAttestationEthereumDocumentStoreStatus",
"reason": Object {
"code": 0,
"codeString": "UNEXPECTED_ERROR",
"message": "missing revert data in call exception; Transaction reverted without a reason string [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ] (data=\\"0x\\", transaction={\\"to\\":\\"0x007d40224F6562461633ccFBaffd359EbB2FC9Ba\\",\\"data\\":\\"0x163aa6311a040999254caaf7a33cba67ec6a9b862da1dacf8a0d1e3bb76347060fc615d6\\",\\"accessList\\":null}, error={\\"reason\\":\\"bad response\\",\\"code\\":\\"SERVER_ERROR\\",\\"status\\":502,\\"headers\\":{\\"x-powered-by\\":\\"msw\\",\\"content-type\\":\\"application/json\\"},\\"body\\":\\"{\\\\\\"jsonrpc\\\\\\":\\\\\\"2.0\\\\\\",\\\\\\"result\\\\\\":\\\\\\"0xs0meR4nd0mErr0r\\\\\\",\\\\\\"id\\\\\\":2}\\",\\"requestBody\\":\\"{\\\\\\"method\\\\\\":\\\\\\"eth_call\\\\\\",\\\\\\"params\\\\\\":[{\\\\\\"to\\\\\\":\\\\\\"0x007d40224f6562461633ccfbaffd359ebb2fc9ba\\\\\\",\\\\\\"data\\\\\\":\\\\\\"0x163aa6311a040999254caaf7a33cba67ec6a9b862da1dacf8a0d1e3bb76347060fc615d6\\\\\\"},\\\\\\"latest\\\\\\"],\\\\\\"id\\\\\\":43,\\\\\\"jsonrpc\\\\\\":\\\\\\"2.0\\\\\\"}\\",\\"requestMethod\\":\\"POST\\",\\"url\\":\\"https://mainnet.infura.io/v3/bb46da3f80e040e8ab73c0a9ff365d18\\"}, code=CALL_EXCEPTION, version=providers/5.7.2)",
},
"status": "ERROR",
"type": "DOCUMENT_STATUS",
},
Object {
"name": "OpenAttestationDidSignedDocumentStatus",
"reason": Object {
"code": 0,
"codeString": "SKIPPED",
"message": "Document was not signed by DID directly",
},
"status": "SKIPPED",
"type": "DOCUMENT_STATUS",
},
Object {
"name": "OpenAttestationDnsTxtIdentityProof",
"reason": Object {
"code": 2,
"codeString": "SKIPPED",
"message": "Document issuers doesn't have \\\"documentStore\\\" / \\\"tokenRegistry\\\" property or doesn't use DNS-TXT type",
},
"status": "SKIPPED",
"type": "ISSUER_IDENTITY",
},
Object {
"name": "OpenAttestationDnsDidIdentityProof",
"reason": Object {
"code": 0,
"codeString": "SKIPPED",
"message": "Document was not issued using DNS-DID",
},
"status": "SKIPPED",
"type": "ISSUER_IDENTITY",
},
]
`);
// it's not valid on ISSUER_IDENTITY (skipped) so making sure the rest is valid
expect(isValid(results)).toStrictEqual(false);
expect(isValid(results, ["DOCUMENT_INTEGRITY"])).toStrictEqual(true);
expect(isValid(results, ["DOCUMENT_STATUS"])).toStrictEqual(false); // Because of SERVER_ERROR
});
it("should return SERVER_ERROR when Ethers cannot connect to Infura with an invalid certificate (HTTP 429)", async () => {
process.env.PROVIDER_API_KEY = INFURA_API_KEY;
// NOTE: Purpose of this test is to use a mainnet cert on sepolia. The mainnet cert store is perfectly valid, but does not exist on sepolia.
server.use(
rest.post(`https://sepolia.infura.io/v3/${INFURA_API_KEY}`, (req, res, ctx) => {
return res(
ctx.status(429, "Mocked rate limit error"),
ctx.json({ jsonrpc: "2.0", result: "0xs0meR4nd0mErr0r", id: 3 })
);
})
);
const results = await verifySepolia(documentMainnetValid);
expect(results).toMatchInlineSnapshot(`
Array [
Object {
"data": true,
"name": "OpenAttestationHash",
"status": "VALID",
"type": "DOCUMENT_INTEGRITY",
},
Object {
"name": "OpenAttestationEthereumTokenRegistryStatus",
"reason": Object {
"code": 4,
"codeString": "SKIPPED",
"message": "Document issuers doesn't have \\\"tokenRegistry\\\" property or TOKEN_REGISTRY method",
},
"status": "SKIPPED",
"type": "DOCUMENT_STATUS",
},
Object {
"data": [Error: missing revert data in call exception; Transaction reverted without a reason string [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ] (data="0x", transaction={"to":"0x007d40224F6562461633ccFBaffd359EbB2FC9Ba","data":"0x163aa6311a040999254caaf7a33cba67ec6a9b862da1dacf8a0d1e3bb76347060fc615d6","accessList":null}, error={"reason":"failed response","code":"SERVER_ERROR","requestBody":"{\\"method\\":\\"eth_call\\",\\"params\\":[{\\"to\\":\\"0x007d40224f6562461633ccfbaffd359ebb2fc9ba\\",\\"data\\":\\"0x163aa6311a040999254caaf7a33cba67ec6a9b862da1dacf8a0d1e3bb76347060fc615d6\\"},\\"latest\\"],\\"id\\":43,\\"jsonrpc\\":\\"2.0\\"}","requestMethod":"POST","url":"https://sepolia.infura.io/v3/bb46da3f80e040e8ab73c0a9ff365d18"}, code=CALL_EXCEPTION, version=providers/5.7.2)],
"name": "OpenAttestationEthereumDocumentStoreStatus",
"reason": Object {
"code": 0,
"codeString": "UNEXPECTED_ERROR",
"message": "missing revert data in call exception; Transaction reverted without a reason string [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ] (data=\\"0x\\", transaction={\\"to\\":\\"0x007d40224F6562461633ccFBaffd359EbB2FC9Ba\\",\\"data\\":\\"0x163aa6311a040999254caaf7a33cba67ec6a9b862da1dacf8a0d1e3bb76347060fc615d6\\",\\"accessList\\":null}, error={\\"reason\\":\\"failed response\\",\\"code\\":\\"SERVER_ERROR\\",\\"requestBody\\":\\"{\\\\\\"method\\\\\\":\\\\\\"eth_call\\\\\\",\\\\\\"params\\\\\\":[{\\\\\\"to\\\\\\":\\\\\\"0x007d40224f6562461633ccfbaffd359ebb2fc9ba\\\\\\",\\\\\\"data\\\\\\":\\\\\\"0x163aa6311a040999254caaf7a33cba67ec6a9b862da1dacf8a0d1e3bb76347060fc615d6\\\\\\"},\\\\\\"latest\\\\\\"],\\\\\\"id\\\\\\":43,\\\\\\"jsonrpc\\\\\\":\\\\\\"2.0\\\\\\"}\\",\\"requestMethod\\":\\"POST\\",\\"url\\":\\"https://sepolia.infura.io/v3/bb46da3f80e040e8ab73c0a9ff365d18\\"}, code=CALL_EXCEPTION, version=providers/5.7.2)",
},
"status": "ERROR",
"type": "DOCUMENT_STATUS",
},
Object {
"name": "OpenAttestationDidSignedDocumentStatus",
"reason": Object {
"code": 0,
"codeString": "SKIPPED",
"message": "Document was not signed by DID directly",
},
"status": "SKIPPED",
"type": "DOCUMENT_STATUS",
},
Object {
"name": "OpenAttestationDnsTxtIdentityProof",
"reason": Object {
"code": 2,
"codeString": "SKIPPED",
"message": "Document issuers doesn't have \\\"documentStore\\\" / \\\"tokenRegistry\\\" property or doesn't use DNS-TXT type",
},
"status": "SKIPPED",
"type": "ISSUER_IDENTITY",
},
Object {
"name": "OpenAttestationDnsDidIdentityProof",
"reason": Object {
"code": 0,
"codeString": "SKIPPED",
"message": "Document was not issued using DNS-DID",
},
"status": "SKIPPED",
"type": "ISSUER_IDENTITY",
},
]
`);
// it's not valid on ISSUER_IDENTITY (skipped) so making sure the rest is valid
expect(isValid(results)).toStrictEqual(false);
expect(isValid(results, ["DOCUMENT_INTEGRITY"])).toStrictEqual(true);
expect(isValid(results, ["DOCUMENT_STATUS"])).toStrictEqual(false); // Because of SERVER_ERROR
});
it("should return SERVER_ERROR when Ethers cannot connect to Infura with an invalid certificate (HTTP 502)", async () => {
process.env.PROVIDER_API_KEY = INFURA_API_KEY;
// NOTE: Purpose of this test is to use a mainnet cert on sepolia. The mainnet cert store is perfectly valid, but does not exist on sepolia.
server.use(
rest.post(`https://sepolia.infura.io/v3/${INFURA_API_KEY}`, (req, res, ctx) => {
return res(
ctx.status(502, "Mocked rate limit error"),
ctx.json({ jsonrpc: "2.0", result: "0xs0meR4nd0mErr0r", id: 4 })
);
})
);
const results = await verifySepolia(documentMainnetValid);
expect(results).toMatchInlineSnapshot(`
Array [
Object {
"data": true,
"name": "OpenAttestationHash",
"status": "VALID",
"type": "DOCUMENT_INTEGRITY",
},
Object {
"name": "OpenAttestationEthereumTokenRegistryStatus",
"reason": Object {
"code": 4,
"codeString": "SKIPPED",
"message": "Document issuers doesn't have \\\"tokenRegistry\\\" property or TOKEN_REGISTRY method",
},
"status": "SKIPPED",
"type": "DOCUMENT_STATUS",
},
Object {
"data": [Error: missing revert data in call exception; Transaction reverted without a reason string [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ] (data="0x", transaction={"to":"0x007d40224F6562461633ccFBaffd359EbB2FC9Ba","data":"0x163aa6311a040999254caaf7a33cba67ec6a9b862da1dacf8a0d1e3bb76347060fc615d6","accessList":null}, error={"reason":"bad response","code":"SERVER_ERROR","status":502,"headers":{"x-powered-by":"msw","content-type":"application/json"},"body":"{\\"jsonrpc\\":\\"2.0\\",\\"result\\":\\"0xs0meR4nd0mErr0r\\",\\"id\\":4}","requestBody":"{\\"method\\":\\"eth_call\\",\\"params\\":[{\\"to\\":\\"0x007d40224f6562461633ccfbaffd359ebb2fc9ba\\",\\"data\\":\\"0x163aa6311a040999254caaf7a33cba67ec6a9b862da1dacf8a0d1e3bb76347060fc615d6\\"},\\"latest\\"],\\"id\\":43,\\"jsonrpc\\":\\"2.0\\"}","requestMethod":"POST","url":"https://sepolia.infura.io/v3/bb46da3f80e040e8ab73c0a9ff365d18"}, code=CALL_EXCEPTION, version=providers/5.7.2)],
"name": "OpenAttestationEthereumDocumentStoreStatus",
"reason": Object {
"code": 0,
"codeString": "UNEXPECTED_ERROR",
"message": "missing revert data in call exception; Transaction reverted without a reason string [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ] (data=\\"0x\\", transaction={\\"to\\":\\"0x007d40224F6562461633ccFBaffd359EbB2FC9Ba\\",\\"data\\":\\"0x163aa6311a040999254caaf7a33cba67ec6a9b862da1dacf8a0d1e3bb76347060fc615d6\\",\\"accessList\\":null}, error={\\"reason\\":\\"bad response\\",\\"code\\":\\"SERVER_ERROR\\",\\"status\\":502,\\"headers\\":{\\"x-powered-by\\":\\"msw\\",\\"content-type\\":\\"application/json\\"},\\"body\\":\\"{\\\\\\"jsonrpc\\\\\\":\\\\\\"2.0\\\\\\",\\\\\\"result\\\\\\":\\\\\\"0xs0meR4nd0mErr0r\\\\\\",\\\\\\"id\\\\\\":4}\\",\\"requestBody\\":\\"{\\\\\\"method\\\\\\":\\\\\\"eth_call\\\\\\",\\\\\\"params\\\\\\":[{\\\\\\"to\\\\\\":\\\\\\"0x007d40224f6562461633ccfbaffd359ebb2fc9ba\\\\\\",\\\\\\"data\\\\\\":\\\\\\"0x163aa6311a040999254caaf7a33cba67ec6a9b862da1dacf8a0d1e3bb76347060fc615d6\\\\\\"},\\\\\\"latest\\\\\\"],\\\\\\"id\\\\\\":43,\\\\\\"jsonrpc\\\\\\":\\\\\\"2.0\\\\\\"}\\",\\"requestMethod\\":\\"POST\\",\\"url\\":\\"https://sepolia.infura.io/v3/bb46da3f80e040e8ab73c0a9ff365d18\\"}, code=CALL_EXCEPTION, version=providers/5.7.2)",
},
"status": "ERROR",
"type": "DOCUMENT_STATUS",
},
Object {
"name": "OpenAttestationDidSignedDocumentStatus",
"reason": Object {
"code": 0,
"codeString": "SKIPPED",
"message": "Document was not signed by DID directly",
},
"status": "SKIPPED",
"type": "DOCUMENT_STATUS",
},
Object {
"name": "OpenAttestationDnsTxtIdentityProof",
"reason": Object {
"code": 2,
"codeString": "SKIPPED",
"message": "Document issuers doesn't have \\\"documentStore\\\" / \\\"tokenRegistry\\\" property or doesn't use DNS-TXT type",
},
"status": "SKIPPED",
"type": "ISSUER_IDENTITY",
},
Object {
"name": "OpenAttestationDnsDidIdentityProof",
"reason": Object {
"code": 0,
"codeString": "SKIPPED",
"message": "Document was not issued using DNS-DID",
},
"status": "SKIPPED",
"type": "ISSUER_IDENTITY",
},
]
`);
// it's not valid on ISSUER_IDENTITY (skipped) so making sure the rest is valid
expect(isValid(results)).toStrictEqual(false);
expect(isValid(results, ["DOCUMENT_INTEGRITY"])).toStrictEqual(true);
expect(isValid(results, ["DOCUMENT_STATUS"])).toStrictEqual(false); // Because of SERVER_ERROR
});
});