aboutsummaryrefslogtreecommitdiff
path: root/packages/merchant-backoffice-ui/src/context/backend.test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/merchant-backoffice-ui/src/context/backend.test.ts')
-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" });