Skip to content

Commit

Permalink
test(): users compute props test
Browse files Browse the repository at this point in the history
  • Loading branch information
MarvinPerry committed Nov 15, 2024
1 parent 96dbf60 commit 44e403d
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions packages/common/test/users/_internal/computeProps.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,30 @@ describe("HubUser computeProps:", () => {
});
});
});

describe("getSelf:", () => {
it("fetches portal self", async () => {
const requestSpy = spyOn(requestModule, "request").and.callFake(() => {
return Promise.resolve({
portalProperties: {
hub: {
settings: {
informationalBanner: true,
},
},
},
});
});

PortalModule.getSelf(authdCtxMgr.context.requestOptions);
expect(requestSpy).toHaveBeenCalledTimes(1);
expect(requestSpy.calls.argsFor(0)[0]).toEqual(
"https://www.custom-base-url.com/sharing/rest/portals/self"
);
expect(requestSpy.calls.argsFor(0)[1]).toEqual({
...authdCtxMgr.context.requestOptions,
httpMethod: "GET",
});
});
});
});

0 comments on commit 44e403d

Please sign in to comment.