Skip to content

Commit

Permalink
PM-8113 - Add closeSsoAuthResultPopout
Browse files Browse the repository at this point in the history
  • Loading branch information
JaredSnider-Bitwarden committed Jan 22, 2025
1 parent 649a196 commit 2203aae
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
9 changes: 9 additions & 0 deletions apps/browser/src/auth/popup/utils/auth-popout-window.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
openSsoAuthResultPopout,
openTwoFactorAuthPopout,
closeTwoFactorAuthPopout,
closeSsoAuthResultPopout,
} from "./auth-popout-window";

describe("AuthPopoutWindow", () => {
Expand Down Expand Up @@ -97,6 +98,14 @@ describe("AuthPopoutWindow", () => {
});
});

describe("closeSsoAuthResultPopout", () => {
it("closes the SSO authentication result popout window", async () => {
await closeSsoAuthResultPopout();

expect(closeSingleActionPopoutSpy).toHaveBeenCalledWith(AuthPopoutType.ssoAuthResult);
});
});

describe("openTwoFactorAuthPopout", () => {
it("opens a window that facilitates two factor authentication", async () => {
await openTwoFactorAuthPopout({ data: "data", remember: "remember" });
Expand Down
8 changes: 8 additions & 0 deletions apps/browser/src/auth/popup/utils/auth-popout-window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ async function openSsoAuthResultPopout(resultData: { code: string; state: string
});
}

/**
* Closes the two-factor authentication popout window.
*/
async function closeSsoAuthResultPopout() {
await BrowserPopupUtils.closeSingleActionPopout(AuthPopoutType.ssoAuthResult);
}

/**
* Opens a window that facilitates two-factor authentication.
*
Expand Down Expand Up @@ -87,6 +94,7 @@ export {
openUnlockPopout,
closeUnlockPopout,
openSsoAuthResultPopout,
closeSsoAuthResultPopout,
openTwoFactorAuthPopout,
closeTwoFactorAuthPopout,
};

0 comments on commit 2203aae

Please sign in to comment.