import { cJ as s, a4 as n, d5 as d, w as u, M as i, F as l, G as r, J as o, hd as a, ad as m, cd as c } from "./603b75d9.js";
import "react";
import "react-dom";
const p = function() {
  const e = {
    numChild: s("num"),
    textChild: n("text"),
    booleanChild: d("status"),
    value: u(m, "0")
  };
  return new i(e, (t) => t).setPropertyViewFn(() => /* @__PURE__ */ l(r, {})).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);
});
