1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-04 18:53:20 +00:00

build fixes

This commit is contained in:
cd-bitwarden
2025-11-20 11:13:14 -05:00
parent 94246f7235
commit a84f7d6e10
4 changed files with 15 additions and 15 deletions

View File

@@ -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,
);

View File

@@ -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");
});

View File

@@ -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();
});
});

View File

@@ -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);
});
});