Skip to content

Commit

Permalink
Test file upload with location
Browse files Browse the repository at this point in the history
  • Loading branch information
dvacca-onfido committed Sep 4, 2024
1 parent 6487834 commit 8901c75
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
8 changes: 8 additions & 0 deletions test/resources/documents.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
6 changes: 4 additions & 2 deletions test/test-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
FacialSimilarityPhotoReport,
FileTransfer,
LiveVideo,
LocationBuilder,
MotionCapture,
Report,
WatchlistMonitorReportNameEnum,
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 8901c75

Please sign in to comment.