Skip to content

Commit c546164

Browse files
committed
Add tests for DocumentWithDrivingLicenseInformation and DeviceIntelligence reports
1 parent 2d59dd6 commit c546164

File tree

2 files changed

+50
-1
lines changed

2 files changed

+50
-1
lines changed

test/resources/report-schemas.test.ts

+45
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import {
22
Applicant,
33
Check,
4+
DeviceIntelligenceReport,
45
Document,
56
DocumentReport,
67
DocumentWithAddressInformationReport,
8+
DocumentWithDrivingLicenceInformationReport,
79
FacialSimilarityPhotoReport,
810
Report,
911
ReportName
@@ -113,3 +115,46 @@ it("schema of document with address information report should be valid", async (
113115
"driving_licence"
114116
);
115117
}, 30000);
118+
119+
it("schema of document with driving license information report should be valid", async () => {
120+
await uploadLivePhoto(applicant);
121+
const check: Check = (
122+
await createCheck(applicant, document, {
123+
report_names: [ReportName.DocumentWithDrivingLicenceInformation]
124+
})
125+
).data;
126+
127+
const report: Report = await repeatRequestUntilStatusChanges(
128+
"findReport",
129+
[check.report_ids[0]],
130+
"complete"
131+
);
132+
133+
const document_report = report as DocumentWithDrivingLicenceInformationReport;
134+
135+
expect(document_report.name).toEqual(
136+
"document_with_driving_licence_information"
137+
);
138+
expect(document_report.properties.driving_licence_information).not.toBeNull();
139+
}, 30000);
140+
141+
it("schema of device intelligence report should be valid", async () => {
142+
await uploadLivePhoto(applicant);
143+
const check: Check = (
144+
await createCheck(applicant, document, {
145+
report_names: [ReportName.DeviceIntelligence]
146+
})
147+
).data;
148+
149+
const report: Report = await repeatRequestUntilStatusChanges(
150+
"findReport",
151+
[check.report_ids[0]],
152+
"complete"
153+
);
154+
155+
const device_intelligence = report as DeviceIntelligenceReport;
156+
157+
expect(device_intelligence.name).toEqual("device_intelligence");
158+
expect(device_intelligence.breakdown).not.toBeNull();
159+
expect(device_intelligence.properties).not.toBeNull();
160+
}, 30000);

test/resources/webhooks.test.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ import { exampleWebhook } from "../test-examples";
1010

1111
function getExpectedWebhook(exampleWebhook: Webhook) {
1212
return getExpectedObject(exampleWebhook, {
13-
token: expect.stringMatching(/^[0-9a-zA-Z_-]+$/)
13+
token: expect.stringMatching(/^[0-9a-zA-Z_-]+$/),
14+
oauth_enabled: false,
15+
oauth_server_client_id: null,
16+
oauth_server_client_secret: null,
17+
oauth_server_url: null
1418
});
1519
}
1620

0 commit comments

Comments
 (0)