mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-14 06:40:50 +00:00
test(medications): hand the label upload a plain byte array
This commit is contained in:
1 parent
b35da281aa
commit
c5da5debb2
1 file changed
+4
-1
@@ -618,7 +618,10 @@ describe("POST /api/medications/{id}/ingredients/extract", () => {
|
|||||||
const { POST } =
|
const { POST } =
|
||||||
await import("@/app/api/medications/[id]/ingredients/extract/route");
|
await import("@/app/api/medications/[id]/ingredients/extract/route");
|
||||||
const form = new FormData();
|
const form = new FormData();
|
||||||
form.append("file", new File([bytes], "label.png", { type: "image/png" }));
|
form.append(
|
||||||
|
"file",
|
||||||
|
new File([new Uint8Array(bytes)], "label.png", { type: "image/png" }),
|
||||||
|
);
|
||||||
const res = await (POST as Handler)(
|
const res = await (POST as Handler)(
|
||||||
new NextRequest(
|
new NextRequest(
|
||||||
`http://localhost/api/medications/${medicationId}/ingredients/extract`,
|
`http://localhost/api/medications/${medicationId}/ingredients/extract`,
|
||||||
|
|||||||
Reference in new issue
Block a user