import { M as r, X as h, ak as l, H as g, I as m, o as d, L as n, fl as i, go as o } from "./56c67d3b.js";
import "react";
import "react-dom";
const C = new r({
  v1: h,
  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 = n(t.reduce(p));
      },
      ...v
    });
    t = n(t);
    const a = "k1", s = t.getView()({
      a: 11
    }, a).getView();
    expect(s.v1 === "v1: 12").toBeTruthy(), expect(s.v2 === 13).toBeTruthy();
    let e = t.getOriginalComp().changeDispatch(i(i(t.dispatch, o), a)).getComp();
    e.dispatch(e.changeChildAction("v2", "{{a + 3}}")), expect(t.children[o].getView()[a].getView().v2).toEqual(14);
    const c = "not-exist";
    e = t.getOriginalComp().changeDispatch(i(i(t.dispatch, o), c)).getComp(), e.dispatch(e.changeChildAction("v2", "{{a + 3}}")), expect(t.children[o].getView().hasOwnProperty(c)).toBeFalsy();
  });
});
