aboutsummaryrefslogtreecommitdiff
path: root/packages/merchant-backoffice-ui/src/context
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2023-01-03 10:01:04 -0300
committerSebastian <sebasjm@gmail.com>2023-01-03 10:01:04 -0300
commit9ad1f2712a92d58804e090a7c3dd4cc0a41ee1d9 (patch)
tree51ea688742936faece5c5055bc2b66dbf501782d /packages/merchant-backoffice-ui/src/context
parenta2668c22f0d18386fc988f27299172145d9fa15d (diff)
downloadwallet-core-9ad1f2712a92d58804e090a7c3dd4cc0a41ee1d9.tar.xz
pretty
Diffstat (limited to 'packages/merchant-backoffice-ui/src/context')
-rw-r--r--packages/merchant-backoffice-ui/src/context/backend.test.ts26
1 files changed, 18 insertions, 8 deletions
diff --git a/packages/merchant-backoffice-ui/src/context/backend.test.ts b/packages/merchant-backoffice-ui/src/context/backend.test.ts
index c7fb19293..77395ca0c 100644
--- a/packages/merchant-backoffice-ui/src/context/backend.test.ts
+++ b/packages/merchant-backoffice-ui/src/context/backend.test.ts
@@ -29,14 +29,17 @@ import {
} from "../hooks/instance.js";
import { expect } from "chai";
import { ApiMockEnvironment } from "../hooks/testing.js";
-import { API_CREATE_INSTANCE, API_UPDATE_CURRENT_INSTANCE_AUTH, API_UPDATE_INSTANCE_AUTH_BY_ID } from "../hooks/urls.js";
+import {
+ API_CREATE_INSTANCE,
+ API_UPDATE_CURRENT_INSTANCE_AUTH,
+ API_UPDATE_INSTANCE_AUTH_BY_ID,
+} from "../hooks/urls.js";
interface TestingContextProps {
children?: ComponentChildren;
}
describe("backend context api ", () => {
-
it("should use new token after updating the instance token in the settings as user", async () => {
const env = new ApiMockEnvironment();
@@ -61,10 +64,12 @@ describe("backend context api ", () => {
} as MerchantBackend.Instances.QueryInstancesResponse,
});
- management.setNewToken("another_token")
+ management.setNewToken("another_token");
},
({ instance, management, admin }) => {
- expect(env.assertJustExpectedRequestWereMade()).deep.eq({ result: "ok" });
+ expect(env.assertJustExpectedRequestWereMade()).deep.eq({
+ result: "ok",
+ });
env.addRequestExpectation(API_CREATE_INSTANCE, {
auth: "another_token",
@@ -76,9 +81,10 @@ describe("backend context api ", () => {
admin.createInstance({
id: "new_instance_id",
} as MerchantBackend.Instances.InstanceConfigurationMessage);
-
},
- ], env.buildTestingContext());
+ ],
+ env.buildTestingContext(),
+ );
expect(hookBehavior).deep.eq({ result: "ok" });
expect(env.assertJustExpectedRequestWereMade()).deep.eq({ result: "ok" });
@@ -110,7 +116,9 @@ describe("backend context api ", () => {
instance.setNewToken("another_token");
},
({ instance, management, admin }) => {
- expect(env.assertJustExpectedRequestWereMade()).deep.eq({ result: "ok" });
+ expect(env.assertJustExpectedRequestWereMade()).deep.eq({
+ result: "ok",
+ });
env.addRequestExpectation(API_CREATE_INSTANCE, {
auth: "another_token",
@@ -123,7 +131,9 @@ describe("backend context api ", () => {
id: "new_instance_id",
} as MerchantBackend.Instances.InstanceConfigurationMessage);
},
- ], env.buildTestingContext());
+ ],
+ env.buildTestingContext(),
+ );
expect(hookBehavior).deep.eq({ result: "ok" });
expect(env.assertJustExpectedRequestWereMade()).deep.eq({ result: "ok" });