summaryrefslogtreecommitdiff
path: root/packages/merchant-backoffice-ui/src/hooks/order.test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/merchant-backoffice-ui/src/hooks/order.test.ts')
-rw-r--r--packages/merchant-backoffice-ui/src/hooks/order.test.ts21
1 files changed, 11 insertions, 10 deletions
diff --git a/packages/merchant-backoffice-ui/src/hooks/order.test.ts b/packages/merchant-backoffice-ui/src/hooks/order.test.ts
index 86f53a342..08fffbcf0 100644
--- a/packages/merchant-backoffice-ui/src/hooks/order.test.ts
+++ b/packages/merchant-backoffice-ui/src/hooks/order.test.ts
@@ -19,9 +19,9 @@
* @author Sebastian Javier Marchano (sebasjm)
*/
+import { AmountString, TalerMerchantApi } from "@gnu-taler/taler-util";
import * as tests from "@gnu-taler/web-util/testing";
import { expect } from "chai";
-import { MerchantBackend } from "../declaration.js";
import { useInstanceOrders, useOrderAPI, useOrderDetails } from "./order.js";
import { ApiMockEnvironment } from "./testing.js";
import {
@@ -40,7 +40,7 @@ describe("order api interaction with listing", () => {
env.addRequestExpectation(API_LIST_ORDERS, {
qparam: { delta: -20, paid: "yes" },
response: {
- orders: [{ order_id: "1" }, { order_id: "2" } as MerchantBackend.Orders.OrderHistoryEntry],
+ orders: [{ order_id: "1" }, { order_id: "2" } as TalerMerchantApi.OrderHistoryEntry],
},
});
@@ -72,7 +72,8 @@ describe("order api interaction with listing", () => {
env.addRequestExpectation(API_CREATE_ORDER, {
request: {
- order: { amount: "ARS:12", summary: "pay me" },
+ order: { amount: "ARS:12" as AmountString, summary: "pay me" },
+ lock_uuids: []
},
response: { order_id: "3" },
});
@@ -116,7 +117,7 @@ describe("order api interaction with listing", () => {
order_id: "1",
amount: "EUR:12",
refundable: true,
- } as MerchantBackend.Orders.OrderHistoryEntry] },
+ } as TalerMerchantApi.OrderHistoryEntry] },
});
const newDate = (d: Date) => {
@@ -202,7 +203,7 @@ describe("order api interaction with listing", () => {
env.addRequestExpectation(API_LIST_ORDERS, {
qparam: { delta: -20, paid: "yes" },
response: {
- orders: [{ order_id: "1" }, { order_id: "2" } as MerchantBackend.Orders.OrderHistoryEntry],
+ orders: [{ order_id: "1" }, { order_id: "2" } as TalerMerchantApi.OrderHistoryEntry],
},
});
@@ -271,7 +272,7 @@ describe("order api interaction with details", () => {
response: {
summary: "description",
refund_amount: "EUR:0",
- } as unknown as MerchantBackend.Orders.CheckPaymentPaidResponse,
+ } as unknown as TalerMerchantApi.CheckPaymentPaidResponse,
});
const newDate = (d: Date) => {
@@ -311,12 +312,12 @@ describe("order api interaction with details", () => {
response: {
summary: "description",
refund_amount: "EUR:1",
- } as unknown as MerchantBackend.Orders.CheckPaymentPaidResponse,
+ } as unknown as TalerMerchantApi.CheckPaymentPaidResponse,
});
api.refundOrder("1", {
reason: "double pay",
- refund: "EUR:1",
+ refund: "EUR:1" as AmountString,
});
},
({ query, api }) => {
@@ -347,7 +348,7 @@ describe("order api interaction with details", () => {
response: {
summary: "description",
refund_amount: "EUR:0",
- } as unknown as MerchantBackend.Orders.CheckPaymentPaidResponse,
+ } as unknown as TalerMerchantApi.CheckPaymentPaidResponse,
});
const newDate = (d: Date) => {
@@ -385,7 +386,7 @@ describe("order api interaction with details", () => {
env.addRequestExpectation(API_GET_ORDER_BY_ID("1"), {
response: {
summary: undefined,
- } as unknown as MerchantBackend.Orders.CheckPaymentPaidResponse,
+ } as unknown as TalerMerchantApi.CheckPaymentPaidResponse,
});
api.forgetOrder("1", {