diff options
author | Sebastian <sebasjm@gmail.com> | 2023-11-09 09:59:21 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2023-11-09 09:59:21 -0300 |
commit | eb3ce7e9abb04d1cd24ae070b04b2c8698dd3594 (patch) | |
tree | 95150ed17fab9cca3f6e4d1544c4ecaecd3713dd /packages/merchant-backoffice-ui | |
parent | 98c5e45dedb18faba8252611ae4fdc006679f8f4 (diff) | |
download | wallet-core-eb3ce7e9abb04d1cd24ae070b04b2c8698dd3594.tar.xz |
update test for new auth api
Diffstat (limited to 'packages/merchant-backoffice-ui')
-rw-r--r-- | packages/merchant-backoffice-ui/src/context/backend.test.ts | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/packages/merchant-backoffice-ui/src/context/backend.test.ts b/packages/merchant-backoffice-ui/src/context/backend.test.ts index ad6393e29..359859819 100644 --- a/packages/merchant-backoffice-ui/src/context/backend.test.ts +++ b/packages/merchant-backoffice-ui/src/context/backend.test.ts @@ -31,6 +31,7 @@ import { expect } from "chai"; import { ApiMockEnvironment } from "../hooks/testing.js"; import { API_CREATE_INSTANCE, + API_NEW_LOGIN, API_UPDATE_CURRENT_INSTANCE_AUTH, API_UPDATE_INSTANCE_AUTH_BY_ID, } from "../hooks/urls.js"; @@ -63,6 +64,17 @@ describe("backend context api ", () => { name: "instance_name", } as MerchantBackend.Instances.QueryInstancesResponse, }); + env.addRequestExpectation(API_NEW_LOGIN, { + auth: "another_token", + request: { + scope: "write", + duration: { + "d_us": "forever", + }, + refreshable: true, + }, + + }); management.setNewAccessToken(undefined,"another_token" as AccessToken); }, @@ -72,7 +84,7 @@ describe("backend context api ", () => { }); env.addRequestExpectation(API_CREATE_INSTANCE, { - auth: "another_token", + // auth: "another_token", request: { id: "new_instance_id", } as MerchantBackend.Instances.InstanceConfigurationMessage, @@ -113,6 +125,16 @@ describe("backend context api ", () => { name: "instance_name", } as MerchantBackend.Instances.QueryInstancesResponse, }); + env.addRequestExpectation(API_NEW_LOGIN, { + auth: "another_token", + request: { + scope: "write", + duration: { + "d_us": "forever", + }, + refreshable: true, + }, + }); instance.setNewAccessToken(undefined, "another_token" as AccessToken); }, ({ instance, management, admin }) => { @@ -121,7 +143,7 @@ describe("backend context api ", () => { }); env.addRequestExpectation(API_CREATE_INSTANCE, { - auth: "another_token", + // auth: "another_token", request: { id: "new_instance_id", } as MerchantBackend.Instances.InstanceConfigurationMessage, |