"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 _testUtils2 = require("../../../utils/test-utils");
var _constants = require("./constants");
var titleElement = element => element.querySelector("[data-hook=\"".concat(_constants.dataHooks.title, "\"]"));
var subtitleElement = element => element.querySelector("[data-hook=\"".concat(_constants.dataHooks.subtitle, "\"] span"));
var breadcrumbsElement = element => element.querySelector("[data-hook=\"".concat(_constants.dataHooks.breadcrumbs, "\"]"));
var actionBarElement = element => element.querySelector("[data-hook=\"".concat(_constants.dataHooks.actionBar, "\"]"));
var backButtonElement = element => element.querySelector("[data-hook=\"".concat(_constants.dataHooks.backButton, "\"]"));
var _default = _ref => {
  var {
    element
  } = _ref;
  return {
    exists: () => !!element,
    hasClass: className => (0, _testUtils2.isClassExists)(element, className),
    titleText: () => titleElement(element).textContent,
    isTitleExists: () => !!titleElement(element),
    subtitleText: () => subtitleElement(element).textContent,
    isSubtitleExists: () => !!subtitleElement(element),
    isBreadcrumbsExists: () => !!breadcrumbsElement(element),
    breadcrumbsText: () => breadcrumbsElement(element).textContent,
    isActionBarExists: () => !!actionBarElement(element),
    isBackButtonExists: () => !!backButtonElement(element),
    clickBackButton: () => _testUtils.default.Simulate.click(backButtonElement(element))
  };
};
exports.default = _default;
//# sourceMappingURL=Header.driver.js.map