From ebf3628f56a2bd206a7990380f9e493a994c9e0f Mon Sep 17 00:00:00 2001 From: Chris Amico Date: Mon, 15 Apr 2024 20:51:23 -0400 Subject: [PATCH] test documents.process --- src/lib/api/documents.test.ts | 8 +++++++- src/lib/api/documents.ts | 6 +++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/lib/api/documents.test.ts b/src/lib/api/documents.test.ts index 62c4ca6f0..06619fd0b 100644 --- a/src/lib/api/documents.test.ts +++ b/src/lib/api/documents.test.ts @@ -93,7 +93,13 @@ describe("document uploads and processing", () => { }, })); - // const resp = await documents.process(); + const resp = await documents.process( + created.map((d) => ({ id: d.id })), + "csrf_token", + mockFetch, + ); + + expect(resp.ok).toBeTruthy(); }); test.todo("documents.cancel"); diff --git a/src/lib/api/documents.ts b/src/lib/api/documents.ts index 28e6a9261..b06745b99 100644 --- a/src/lib/api/documents.ts +++ b/src/lib/api/documents.ts @@ -135,7 +135,11 @@ export async function upload( * @export */ export async function process( - documents: { id: string | number; force_ocr: boolean; ocr_engine: string }[], + documents: { + id: string | number; + force_ocr?: boolean; + ocr_engine?: string; + }[], csrf_token: string, fetch = globalThis.fetch, ): Promise {