mirror of
https://github.com/bitwarden/browser
synced 2025-12-22 11:13:46 +00:00
[EC-582] Add domain object serialization (#3623)
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
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", () => {
|
||||
const mockFromJson = (stub: string) => stub + "_fromJSON";
|
||||
jest.spyOn(SymmetricCryptoKey, "fromJSON").mockImplementation(mockFromJson as any);
|
||||
jest.spyOn(SymmetricCryptoKey, "fromJSON").mockImplementation(mockFromJson);
|
||||
|
||||
const actual = AttachmentView.fromJSON({
|
||||
key: "encKeyB64" as any,
|
||||
|
||||
Reference in New Issue
Block a user