test(po-attachments): use NextRequest instead of any cast
This commit is contained in:
parent
1477265db9
commit
9bc9d389ce
1 changed files with 5 additions and 4 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { NextRequest } from "next/server";
|
||||
|
||||
const getOneMock = vi.fn();
|
||||
const updateMock = vi.fn();
|
||||
|
|
@ -32,10 +33,10 @@ describe("DELETE /api/v1/purchase-orders/[id]/attachments/[filename]", () => {
|
|||
updateMock.mockResolvedValueOnce({});
|
||||
|
||||
const res = await DELETE(
|
||||
new Request(
|
||||
new NextRequest(
|
||||
"http://localhost/api/v1/purchase-orders/po-1/attachments/delete-me.pdf",
|
||||
{ method: "DELETE" },
|
||||
) as any,
|
||||
),
|
||||
{ params: Promise.resolve({ id: "po-1", filename: "delete-me.pdf" }) },
|
||||
);
|
||||
|
||||
|
|
@ -53,10 +54,10 @@ describe("DELETE /api/v1/purchase-orders/[id]/attachments/[filename]", () => {
|
|||
});
|
||||
|
||||
const res = await DELETE(
|
||||
new Request(
|
||||
new NextRequest(
|
||||
"http://localhost/api/v1/purchase-orders/po-1/attachments/other.pdf",
|
||||
{ method: "DELETE" },
|
||||
) as any,
|
||||
),
|
||||
{ params: Promise.resolve({ id: "po-1", filename: "other.pdf" }) },
|
||||
);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue