import { d1 as s, ab as n, dx as u, w as d, M as i, H as l, I as r, L as o, gn as a, ak as m, ct as c } from "./56c67d3b.js";
import "react";
import "react-dom";
const p = function() {
  const e = {
    numChild: s("num"),
    textChild: n("text"),
    booleanChild: u("status"),
    value: d(m, "0")
  };
  return new i(e, (t) => t).setPropertyViewFn(() => /* @__PURE__ */ l(r, {})).build();
}(), x = 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 x({
    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);
});
