UNPKG

wix-style-react

Version:
41 lines (39 loc) 1.4 kB
import { mouseEnter } from 'wix-ui-test-utils/protractor'; export 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 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; }); } }; });