UNPKG

wix-style-react

Version:
74 lines (63 loc) 2.43 kB
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator"; import _regeneratorRuntime from "@babel/runtime/regenerator"; import styles from './MessageBoxFunctionalLayout.scss'; var messageBoxFunctionalLayoutDriverFactory = function messageBoxFunctionalLayoutDriverFactory(component) { var body = function body() { return component.$('[data-hook="message-box-body"]'); }; return { element: function element() { return component; }, toHaveFooterBorder: function () { var _toHaveFooterBorder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() { var bodyClassNames; return _regeneratorRuntime.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: _context.next = 2; return body().getAttribute('class'); case 2: bodyClassNames = _context.sent; return _context.abrupt("return", bodyClassNames.includes(styles.footerBorder)); case 4: case "end": return _context.stop(); } } }, _callee); })); function toHaveFooterBorder() { return _toHaveFooterBorder.apply(this, arguments); } return toHaveFooterBorder; }(), scrollBodyDown: function () { var _scrollBodyDown = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(offset) { return _regeneratorRuntime.wrap(function _callee2$(_context2) { while (1) { switch (_context2.prev = _context2.next) { case 0: _context2.t0 = browser; _context2.t1 = "arguments[0].scrollTop = ".concat(offset, ";"); _context2.next = 4; return body().getWebElement(); case 4: _context2.t2 = _context2.sent; return _context2.abrupt("return", _context2.t0.executeScript.call(_context2.t0, _context2.t1, _context2.t2)); case 6: case "end": return _context2.stop(); } } }, _callee2); })); function scrollBodyDown(_x) { return _scrollBodyDown.apply(this, arguments); } return scrollBodyDown; }() }; }; export default messageBoxFunctionalLayoutDriverFactory;