From a84f7d6e101b00bfd07447230b220e83de268fb5 Mon Sep 17 00:00:00 2001 From: cd-bitwarden <106776772+cd-bitwarden@users.noreply.github.com> Date: Thu, 20 Nov 2025 11:13:14 -0500 Subject: [PATCH] build fixes --- .../auth-request/auth-request.service.spec.ts | 8 ++++---- .../crypto/models/enc-string.spec.ts | 2 +- .../state-migrations/migration-builder.spec.ts | 16 ++++++++-------- libs/state/src/state-migrations/migrator.spec.ts | 4 ++-- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/libs/auth/src/common/services/auth-request/auth-request.service.spec.ts b/libs/auth/src/common/services/auth-request/auth-request.service.spec.ts index 8cb0cc279ae..dd7fa4d1ee6 100644 --- a/libs/auth/src/common/services/auth-request/auth-request.service.spec.ts +++ b/libs/auth/src/common/services/auth-request/auth-request.service.spec.ts @@ -146,11 +146,11 @@ describe("AuthRequestService", () => { ); // Assert - expect(sut.decryptPubKeyEncryptedUserKey).toBeCalledWith( + expect(sut.decryptPubKeyEncryptedUserKey).toHaveBeenCalledWith( mockAuthReqResponse.key, mockPrivateKey, ); - expect(keyService.setUserKey).toBeCalledWith(mockDecryptedUserKey, mockUserId); + expect(keyService.setUserKey).toHaveBeenCalledWith(mockDecryptedUserKey, mockUserId); }); }); @@ -186,7 +186,7 @@ describe("AuthRequestService", () => { ); // Assert - expect(sut.decryptPubKeyEncryptedMasterKeyAndHash).toBeCalledWith( + expect(sut.decryptPubKeyEncryptedMasterKeyAndHash).toHaveBeenCalledWith( mockAuthReqResponse.key, mockAuthReqResponse.masterPasswordHash, mockPrivateKey, @@ -226,7 +226,7 @@ describe("AuthRequestService", () => { ); // Assert - expect(encryptService.decapsulateKeyUnsigned).toBeCalledWith( + expect(encryptService.decapsulateKeyUnsigned).toHaveBeenCalledWith( new EncString(mockPubKeyEncryptedUserKey), mockPrivateKey, ); diff --git a/libs/common/src/key-management/crypto/models/enc-string.spec.ts b/libs/common/src/key-management/crypto/models/enc-string.spec.ts index 1be28d58963..32442fa39ae 100644 --- a/libs/common/src/key-management/crypto/models/enc-string.spec.ts +++ b/libs/common/src/key-management/crypto/models/enc-string.spec.ts @@ -107,7 +107,7 @@ describe("EncString", () => { it("result should be cached", async () => { const decrypted = await encString.decrypt(null); - expect(encryptService.decryptString).toBeCalledTimes(1); + expect(encryptService.decryptString).toHaveBeenCalledTimes(1); expect(decrypted).toBe("decrypted"); }); diff --git a/libs/state/src/state-migrations/migration-builder.spec.ts b/libs/state/src/state-migrations/migration-builder.spec.ts index 15e526b9456..41e95b51118 100644 --- a/libs/state/src/state-migrations/migration-builder.spec.ts +++ b/libs/state/src/state-migrations/migration-builder.spec.ts @@ -91,28 +91,28 @@ describe("MigrationBuilder", () => { const helper = new MigrationHelper(0, mock(), mock(), "general", clientType); const spy = jest.spyOn(migrator, "migrate"); await sut.migrate(helper); - expect(spy).toBeCalledWith(helper); + expect(spy).toHaveBeenCalledWith(helper); }); it("should rollback", async () => { const helper = new MigrationHelper(1, mock(), mock(), "general", clientType); const spy = jest.spyOn(rollback_migrator, "rollback"); await sut.migrate(helper); - expect(spy).toBeCalledWith(helper); + expect(spy).toHaveBeenCalledWith(helper); }); it("should update version on migrate", async () => { const helper = new MigrationHelper(0, mock(), mock(), "general", clientType); const spy = jest.spyOn(migrator, "updateVersion"); await sut.migrate(helper); - expect(spy).toBeCalledWith(helper, "up"); + expect(spy).toHaveBeenCalledWith(helper, "up"); }); it("should update version on rollback", async () => { const helper = new MigrationHelper(1, mock(), mock(), "general", clientType); const spy = jest.spyOn(rollback_migrator, "updateVersion"); await sut.migrate(helper); - expect(spy).toBeCalledWith(helper, "down"); + expect(spy).toHaveBeenCalledWith(helper, "down"); }); it("should not run the migrator if the current version does not match the from version", async () => { @@ -120,8 +120,8 @@ describe("MigrationBuilder", () => { const migrate = jest.spyOn(migrator, "migrate"); const rollback = jest.spyOn(rollback_migrator, "rollback"); await sut.migrate(helper); - expect(migrate).not.toBeCalled(); - expect(rollback).not.toBeCalled(); + expect(migrate).not.toHaveBeenCalled(); + expect(rollback).not.toHaveBeenCalled(); }); it("should not update version if the current version does not match the from version", async () => { @@ -129,8 +129,8 @@ describe("MigrationBuilder", () => { const migrate = jest.spyOn(migrator, "updateVersion"); const rollback = jest.spyOn(rollback_migrator, "updateVersion"); await sut.migrate(helper); - expect(migrate).not.toBeCalled(); - expect(rollback).not.toBeCalled(); + expect(migrate).not.toHaveBeenCalled(); + expect(rollback).not.toHaveBeenCalled(); }); }); diff --git a/libs/state/src/state-migrations/migrator.spec.ts b/libs/state/src/state-migrations/migrator.spec.ts index 762a608dba7..4c03930b1cd 100644 --- a/libs/state/src/state-migrations/migrator.spec.ts +++ b/libs/state/src/state-migrations/migrator.spec.ts @@ -60,7 +60,7 @@ describe("migrator default methods", () => { describe("up", () => { it("should update the version", async () => { await sut.updateVersion(helper, "up"); - expect(storage.save).toBeCalledWith("stateVersion", 1); + expect(storage.save).toHaveBeenCalledWith("stateVersion", 1); expect(helper.currentVersion).toBe(1); }); }); @@ -69,7 +69,7 @@ describe("migrator default methods", () => { it("should update the version", async () => { helper.currentVersion = 1; await sut.updateVersion(helper, "down"); - expect(storage.save).toBeCalledWith("stateVersion", 0); + expect(storage.save).toHaveBeenCalledWith("stateVersion", 0); expect(helper.currentVersion).toBe(0); }); });