From 8901c75691666daa39e25a4ab238756ba27aceeb Mon Sep 17 00:00:00 2001 From: Davide Vacca Date: Wed, 4 Sep 2024 10:48:30 +0200 Subject: [PATCH] Test file upload with location --- test/resources/documents.test.ts | 8 ++++++++ test/test-helpers.ts | 6 ++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/test/resources/documents.test.ts b/test/resources/documents.test.ts index 7cb745e..5182f52 100644 --- a/test/resources/documents.test.ts +++ b/test/resources/documents.test.ts @@ -37,6 +37,14 @@ it("uploads a document", async () => { expect(document).toEqual(getExpectedDocument(exampleDocument)); }); +it("uploads a document with location", async () => { + document = ( + await uploadDocument(applicant, "driving_licence", { + country_of_residence: "FRA" + }) + ).data; +}); + it("downloads a document", async () => { const file = await onfido.downloadDocument(document.id); diff --git a/test/test-helpers.ts b/test/test-helpers.ts index 50a1a2b..b034d06 100644 --- a/test/test-helpers.ts +++ b/test/test-helpers.ts @@ -12,6 +12,7 @@ import { FacialSimilarityPhotoReport, FileTransfer, LiveVideo, + LocationBuilder, MotionCapture, Report, WatchlistMonitorReportNameEnum, @@ -90,11 +91,12 @@ export async function cleanUpApplicants() { export async function uploadDocument( applicant: Applicant, - documentType = "driving_licence" + documentType = "driving_licence", + location?: LocationBuilder ) { let fileTransfer = new FileTransfer("test/media/sample_driving_licence.png"); - return onfido.uploadDocument(documentType, applicant.id, fileTransfer); + return onfido.uploadDocument(documentType, applicant.id, fileTransfer, undefined, undefined, undefined, undefined, location); } export async function uploadLivePhoto(