1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 08:13:42 +00:00

Auth/pm 14943/auth request extension dialog approve (#16132)

* feat(notification-processing): [PM-19877] System Notification Implementation - Implemented the full feature set for device approval from extension.

* test(notification-processing): [PM-19877] System Notification Implementation - Updated tests.

---------

Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>
This commit is contained in:
Patrick-Pimentel-Bitwarden
2025-09-05 13:27:16 -04:00
committed by GitHub
parent 493788c9d0
commit fe692acc07
14 changed files with 365 additions and 65 deletions

View File

@@ -131,6 +131,8 @@ describe("DefaultServerNotificationsService (multi-user)", () => {
configService.getFeatureFlag$.mockImplementation((flag: FeatureFlag) => {
const flagValueByFlag: Partial<Record<FeatureFlag, boolean>> = {
[FeatureFlag.InactiveUserServerNotification]: true,
[FeatureFlag.PushNotificationsWhenLocked]: true,
[FeatureFlag.PM14938_BrowserExtensionLoginApproval]: true,
};
return new BehaviorSubject(flagValueByFlag[flag] ?? false) as any;
});
@@ -253,8 +255,7 @@ describe("DefaultServerNotificationsService (multi-user)", () => {
.next({ type: "not-supported", reason: "test" } as any);
}
// TODO: When PM-14943 goes in, uncomment
// authRequestAnsweringService.receivedPendingAuthRequest.mockResolvedValue(undefined as any);
authRequestAnsweringService.receivedPendingAuthRequest.mockResolvedValue(undefined as any);
const subscription = defaultServerNotificationsService.startListening();
@@ -273,12 +274,10 @@ describe("DefaultServerNotificationsService (multi-user)", () => {
expect(messagingService.send).toHaveBeenCalledWith("openLoginApproval", {
notificationId: "auth-id-2",
});
// TODO: When PM-14943 goes in, uncomment
// expect(authRequestAnsweringService.receivedPendingAuthRequest).toHaveBeenCalledWith(
// mockUserId2,
// "auth-id-2",
// );
expect(authRequestAnsweringService.receivedPendingAuthRequest).toHaveBeenCalledWith(
mockUserId2,
"auth-id-2",
);
subscription.unsubscribe();
});