import { hZ as l, f as p, h_ as m, v as r, L as u, e2 as d } from "./56c67d3b.js";
import "react";
import "react-dom";
test("action handler always get latest data", async () => {
  const o = jest.fn();
  window.someFunc = o, l({
    orgCommonSettings: {
      runJavaScriptInHost: !0
    }
  });
  const s = p({
    a: m,
    b: r(!1)
  }), a = {
    a: {
      compType: "runScript",
      comp: {
        script: "someFunc()"
      },
      condition: "{{b}}"
    },
    b: !1
  };
  let t;
  const c = (n) => {
    const i = t.reduce(n);
    t = u(i, { b: d(!0) });
  };
  t = new s({ value: a, dispatch: c });
  const e = t.children.a.getView();
  expect(typeof e).toBe("function"), e == null || e(), expect(o).toBeCalledTimes(0), t.children.b.dispatchChangeValueAction(!0), e == null || e(), expect(o).toBeCalledTimes(1);
});
