Skip to content

Commit

Permalink
Add downloadEvidenceFolder test
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelfteixeira committed Jan 7, 2025
1 parent 0ee10a6 commit 0e4015e
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/resources/workflow-runs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,3 +150,20 @@ it("downloads a timeline file", async () => {
expect(file.headers["content-type"]).toEqual("application/pdf");
expect(file.data.buffer.slice(0, 5)).toEqual("%PDF-");
}, 60000);

it("downloads an evidence folder", async () => {
const workflowRunId = (await createWorkflowRun(applicant, workflowIdTimeline))
.data.id;

await repeatRequestUntilStatusChanges(
"findWorkflowRun",
[workflowRunId],
"approved"
);

const file = await onfido.downloadEvidenceFolder(workflowRunId);

expect(file.status).toEqual(200);
expect(file.headers["content-type"]).toEqual("application/zip");
expect(file.data.buffer.length).toBeGreaterThan(0);
}, 60000);

0 comments on commit 0e4015e

Please sign in to comment.