1
0
mirror of https://github.com/bitwarden/browser synced 2024-12-19 12:54:48 +01:00
bitwarden-estensione-browser/libs/common/spec/models/view/attachmentView.spec.ts

19 lines
603 B
TypeScript

import { SymmetricCryptoKey } from "@bitwarden/common/models/domain/symmetric-crypto-key";
import { AttachmentView } from "@bitwarden/common/models/view/attachment.view";
import { mockFromJson } from "../../utils";
jest.mock("@bitwarden/common/models/domain/symmetric-crypto-key");
describe("AttachmentView", () => {
it("fromJSON initializes nested objects", () => {
jest.spyOn(SymmetricCryptoKey, "fromJSON").mockImplementation(mockFromJson);
const actual = AttachmentView.fromJSON({
key: "encKeyB64" as any,
});
expect(actual.key).toEqual("encKeyB64_fromJSON");
});
});