"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.colorPickerDriverFactory = void 0;
var _testUtils = _interopRequireDefault(require("react-dom/test-utils"));
var _constants = require("./constants");
var colorPickerDriverFactory = _ref => {
  var {
    element
  } = _ref;
  return {
    exists: () => !!element,
    confirm: () => _testUtils.default.Simulate.click(element.querySelector("[data-hook=\"".concat(_constants.DataHooks.confirmButton, "\"]"))),
    cancel: () => _testUtils.default.Simulate.click(element.querySelector("[data-hook=\"".concat(_constants.DataHooks.cancelButton, "\"]"))),
    clickOnPreviousColor: () => _testUtils.default.Simulate.click(element.querySelector("[data-hook=\"".concat(_constants.DataHooks.historyPrevious, "\"]"))),
    historyPanelExists: () => !!element.querySelector("[data-hook=\"".concat(_constants.DataHooks.history, "\"]")),
    historyCurrentColor: () => element.querySelector("[data-hook=\"".concat(_constants.DataHooks.historyCurrent, "\"]")).style.background,
    historyPreviousColor: () => element.querySelector("[data-hook=\"".concat(_constants.DataHooks.historyPrevious, "\"]")).style.background
  };
};
exports.colorPickerDriverFactory = colorPickerDriverFactory;
//# sourceMappingURL=ColorPicker.driver.js.map