import { M as h, ba as r, cn as l, V as g, bh as m, o as d, gR as s, dd as i, e5 as a } from "./684d2f28.js";
import "react";
import "react-dom";
const C = new h({
  v1: r,
  v2: l
}, (t) => t).setPropertyViewFn(() => /* @__PURE__ */ g(m, {})).build(), v = {
  value: {
    v1: "v1: {{a + 1}}",
    v2: "{{a + 2}}"
  }
}, u = d(C);
describe("withMultiContext", () => {
  it("common", () => {
    let t = new u({
      dispatch: (p) => {
        t = s(t.reduce(p));
      },
      ...v
    });
    t = s(t);
    const o = "k1", c = t.getView()({
      a: 11
    }, o).getView();
    expect(c.v1 === "v1: 12").toBeTruthy(), expect(c.v2 === 13).toBeTruthy();
    let e = t.getOriginalComp().changeDispatch(i(i(t.dispatch, a), o)).getComp();
    e.dispatch(e.changeChildAction("v2", "{{a + 3}}")), expect(t.children[a].getView()[o].getView().v2).toEqual(14);
    const n = "not-exist";
    e = t.getOriginalComp().changeDispatch(i(i(t.dispatch, a), n)).getComp(), e.dispatch(e.changeChildAction("v2", "{{a + 3}}")), expect(t.children[a].getView().hasOwnProperty(n)).toBeFalsy();
  });
});
