Skip to content

Commit 4156dac

Browse files
committed
Restore SSO access token coverage
1 parent 4dbbf56 commit 4156dac

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

tests/unit/sso.test.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,22 @@ describe("SSO module", () => {
4141
expect(scope.isDone()).toBe(true);
4242
});
4343

44+
test("getAccessToken issues the existing GET request and returns the raw token", async () => {
45+
const rawAccessToken = "access-token-123";
46+
47+
scope
48+
.get(`/api/apps/${appId}/auth/sso/accesstoken/${userId}`)
49+
.reply(200, JSON.stringify(rawAccessToken), {
50+
"Content-Type": "application/json",
51+
});
52+
53+
const accessToken =
54+
await base44.asServiceRole.sso.getAccessToken(userId);
55+
56+
expect(accessToken).toBe(rawAccessToken);
57+
expect(scope.isDone()).toBe(true);
58+
});
59+
4460
test("getIdToken uses the service-role client with on-behalf-of authentication", async () => {
4561
scope
4662
.get(`/api/apps/${appId}/auth/sso/idtoken/${userId}`)

0 commit comments

Comments
 (0)