import { V as a, L as u } from "./56c67d3b.js";
import "react";
import "react-dom";
function t(e, s, c) {
  const n = u(e.reduce(e.changeValueAction(s)));
  return expect(n.getView()).toEqual(c), n;
}
function o(e) {
  return u(e.reduce(e.changeModeAction()));
}
test("test bool control value", () => {
  let e = new a({});
  expect(e.getView()).toEqual(!1), e = t(e, "true", !0), e = t(e, "false", !1), e = t(e, '{{"true"}}', !0), e = t(e, "{{1-1}}", !1), e = t(e, "{{1+3-4}}", !1), e = t(e, "{{undefined}}", !1), e = t(e, "{{null}}", !1);
});
test("test bool control change mode", () => {
  let e = new a({});
  expect(e.getView()).toEqual(!1), expect(e.toJsonValue()).toEqual(!1), e = o(e), expect(e.toJsonValue()).toEqual("false"), e = t(e, "true", !0), e = o(e), expect(e.toJsonValue()).toEqual(!0), e = o(e), expect(e.toJsonValue()).toEqual("true"), e = t(e, "{{1+3-4}}", !1), e = o(e), expect(e.toJsonValue()).toEqual(!1), e = o(e), expect(e.toJsonValue()).toEqual("{{1+3-4}}");
});
function l(e) {
  return u(new a({
    dispatch: e.dispatch,
    value: o(e).toJsonValue()
  }));
}
test("test bool control change mode and reload", () => {
  let e = new a({});
  expect(e.getView()).toEqual(!1), expect(e.toJsonValue()).toEqual(!1), e = l(e), expect(e.toJsonValue()).toEqual("false"), e = t(e, "true", !0), e = l(e), expect(e.toJsonValue()).toEqual(!0), e = l(e), expect(e.toJsonValue()).toEqual("true"), e = t(e, "{{1+3-4}}", !1), e = l(e), expect(e.toJsonValue()).toEqual(!1), e = l(e), expect(e.toJsonValue()).toEqual("false");
});
