mirror of
https://github.com/bitwarden/browser
synced 2025-12-17 00:33:44 +00:00
Resolve breaking changes in the SDK (#15472)
This commit is contained in:
@@ -67,6 +67,7 @@ describe("AttachmentView", () => {
|
||||
sizeName: "sizeName",
|
||||
fileName: "fileName",
|
||||
key: "encKeyB64",
|
||||
decryptedKey: null,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -59,6 +59,7 @@ export class AttachmentView implements View {
|
||||
sizeName: this.sizeName,
|
||||
fileName: this.fileName,
|
||||
key: this.encryptedKey?.toJSON(),
|
||||
decryptedKey: null,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
CipherType as SdkCipherType,
|
||||
CipherView as SdkCipherView,
|
||||
CipherListView,
|
||||
Attachment as SdkAttachment,
|
||||
AttachmentView as SdkAttachmentView,
|
||||
} from "@bitwarden/sdk-internal";
|
||||
|
||||
import { mockEnc } from "../../../spec";
|
||||
@@ -311,7 +311,9 @@ describe("DefaultCipherEncryptionService", () => {
|
||||
const expectedDecryptedContent = new Uint8Array([5, 6, 7, 8]);
|
||||
|
||||
jest.spyOn(cipher, "toSdkCipher").mockReturnValue({ id: "id" } as SdkCipher);
|
||||
jest.spyOn(attachment, "toSdkAttachmentView").mockReturnValue({ id: "a1" } as SdkAttachment);
|
||||
jest
|
||||
.spyOn(attachment, "toSdkAttachmentView")
|
||||
.mockReturnValue({ id: "a1" } as SdkAttachmentView);
|
||||
mockSdkClient.vault().attachments().decrypt_buffer.mockReturnValue(expectedDecryptedContent);
|
||||
|
||||
const result = await cipherEncryptionService.decryptAttachmentContent(
|
||||
|
||||
Reference in New Issue
Block a user