UNPKG

wix-style-react

Version:
136 lines (115 loc) 5.3 kB
import _defineProperty from "@babel/runtime/helpers/defineProperty"; import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator"; function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } import _regeneratorRuntime from "@babel/runtime/regenerator"; import { baseUniDriverFactory } from 'wix-ui-test-utils/base-driver'; import { calendarUniDriverFactory } from '../Calendar/Calendar.uni.driver'; import { dropdownLayoutDriverFactory } from '../DropdownLayout/DropdownLayout.uni.driver'; export var calendarPanelUniDriverFactory = function calendarPanelUniDriverFactory(base) { var calendarElement = function calendarElement() { return base.$('[data-hook=calendar]'); }; var getCalendarDriver = /*#__PURE__*/function () { var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() { return _regeneratorRuntime.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: return _context.abrupt("return", calendarUniDriverFactory(calendarElement())); case 1: case "end": return _context.stop(); } } }, _callee); })); return function getCalendarDriver() { return _ref.apply(this, arguments); }; }(); var dropdownLayoutElement = function dropdownLayoutElement() { return base.$('[data-hook=dropdown-layout]'); }; var dropdownLayoutDriver = function dropdownLayoutDriver() { return dropdownLayoutDriverFactory(dropdownLayoutElement()); }; return _objectSpread(_objectSpread({}, baseUniDriverFactory(base)), {}, { calendarDriver: function () { var _calendarDriver = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() { return _regeneratorRuntime.wrap(function _callee2$(_context2) { while (1) { switch (_context2.prev = _context2.next) { case 0: return _context2.abrupt("return", getCalendarDriver()); case 1: case "end": return _context2.stop(); } } }, _callee2); })); function calendarDriver() { return _calendarDriver.apply(this, arguments); } return calendarDriver; }(), presetsDropdownLayoutDriver: function () { var _presetsDropdownLayoutDriver = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() { return _regeneratorRuntime.wrap(function _callee3$(_context3) { while (1) { switch (_context3.prev = _context3.next) { case 0: return _context3.abrupt("return", dropdownLayoutDriver()); case 1: case "end": return _context3.stop(); } } }, _callee3); })); function presetsDropdownLayoutDriver() { return _presetsDropdownLayoutDriver.apply(this, arguments); } return presetsDropdownLayoutDriver; }(), isDropdownExists: function () { var _isDropdownExists = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() { return _regeneratorRuntime.wrap(function _callee4$(_context4) { while (1) { switch (_context4.prev = _context4.next) { case 0: return _context4.abrupt("return", dropdownLayoutElement().exists()); case 1: case "end": return _context4.stop(); } } }, _callee4); })); function isDropdownExists() { return _isDropdownExists.apply(this, arguments); } return isDropdownExists; }(), findByDataHook: function () { var _findByDataHook = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(dataHook) { return _regeneratorRuntime.wrap(function _callee5$(_context5) { while (1) { switch (_context5.prev = _context5.next) { case 0: return _context5.abrupt("return", base.$("[data-hook=".concat(dataHook, "]")).exists()); case 1: case "end": return _context5.stop(); } } }, _callee5); })); function findByDataHook(_x) { return _findByDataHook.apply(this, arguments); } return findByDataHook; }() }); };