|
2 | 2 | // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.
|
3 | 3 |
|
4 | 4 | import { once } from "events";
|
5 |
| -import { |
6 |
| - RedirectNavigator, |
7 |
| - type PopupWindow, |
8 |
| - PopupNavigator, |
9 |
| - IFrameNavigator, |
10 |
| - type NavigateResponse, |
11 |
| -} from "./navigators"; |
| 5 | +import { RedirectNavigator, type PopupWindow, PopupNavigator, IFrameNavigator } from "./navigators"; |
12 | 6 | import type { SigninResponse } from "./SigninResponse";
|
13 | 7 | import type { SignoutResponse } from "./SignoutResponse";
|
14 | 8 | import { UserManager, type SigninPopupArgs, type SigninRedirectArgs, type SigninSilentArgs, type SignoutSilentArgs } from "./UserManager";
|
@@ -39,7 +33,6 @@ describe("UserManager", () => {
|
39 | 33 | userStore: userStoreMock,
|
40 | 34 | metadata: {
|
41 | 35 | authorization_endpoint: "http://sts/oidc/authorize",
|
42 |
| - end_session_endpoint: "http://sts/oidc/logout", |
43 | 36 | token_endpoint: "http://sts/oidc/token",
|
44 | 37 | revocation_endpoint: "http://sts/oidc/revoke",
|
45 | 38 | },
|
@@ -845,53 +838,6 @@ describe("UserManager", () => {
|
845 | 838 | });
|
846 | 839 | });
|
847 | 840 |
|
848 |
| - describe("signoutRedirect", () => { |
849 |
| - it("should not unload user to avoid race condition between actual signout and signout event handlers", async () => { |
850 |
| - // arrange |
851 |
| - const navigateMock = jest.fn().mockReturnValue(Promise.resolve({ |
852 |
| - url: "http://localhost:8080", |
853 |
| - } as NavigateResponse)); |
854 |
| - jest.spyOn(subject["_redirectNavigator"], "prepare").mockReturnValue(Promise.resolve({ |
855 |
| - navigate: navigateMock, |
856 |
| - close: () => {}, |
857 |
| - })); |
858 |
| - const user = new User({ |
859 |
| - access_token: "access_token", |
860 |
| - token_type: "token_type", |
861 |
| - profile: {} as UserProfile, |
862 |
| - }); |
863 |
| - await subject.storeUser(user); |
864 |
| - |
865 |
| - // act |
866 |
| - await subject.signoutRedirect(); |
867 |
| - |
868 |
| - // assert |
869 |
| - expect(navigateMock).toHaveBeenCalledTimes(1); |
870 |
| - const storageString = await subject.settings.userStore.get(subject["_userStoreKey"]); |
871 |
| - expect(storageString).not.toBeNull(); |
872 |
| - }); |
873 |
| - }); |
874 |
| - |
875 |
| - describe("signoutRedirectCallback", () => { |
876 |
| - it("should unload user", async () => { |
877 |
| - // arrange |
878 |
| - const user = new User({ |
879 |
| - access_token: "access_token", |
880 |
| - token_type: "token_type", |
881 |
| - profile: {} as UserProfile, |
882 |
| - }); |
883 |
| - await subject.storeUser(user); |
884 |
| - |
885 |
| - expect(await subject.settings.userStore.get(subject["_userStoreKey"])).not.toBeNull(); |
886 |
| - |
887 |
| - // act |
888 |
| - await subject.signoutRedirectCallback(); |
889 |
| - |
890 |
| - // assert |
891 |
| - expect(await subject.settings.userStore.get(subject["_userStoreKey"])).toBeNull(); |
892 |
| - }); |
893 |
| - }); |
894 |
| - |
895 | 841 | describe("storeUser", () => {
|
896 | 842 | it("should add user to store", async () => {
|
897 | 843 | // arrange
|
|
0 commit comments