From 79c09c429d924539a12f62f58715cf619cd1a4e6 Mon Sep 17 00:00:00 2001 From: Davide Vacca Date: Thu, 17 Oct 2024 19:17:19 +0200 Subject: [PATCH] Fix tests after library refresh --- test/resources/documents.test.ts | 6 +++--- test/resources/tasks.test.ts | 2 +- test/test-helpers.ts | 5 +++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/test/resources/documents.test.ts b/test/resources/documents.test.ts index 5182f52..c76f279 100644 --- a/test/resources/documents.test.ts +++ b/test/resources/documents.test.ts @@ -1,4 +1,4 @@ -import { Applicant, Document } from "onfido-node"; +import { Applicant, Document, DocumentTypes } from "onfido-node"; import { onfido, @@ -39,7 +39,7 @@ it("uploads a document", async () => { it("uploads a document with location", async () => { document = ( - await uploadDocument(applicant, "driving_licence", { + await uploadDocument(applicant, DocumentTypes.DrivingLicence, { country_of_residence: "FRA" }) ).data; @@ -61,7 +61,7 @@ it("finds a document", async () => { }); it("lists documents", async () => { - const anotherDocument = (await uploadDocument(applicant, "passport")).data; + const anotherDocument = (await uploadDocument(applicant, DocumentTypes.Passport)).data; const documents = ( await onfido.listDocuments(applicant.id) ).data.documents.sort(sortByDocumentType); diff --git a/test/resources/tasks.test.ts b/test/resources/tasks.test.ts index e9d0b1f..068f2a2 100644 --- a/test/resources/tasks.test.ts +++ b/test/resources/tasks.test.ts @@ -51,7 +51,7 @@ it("finds a task", async () => { const task = await onfido.findTask(workflowRunId, taskId); expect(task.data).toEqual( - getExpectedTask(exampleTask, { input: expect.anything(), output: null }) + getExpectedTask(exampleTask, { input: expect.anything(), output: expect.anything() }) ); }); diff --git a/test/test-helpers.ts b/test/test-helpers.ts index b034d06..976791d 100644 --- a/test/test-helpers.ts +++ b/test/test-helpers.ts @@ -16,7 +16,8 @@ import { MotionCapture, Report, WatchlistMonitorReportNameEnum, - WorkflowRunBuilder + WorkflowRunBuilder, + DocumentTypes } from "onfido-node"; export const onfido = new DefaultApi( @@ -91,7 +92,7 @@ export async function cleanUpApplicants() { export async function uploadDocument( applicant: Applicant, - documentType = "driving_licence", + documentType: DocumentTypes = DocumentTypes.DrivingLicence, location?: LocationBuilder ) { let fileTransfer = new FileTransfer("test/media/sample_driving_licence.png");