1
0
mirror of https://github.com/bitwarden/browser synced 2024-12-16 11:21:03 +01:00
bitwarden-estensione-browser/libs/common/spec/models/view/attachmentView.spec.ts

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
623 B
TypeScript
Raw Normal View History

import { SymmetricCryptoKey } from "@bitwarden/common/models/domain/symmetricCryptoKey";
import { AttachmentView } from "@bitwarden/common/models/view/attachmentView";
jest.mock("@bitwarden/common/models/domain/symmetricCryptoKey");
describe("AttachmentView", () => {
it("fromJSON initializes nested objects", () => {
const mockFromJson = (stub: string) => stub + "_fromJSON";
jest.spyOn(SymmetricCryptoKey, "fromJSON").mockImplementation(mockFromJson as any);
const actual = AttachmentView.fromJSON({
key: "encKeyB64" as any,
});
expect(actual.key).toEqual("encKeyB64_fromJSON");
});
});