"use strict";

exports.__esModule = true;
exports.BooleanEditUniDriver = BooleanEditUniDriver;
var _unidriver = require("@wix/design-system/dist/testkit/unidriver");
var _unidriver2 = require("../../../../unidriver");
function BooleanEditUniDriver(base, body) {
  const checkbox = (0, _unidriver.CheckboxUniDriver)(base.$('[data-hook="boolean-checkbox"]'), body);
  return {
    ...(0, _unidriver2.baseUniDriverFactory)(base),
    isChecked: () => checkbox.isChecked(),
    toggle: () => checkbox.click(),
    /** Native dispatch — Checkbox uni.driver has no keyDown */
    keyDown: async (key, opts) => {
      const input = await base.$('input').getNative();
      input.dispatchEvent(new KeyboardEvent('keydown', {
        key,
        bubbles: true,
        ...opts
      }));
    }
  };
}
//# sourceMappingURL=Edit.uni.driver.js.map