wix-style-react
Version:
wix-style-react
116 lines (97 loc) • 4.26 kB
JavaScript
var _this = this;
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; }
import eyes from 'eyes.it';
import { drillViewTestkitFactory } from '../../../testkit/protractor';
import { waitForVisibilityOf } from 'wix-ui-test-utils/protractor';
import { getStoryUrl } from '../../../test/utils/storybook-helpers';
describe('DrillView', function () {
var storyUrl = getStoryUrl('6. Navigation', '6.1 SideMenuDrill');
eyes.it('should clear transition classes', _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3() {
var dataHook, driver;
return regeneratorRuntime.wrap(function _callee3$(_context3) {
while (1) {
switch (_context3.prev = _context3.next) {
case 0:
dataHook = 'side-menu';
driver = drillViewTestkitFactory({ dataHook: dataHook });
_context3.next = 4;
return browser.get(storyUrl);
case 4:
_context3.next = 6;
return waitForVisibilityOf(driver.element(), 'Cannot find DrillView');
case 6:
_context3.next = 8;
return driver.clickSubMenu(1);
case 8:
_context3.next = 10;
return waitForVisibilityOf(driver.getBackLink(), 'Cannot find BackLink');
case 10:
_context3.next = 12;
return driver.clickBackLink();
case 12:
_context3.next = 14;
return browser.wait(_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
return regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return driver.hasSingleDrillViewPanel();
case 2:
return _context.abrupt('return', _context.sent);
case 3:
case 'end':
return _context.stop();
}
}
}, _callee, _this);
})));
case 14:
_context3.next = 16;
return browser.wait(_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
return regeneratorRuntime.wrap(function _callee2$(_context2) {
while (1) {
switch (_context2.prev = _context2.next) {
case 0:
_context2.next = 2;
return driver.hasNoTransitionClassesInDrillView();
case 2:
return _context2.abrupt('return', _context2.sent);
case 3:
case 'end':
return _context2.stop();
}
}
}, _callee2, _this);
})));
case 16:
case 'end':
return _context3.stop();
}
}
}, _callee3, _this);
})));
eyes.it('should show arrow on hover', _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4() {
var dataHook, driver;
return regeneratorRuntime.wrap(function _callee4$(_context4) {
while (1) {
switch (_context4.prev = _context4.next) {
case 0:
dataHook = 'side-menu';
driver = drillViewTestkitFactory({ dataHook: dataHook });
_context4.next = 4;
return browser.get(storyUrl);
case 4:
_context4.next = 6;
return waitForVisibilityOf(driver.element(), 'Cannot find DrillView');
case 6:
_context4.next = 8;
return driver.hoverSubMenu(4);
case 8:
case 'end':
return _context4.stop();
}
}
}, _callee4, _this);
})));
});