mirror of
https://github.com/bitwarden/browser.git
synced 2024-10-31 08:20:37 +01:00
19 lines
598 B
TypeScript
19 lines
598 B
TypeScript
import { SymmetricCryptoKey } from "@bitwarden/common/models/domain/symmetricCryptoKey";
|
|
import { AttachmentView } from "@bitwarden/common/models/view/attachmentView";
|
|
|
|
import { mockFromJson } from "../../utils";
|
|
|
|
jest.mock("@bitwarden/common/models/domain/symmetricCryptoKey");
|
|
|
|
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");
|
|
});
|
|
});
|