From e99d221dba0436c9a3dff6cb029db7a72a0b83b5 Mon Sep 17 00:00:00 2001 From: Thomas Rittson Date: Mon, 28 Oct 2024 12:47:09 +1000 Subject: [PATCH] Fix test and storybook failures --- apps/browser/src/background/main.background.ts | 1 + .../src/vault/popup/components/vault/collections.component.ts | 3 --- apps/cli/src/service-container/service-container.ts | 1 + .../collections/services/default-collection.service.spec.ts | 2 ++ .../src/admin-console/components/collections.component.ts | 2 -- libs/common/src/platform/misc/rxjs-operators.spec.ts | 2 +- 6 files changed, 5 insertions(+), 6 deletions(-) diff --git a/apps/browser/src/background/main.background.ts b/apps/browser/src/background/main.background.ts index 6e2421e499..7e56b90c8a 100644 --- a/apps/browser/src/background/main.background.ts +++ b/apps/browser/src/background/main.background.ts @@ -1275,6 +1275,7 @@ export default class MainBackground { this.cipherAuthorizationService = new DefaultCipherAuthorizationService( this.collectionService, this.organizationService, + this.accountService, ); } diff --git a/apps/browser/src/vault/popup/components/vault/collections.component.ts b/apps/browser/src/vault/popup/components/vault/collections.component.ts index 407f87e996..30d91a25bb 100644 --- a/apps/browser/src/vault/popup/components/vault/collections.component.ts +++ b/apps/browser/src/vault/popup/components/vault/collections.component.ts @@ -8,7 +8,6 @@ import { CollectionsComponent as BaseCollectionsComponent } from "@bitwarden/ang import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction"; import { AccountService } from "@bitwarden/common/auth/abstractions/account.service"; import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; -import { LogService } from "@bitwarden/common/platform/abstractions/log.service"; import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service"; import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service"; import { ToastService } from "@bitwarden/components"; @@ -27,7 +26,6 @@ export class CollectionsComponent extends BaseCollectionsComponent implements On organizationService: OrganizationService, private route: ActivatedRoute, private location: Location, - logService: LogService, accountService: AccountService, toastService: ToastService, ) { @@ -37,7 +35,6 @@ export class CollectionsComponent extends BaseCollectionsComponent implements On i18nService, cipherService, organizationService, - logService, accountService, toastService, ); diff --git a/apps/cli/src/service-container/service-container.ts b/apps/cli/src/service-container/service-container.ts index 3424e3fb28..34907e0583 100644 --- a/apps/cli/src/service-container/service-container.ts +++ b/apps/cli/src/service-container/service-container.ts @@ -815,6 +815,7 @@ export class ServiceContainer { this.cipherAuthorizationService = new DefaultCipherAuthorizationService( this.collectionService, this.organizationService, + this.accountService, ); } diff --git a/libs/admin-console/src/common/collections/services/default-collection.service.spec.ts b/libs/admin-console/src/common/collections/services/default-collection.service.spec.ts index 82c39da960..1792e4a7b0 100644 --- a/libs/admin-console/src/common/collections/services/default-collection.service.spec.ts +++ b/libs/admin-console/src/common/collections/services/default-collection.service.spec.ts @@ -106,10 +106,12 @@ describe("DefaultCollectionService", () => { expect(encryptService.decryptToUtf8).toHaveBeenCalledWith( expect.objectContaining(new EncString(collection1.name)), orgKey1, + expect.any(String), ); expect(encryptService.decryptToUtf8).toHaveBeenCalledWith( expect.objectContaining(new EncString(collection2.name)), orgKey2, + expect.any(String), ); }); diff --git a/libs/angular/src/admin-console/components/collections.component.ts b/libs/angular/src/admin-console/components/collections.component.ts index bc3c1fad46..67a063def1 100644 --- a/libs/angular/src/admin-console/components/collections.component.ts +++ b/libs/angular/src/admin-console/components/collections.component.ts @@ -7,7 +7,6 @@ import { Organization } from "@bitwarden/common/admin-console/models/domain/orga import { AccountService } from "@bitwarden/common/auth/abstractions/account.service"; import { getUserId } from "@bitwarden/common/auth/services/account.service"; import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; -import { LogService } from "@bitwarden/common/platform/abstractions/log.service"; import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service"; import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service"; import { Cipher } from "@bitwarden/common/vault/models/domain/cipher"; @@ -36,7 +35,6 @@ export class CollectionsComponent implements OnInit { protected i18nService: I18nService, protected cipherService: CipherService, protected organizationService: OrganizationService, - private logService: LogService, private accountService: AccountService, private toastService: ToastService, ) {} diff --git a/libs/common/src/platform/misc/rxjs-operators.spec.ts b/libs/common/src/platform/misc/rxjs-operators.spec.ts index e31c774545..14b6cfc821 100644 --- a/libs/common/src/platform/misc/rxjs-operators.spec.ts +++ b/libs/common/src/platform/misc/rxjs-operators.spec.ts @@ -22,7 +22,7 @@ describe("custom rxjs operators", () => { const output = await firstValueFrom(getById(2)(of(input))); - expect(output).toEqual([{ id: 1, data: "one" }]); + expect(output).toEqual({ id: 2, data: "two" }); }); });