Skip to content

Commit b609b64

Browse files
- Add support for OIDC session management error status
1 parent 6b283b1 commit b609b64

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

src/UserManagerEvents.test.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,31 @@ describe("UserManagerEvents", () => {
4444
expect(cb).toBeCalledTimes(0);
4545
});
4646

47+
it("should allow callback", () => {
48+
// arrange
49+
const cb = jest.fn();
50+
51+
// act
52+
subject.addUserSessionError(cb);
53+
subject._raiseUserSessionError();
54+
55+
// assert
56+
expect(cb).toBeCalled();
57+
});
58+
59+
it("should allow unregistering callback", () => {
60+
// arrange
61+
const cb = jest.fn();
62+
63+
// act
64+
subject.addUserSessionError(cb);
65+
subject.removeUserSessionError(cb);
66+
subject._raiseUserSessionError();
67+
68+
// assert
69+
expect(cb).toBeCalledTimes(0);
70+
});
71+
4772
it("should pass error to callback", () => {
4873
// arrange
4974
let e: Error | null = null;

0 commit comments

Comments
 (0)