Skip to content

Commit

Permalink
test documents.process
Browse files Browse the repository at this point in the history
  • Loading branch information
eyeseast committed Apr 16, 2024
1 parent 9344630 commit ebf3628
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/lib/api/documents.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
6 changes: 5 additions & 1 deletion src/lib/api/documents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Response> {
Expand Down

0 comments on commit ebf3628

Please sign in to comment.