From abe0db76b0ee43e7826154152e5212acb8db8440 Mon Sep 17 00:00:00 2001 From: Patrick Pimentel Date: Wed, 20 Aug 2025 17:30:14 -0400 Subject: [PATCH] test(browser-approval): [PM-23620] Auth Request Answering Service - Fixed some bugs with the tests. --- .../unsupported-auth-request-answering.service.ts | 2 +- .../internal/default-notifications.service.spec.ts | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/libs/common/src/auth/services/auth-request-answering/unsupported-auth-request-answering.service.ts b/libs/common/src/auth/services/auth-request-answering/unsupported-auth-request-answering.service.ts index fc7f9e439a4..c4f503bd39c 100644 --- a/libs/common/src/auth/services/auth-request-answering/unsupported-auth-request-answering.service.ts +++ b/libs/common/src/auth/services/auth-request-answering/unsupported-auth-request-answering.service.ts @@ -1,4 +1,4 @@ -import { SystemNotificationEvent } from "@bitwarden/common/platform/notifications/system-notifications-service"; +import { SystemNotificationEvent } from "@bitwarden/common/platform/system-notifications/system-notifications.service"; import { UserId } from "@bitwarden/user-core"; import { AuthRequestAnsweringServiceAbstraction } from "../../abstractions/auth-request-answering/auth-request-answering.service.abstraction"; diff --git a/libs/common/src/platform/server-notifications/internal/default-notifications.service.spec.ts b/libs/common/src/platform/server-notifications/internal/default-notifications.service.spec.ts index ed053b895a8..4457be65320 100644 --- a/libs/common/src/platform/server-notifications/internal/default-notifications.service.spec.ts +++ b/libs/common/src/platform/server-notifications/internal/default-notifications.service.spec.ts @@ -4,7 +4,8 @@ import { BehaviorSubject, bufferCount, firstValueFrom, ObservedValueOf, Subject // This import has been flagged as unallowed for this class. It may be involved in a circular dependency loop. // eslint-disable-next-line no-restricted-imports import { LogoutReason } from "@bitwarden/auth/common"; -import { SystemNotificationsService } from "@bitwarden/common/platform/notifications/system-notifications-service"; +import { AuthRequestAnsweringServiceAbstraction } from "@bitwarden/common/auth/abstractions/auth-request-answering/auth-request-answering.service.abstraction"; +import { ConfigService } from "@bitwarden/common/platform/abstractions/config/config.service"; import { awaitAsync } from "../../../../spec"; import { Matrix } from "../../../../spec/matrix"; @@ -39,7 +40,8 @@ describe("NotificationsService", () => { let signalRNotificationConnectionService: MockProxy; let authService: MockProxy; let webPushNotificationConnectionService: MockProxy; - let systemNotificationService: MockProxy; + let authRequestAnsweringService: MockProxy; + let configService: MockProxy; let activeAccount: BehaviorSubject>; @@ -66,6 +68,8 @@ describe("NotificationsService", () => { signalRNotificationConnectionService = mock(); authService = mock(); webPushNotificationConnectionService = mock(); + authRequestAnsweringService = mock(); + configService = mock(); activeAccount = new BehaviorSubject>(null); accountService.activeAccount$ = activeAccount.asObservable(); @@ -106,14 +110,15 @@ describe("NotificationsService", () => { signalRNotificationConnectionService, authService, webPushNotificationConnectionService, - systemNotificationService, + authRequestAnsweringService, + configService, ); }); const mockUser1 = "user1" as UserId; const mockUser2 = "user2" as UserId; - function emitActiveUser(userId: UserId) { + function emitActiveUser(userId: UserId | null) { if (userId == null) { activeAccount.next(null); } else {