"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.default = void 0;
var _testUtils = _interopRequireDefault(require("react-dom/test-utils"));
var _deprecationTestkitLog = _interopRequireDefault(require("../utils/deprecationTestkitLog"));
var buttonDriverFactory = _ref => {
  var {
    element
  } = _ref;
  (0, _deprecationTestkitLog.default)('buttonTestkitFactory legacy testkit is deprecated and will be removed in next major release. Please use the ButtonTestkit unidriver testkit instead.');
  return {
    exists: () => !!element,
    click: () => _testUtils.default.Simulate.click(element),
    focus: () => _testUtils.default.Simulate.focus(element),
    blur: () => _testUtils.default.Simulate.blur(element),
    mouseEnter: () => _testUtils.default.Simulate.mouseEnter(element),
    mouseLeave: () => _testUtils.default.Simulate.mouseLeave(element),
    getButtonTextContent: () => element.textContent,
    isButtonDisabled: () => element.getAttribute('aria-disabled') === 'true',
    isPrefixIconExists: () => element.innerHTML.indexOf('prefix') !== -1,
    isSuffixIconExists: () => element.innerHTML.indexOf('suffix') !== -1
  };
};

// For internal use only!
var _default = exports.default = buttonDriverFactory;
//# sourceMappingURL=Button.legacy.driver.js.map