fix : dupe slip issue
This commit is contained in:
@@ -36,9 +36,10 @@ describe("commission slip verification", () => {
|
||||
const fetch = vi.fn(async (_url: URL, init: RequestInit) => {
|
||||
expect(init.headers).toEqual({ Authorization: "Bearer secret" });
|
||||
const payload = JSON.parse((init.body as FormData).get("payload") as string);
|
||||
expect(payload).toMatchObject({ checkDuplicate: true,
|
||||
expect(payload).toMatchObject({
|
||||
checkReceiver: [{ accountType: "02001", accountNumber: "0812345678" }],
|
||||
checkAmount: { type: "eq", amount: "100.00" } });
|
||||
expect(payload).not.toHaveProperty("checkDuplicate");
|
||||
return Response.json(response);
|
||||
});
|
||||
vi.stubGlobal("fetch", fetch);
|
||||
|
||||
@@ -38,7 +38,6 @@ export async function verifyCommissionSlip(file: File, amountBaht: number, check
|
||||
const form = new FormData();
|
||||
form.set("file", file);
|
||||
form.set("payload", JSON.stringify({
|
||||
checkDuplicate: true,
|
||||
checkReceiver: [{
|
||||
accountType: { mobile: "02001", nationalId: "02003", ewallet: "02004" }[identifier.type],
|
||||
accountNumber: receiverNumber,
|
||||
|
||||
Reference in New Issue
Block a user