From 9ad1f2712a92d58804e090a7c3dd4cc0a41ee1d9 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Tue, 3 Jan 2023 10:01:04 -0300 Subject: pretty --- .../src/context/backend.test.ts | 26 +++++++++++++++------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'packages/merchant-backoffice-ui/src/context/backend.test.ts') 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" }); -- cgit v1.2.3