Merge feat/value-hash-detection: add Value.Hash O(1) change detection with commitHashes (clean merge, no Value.Diff overlap)
This commit is contained in:
@@ -81,15 +81,15 @@ describe("Root.render() re-renderable", () => {
|
||||
expect(divFiber.props.class).toBe("b");
|
||||
});
|
||||
|
||||
it("prepareUpdate is called for changed props on re-render", () => {
|
||||
const { host, prepareUpdateCalls } = makeHost();
|
||||
it("commitUpdate is called for changed props on re-render", () => {
|
||||
const { host, commitUpdateCalls } = makeHost();
|
||||
const root = createHostRoot(host, {});
|
||||
root.render(h("div", { class: "old" }, "hello"));
|
||||
prepareUpdateCalls.length = 0;
|
||||
commitUpdateCalls.length = 0;
|
||||
|
||||
root.render(h("div", { class: "new" }, "hello"));
|
||||
expect(prepareUpdateCalls.length).toBeGreaterThanOrEqual(1);
|
||||
const divCall = prepareUpdateCalls.find((c) => c.tag === "div");
|
||||
expect(commitUpdateCalls.length).toBeGreaterThanOrEqual(1);
|
||||
const divCall = commitUpdateCalls.find((c) => c.tag === "div");
|
||||
expect(divCall).toBeDefined();
|
||||
expect(divCall!.prevProps.class).toBe("old");
|
||||
expect(divCall!.nextProps.class).toBe("new");
|
||||
|
||||
Reference in New Issue
Block a user