@wix/design-system
Version:
@wix/design-system
70 lines • 2.69 kB
JavaScript
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
var _jsxFileName = "/home/builduser/work/57e038ea7326c1ec/packages/wix-design-system/dist/esm/ColorInput/test/ColorInput.spec.jsx";
import _regeneratorRuntime from "@babel/runtime/regenerator";
import React from 'react';
import userEvent from '@testing-library/user-event';
import { createRendererWithUniDriver } from '../../utils/test-utils/react';
import { colorInputDriverFactory } from '../ColorInput.uni.driver';
import ColorInput from '../ColorInput';
describe('ColorInput', function () {
describe('[async]', function () {
runTests(createRendererWithUniDriver(colorInputDriverFactory));
});
function runTests(render) {
var _this = this;
describe('rendering the ColorInput', function () {
it('should remove the popover after tabOut', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
var _render, driver;
return _regeneratorRuntime.wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
_render = render(/*#__PURE__*/React.createElement(ColorInput, {
__self: _this,
__source: {
fileName: _jsxFileName,
lineNumber: 15,
columnNumber: 35
}
})), driver = _render.driver;
_context.next = 3;
return driver.click();
case 3:
_context.t0 = expect;
_context.next = 6;
return driver.colorPickerVisible();
case 6:
_context.t1 = _context.sent;
(0, _context.t0)(_context.t1).toBeTruthy();
_context.next = 10;
return userEvent.tab();
case 10:
_context.next = 12;
return userEvent.tab();
case 12:
_context.next = 14;
return userEvent.tab();
case 14:
_context.next = 16;
return userEvent.tab();
case 16:
_context.next = 18;
return userEvent.tab();
case 18:
_context.next = 20;
return userEvent.tab();
case 20:
_context.t2 = expect;
_context.next = 23;
return driver.colorPickerVisible();
case 23:
_context.t3 = _context.sent;
(0, _context.t2)(_context.t3).toBeFalsy();
case 25:
case "end":
return _context.stop();
}
}, _callee);
})));
});
}
});