Skip to content

Commit

Permalink
Merge eca56a7 into 532ea2a
Browse files Browse the repository at this point in the history
  • Loading branch information
lynette-li committed Aug 3, 2020
2 parents 532ea2a + eca56a7 commit 53d4134
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/hook/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ import "./index";
import { HOOK_NAME } from "../shared/constants";
import { getBrickByUid } from "./traverse";
import { inspectElement } from "./inspector";
import { overrideProps } from "./overrideProps";

jest.mock("./traverse");
jest.mock("./inspector");
jest.mock("./overrideProps");

(getBrickByUid as jest.Mock).mockImplementation((uid) => ({ uid }));

Expand All @@ -14,6 +16,9 @@ describe("hook", () => {
hook.inspectBrick(1);
expect(inspectElement).toBeCalledWith({ uid: 1 });

hook.overrideProps(1, "propName", "propValue");
expect(overrideProps).toBeCalledWith({ uid: 1 }, "propName", "propValue");

expect(hook.pageHasBricks).toBe(false);
(window as any).BRICK_NEXT_VERSIONS = {};
expect(hook.pageHasBricks).toBe(true);
Expand Down

0 comments on commit 53d4134

Please sign in to comment.