import { cA as s, bP as n, cU as u, w as i, cn as d, M as l, V as r, bh as m, gR as o, dG as a, bY as c } from "./684d2f28.js";
import "react";
import "react-dom";
const p = function() {
  const e = {
    numChild: s("num"),
    textChild: n("text"),
    booleanChild: u("status"),
    value: i(d, "0")
  };
  return new l(e, (t) => t).setPropertyViewFn(() => /* @__PURE__ */ r(m, {})).build();
}(), h = c(p, [{
  method: {
    name: "doAdd",
    params: [{
      name: "addend",
      type: "number"
    }]
  },
  execute: (e, t) => {
    e.children.value.dispatchChangeValueAction(e.children.value.getView() + t[0] + "");
  }
}]);
test("test exec method", async () => {
  let e = new h({
    dispatch: (t) => {
      e = o(e.reduce(t));
    }
  });
  e = o(e), e.reduce(a({
    type: "execute",
    methodName: "setText",
    // @ts-ignore
    params: ["testText"]
  }, !1)), e.reduce(a({
    type: "execute",
    methodName: "setStatus",
    // @ts-ignore
    params: [!0]
  }, !1)), e.reduce(a({
    type: "execute",
    methodName: "doAdd",
    // @ts-ignore
    params: [10]
  }, !1)), await new Promise((t) => setTimeout(t, 20)), expect(e.getView().textChild.value).toEqual("testText"), expect(e.getView().booleanChild.value).toEqual(!0), expect(e.getView().value).toEqual(10);
});
