UNPKG

wix-style-react

Version:
47 lines (43 loc) 1.5 kB
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _protractor = require('wix-ui-test-utils/protractor'); exports.default = function (component) { var _getBackLink = function _getBackLink() { return component.$('[data-hook=menu-navigation-back-link]'); }; var getDrillViewPanelClasses = function getDrillViewPanelClasses() { return component.$$('[data-hook=drill-view-panel]').get(0).getAttribute('class'); }; return { element: function element() { return component; }, exists: function exists() { return !!component; }, hoverSubMenu: function hoverSubMenu(index) { return (0, _protractor.mouseEnter)(component.$$('[data-hook=menu-navigation-link-wrapper]').get(index)); }, clickSubMenu: function clickSubMenu(index) { return component.$$('[data-hook=menu-drill-sub-menu-link]').get(index).click(); }, getBackLink: function getBackLink() { return _getBackLink(); }, clickBackLink: function clickBackLink() { return _getBackLink().click(); }, hasSingleDrillViewPanel: function hasSingleDrillViewPanel() { return component.$$('[data-hook=drill-view-panel]').count().then(function (c) { return c === 1; }); }, hasNoTransitionClassesInDrillView: function hasNoTransitionClassesInDrillView() { return getDrillViewPanelClasses().then(function (classes) { return classes.split(' ').length === 1; }); } }; };