[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-merchant-backoffice] 01/03: reserve
From: |
gnunet |
Subject: |
[taler-merchant-backoffice] 01/03: reserve |
Date: |
Mon, 13 Dec 2021 16:00:58 +0100 |
This is an automated email from the git hooks/post-receive script.
sebasjm pushed a commit to branch master
in repository merchant-backoffice.
commit 010ec79d14a7f3a38942b0852db06a68e064d784
Author: Sebastian <sebasjm@gmail.com>
AuthorDate: Mon Dec 13 11:58:48 2021 -0300
reserve
---
packages/merchant-backoffice/tests/axiosMock.ts | 7 +++++++
.../swr/{reserve-create.test.tsx => reserve.test.ts} | 18 +++++++-----------
2 files changed, 14 insertions(+), 11 deletions(-)
diff --git a/packages/merchant-backoffice/tests/axiosMock.ts
b/packages/merchant-backoffice/tests/axiosMock.ts
index 4f50bec..a6ecf60 100644
--- a/packages/merchant-backoffice/tests/axiosMock.ts
+++ b/packages/merchant-backoffice/tests/axiosMock.ts
@@ -211,6 +211,13 @@ export const API_CREATE_RESERVE: Query<
post: "http://backend/instances/default/private/reserves",
};
+export const API_DELETE_RESERVE: Query<
+ MerchantBackend.Tips.ReserveCreateRequest,
+ MerchantBackend.Tips.ReserveCreateConfirmation
+> = {
+ delete: "http://backend/instances/default/private/reserves",
+};
+
export const API_CREATE_ORDER: Query<
MerchantBackend.Orders.PostOrderRequest,
MerchantBackend.Orders.PostOrderResponse
diff --git
a/packages/merchant-backoffice/tests/hooks/swr/reserve-create.test.tsx
b/packages/merchant-backoffice/tests/hooks/swr/reserve.test.ts
similarity index 91%
rename from packages/merchant-backoffice/tests/hooks/swr/reserve-create.test.tsx
rename to packages/merchant-backoffice/tests/hooks/swr/reserve.test.ts
index cff0f09..96810d3 100644
--- a/packages/merchant-backoffice/tests/hooks/swr/reserve-create.test.tsx
+++ b/packages/merchant-backoffice/tests/hooks/swr/reserve.test.ts
@@ -26,22 +26,15 @@ import * as instance from "../../../src/context/instance";
import { MerchantBackend } from "../../../src/declaration";
import {
useInstanceReserves,
- useReservesAPI,
+ useReservesAPI
} from "../../../src/hooks/reserves";
import {
- API_CREATE_PRODUCT,
- API_LIST_PRODUCTS,
- API_GET_PRODUCT_BY_ID,
- AxiosMockEnvironment,
- assertJustExpectedRequestWereMade,
- API_LIST_RESERVES,
- API_CREATE_RESERVE,
- API_GET_RESERVE_BY_ID,
+ API_CREATE_RESERVE, API_LIST_RESERVES, assertJustExpectedRequestWereMade,
AxiosMockEnvironment
} from "../../axiosMock";
jest.mock("axios");
-describe("reserve create api", () => {
+describe("reserve api", () => {
beforeEach(() => {
jest
.spyOn(backend, "useBackendContext")
@@ -55,7 +48,7 @@ describe("reserve create api", () => {
);
});
- it("should mutate list cache when creating new reserve", async () => {
+ it("should mutate list cache when creating a reserve", async () => {
const env = new AxiosMockEnvironment();
env.addRequestExpectation(API_LIST_RESERVES, {
@@ -149,4 +142,7 @@ describe("reserve create api", () => {
],
});
});
+
+
+
});
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.