linear-react-components-ui 0.4.77-beta.26 → 0.4.77-beta.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/inputs/multiSelect/index.js +3 -7
- package/lib/inputs/select/simple/index.js +19 -1
- package/lib/inputs/select/types.d.ts +4 -0
- package/package.json +1 -1
- package/dist/main.js +0 -14
- package/lib/alerts/alert.spec.js +0 -110
- package/lib/assets/styles/treetable.scss +0 -100
- package/lib/avatar/avatar.spec.js +0 -158
- package/lib/badge/badge.spec.js +0 -105
- package/lib/buttons/SpinnerLoading.js +0 -230
- package/lib/buttons/buttons.spec.js +0 -430
- package/lib/calendar/calendar.spec.js +0 -140
- package/lib/checkbox/checkbox.spec.js +0 -174
- package/lib/dialog/dialog.spec.js +0 -414
- package/lib/drawer/Drawer.spec.js +0 -215
- package/lib/dropdown/dropdown.spec.js +0 -145
- package/lib/fieldset/fieldset.spec.js +0 -283
- package/lib/form/form.spec.js +0 -251
- package/lib/gridlayout/gridLayout.spec.js +0 -142
- package/lib/icons/icons.spec.js +0 -70
- package/lib/inputs/base/base.spec.js +0 -575
- package/lib/inputs/base/index.js +0 -1
- package/lib/inputs/color/color_input.spec.js +0 -140
- package/lib/inputs/date/date.spec.js +0 -273
- package/lib/inputs/mask/input_mask.spec.js +0 -494
- package/lib/inputs/number/numberfield.spec.js +0 -174
- package/lib/inputs/search/search_input.spec.js +0 -169
- package/lib/inputs/select/select.spec.js +0 -340
- package/lib/inputs/text/textfield.spec.js +0 -174
- package/lib/inputs/textarea/textarea.spec.js +0 -46
- package/lib/labelMessages/labelMessages.spec.js +0 -143
- package/lib/labels/label.spec.js +0 -135
- package/lib/list/list.spec.js +0 -622
- package/lib/menus/float/float-menu.spec.js +0 -187
- package/lib/menus/sidenav/sidenav.spec.js +0 -330
- package/lib/panel/panel.spec.js +0 -179
- package/lib/popover/popover.spec.js +0 -116
- package/lib/progress/progress.spec.js +0 -78
- package/lib/radio/radio.spec.js +0 -162
- package/lib/spinner/spinner.spec.js +0 -130
- package/lib/split/split.spec.js +0 -138
- package/lib/table/table.spec.js +0 -297
- package/lib/tabs/tabs.spec.js +0 -258
- package/lib/toolbar/toolbar.spec.js +0 -346
- package/lib/tooltip/tooltip.spec.js +0 -188
- package/lib/treetable/Body.js +0 -46
- package/lib/treetable/Header.js +0 -27
- package/lib/treetable/Row.js +0 -261
- package/lib/treetable/helpers.js +0 -41
- package/lib/treetable/index.js +0 -24
- package/lib/treetable/types.d.js +0 -5
- package/lib/treeview/treeview.spec.js +0 -242
- package/lib/uitour/uitour.spec.js +0 -154
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
var _react = _interopRequireDefault(require("react"));
|
|
5
|
-
var _react2 = require("@testing-library/react");
|
|
6
|
-
require("babel-polyfill");
|
|
7
|
-
require("@testing-library/jest-dom");
|
|
8
|
-
var _moment = _interopRequireDefault(require("moment"));
|
|
9
|
-
var _ = _interopRequireWildcard(require("."));
|
|
10
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
11
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
12
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
14
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
15
|
-
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
16
|
-
var calendarMockRender = function calendarMockRender(props) {
|
|
17
|
-
return /*#__PURE__*/_react.default.createElement(_.default, props);
|
|
18
|
-
};
|
|
19
|
-
describe('Calendar', function () {
|
|
20
|
-
describe('Default', function () {
|
|
21
|
-
it('should render without errors', function () {
|
|
22
|
-
var _render = (0, _react2.render)(calendarMockRender({})),
|
|
23
|
-
container = _render.container;
|
|
24
|
-
expect(container.firstChild).toBeTruthy();
|
|
25
|
-
expect(container.firstChild).toHaveClass('calendar-component');
|
|
26
|
-
});
|
|
27
|
-
it('should render currentDate month and year', function () {
|
|
28
|
-
var _render2 = (0, _react2.render)(calendarMockRender({
|
|
29
|
-
currentDate: (0, _moment.default)('2020-01-01')
|
|
30
|
-
})),
|
|
31
|
-
container = _render2.container;
|
|
32
|
-
expect(container.querySelector('span.monthname')).toHaveTextContent('janeiro 2020');
|
|
33
|
-
});
|
|
34
|
-
it('should render currentDate selected day', function () {
|
|
35
|
-
var _render3 = (0, _react2.render)(calendarMockRender({
|
|
36
|
-
currentDate: (0, _moment.default)('2020-01-01')
|
|
37
|
-
})),
|
|
38
|
-
container = _render3.container;
|
|
39
|
-
expect(container.querySelector('.monthday.-selectedday .button-component')).toHaveTextContent('1');
|
|
40
|
-
});
|
|
41
|
-
it('should go to next month', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
42
|
-
var _render4, container;
|
|
43
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
44
|
-
while (1) {
|
|
45
|
-
switch (_context.prev = _context.next) {
|
|
46
|
-
case 0:
|
|
47
|
-
_render4 = (0, _react2.render)(calendarMockRender({
|
|
48
|
-
currentDate: (0, _moment.default)('2020-01-01')
|
|
49
|
-
})), container = _render4.container;
|
|
50
|
-
_react2.fireEvent.click(container.querySelectorAll('.button-component.navbutton')[1]);
|
|
51
|
-
_context.next = 4;
|
|
52
|
-
return (0, _react2.waitFor)(function () {
|
|
53
|
-
return expect(container.querySelector('span.monthname')).toHaveTextContent('fevereiro 2020');
|
|
54
|
-
}, {
|
|
55
|
-
timeout: 3000
|
|
56
|
-
});
|
|
57
|
-
case 4:
|
|
58
|
-
case "end":
|
|
59
|
-
return _context.stop();
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}, _callee);
|
|
63
|
-
})));
|
|
64
|
-
it('should select another day', function () {
|
|
65
|
-
var _render5 = (0, _react2.render)(calendarMockRender({
|
|
66
|
-
currentDate: (0, _moment.default)('2020-01-01')
|
|
67
|
-
})),
|
|
68
|
-
container = _render5.container;
|
|
69
|
-
_react2.fireEvent.click(container.querySelectorAll('.calendarmonth .monthweek .monthday button')[6]);
|
|
70
|
-
expect(container.querySelector('.monthday.-selectedday .button-component')).toHaveTextContent('4');
|
|
71
|
-
});
|
|
72
|
-
it('should fire onChange callback', function () {
|
|
73
|
-
var mockCallback = jest.fn();
|
|
74
|
-
var _render6 = (0, _react2.render)(calendarMockRender({
|
|
75
|
-
currentDate: (0, _moment.default)('2020-01-01'),
|
|
76
|
-
onDateChange: mockCallback
|
|
77
|
-
})),
|
|
78
|
-
container = _render6.container;
|
|
79
|
-
_react2.fireEvent.click(container.querySelectorAll('.calendarmonth .monthweek .monthday button')[6]);
|
|
80
|
-
var dateReceived = mockCallback.mock.calls[0][0];
|
|
81
|
-
var dateToBe = (0, _moment.default)('2020-01-04');
|
|
82
|
-
expect(container.querySelector('.monthday.-selectedday .button-component')).toHaveTextContent('4');
|
|
83
|
-
expect(mockCallback).toHaveBeenCalled();
|
|
84
|
-
expect(dateReceived.format()).toBe(dateToBe.format());
|
|
85
|
-
});
|
|
86
|
-
it('should apply drawGridLines', function () {
|
|
87
|
-
var _render7 = (0, _react2.render)(calendarMockRender({
|
|
88
|
-
currentDate: (0, _moment.default)('2020-01-01'),
|
|
89
|
-
drawGridLines: true
|
|
90
|
-
})),
|
|
91
|
-
container = _render7.container;
|
|
92
|
-
expect(container.querySelector('.calendar-component')).toHaveClass('-draw-grid-lines');
|
|
93
|
-
});
|
|
94
|
-
it('should apply unpadding', function () {
|
|
95
|
-
var _render8 = (0, _react2.render)(calendarMockRender({
|
|
96
|
-
currentDate: (0, _moment.default)('2020-01-01'),
|
|
97
|
-
unpadding: true
|
|
98
|
-
})),
|
|
99
|
-
container = _render8.container;
|
|
100
|
-
expect(container.querySelector('.calendar-component')).toHaveClass('-unpadding');
|
|
101
|
-
});
|
|
102
|
-
});
|
|
103
|
-
describe('Custom', function () {
|
|
104
|
-
it('should apply danger style', function () {
|
|
105
|
-
var _render9 = (0, _react2.render)( /*#__PURE__*/_react.default.createElement(_.DangerCalendar, null)),
|
|
106
|
-
container = _render9.container;
|
|
107
|
-
expect(container.firstChild).toBeTruthy();
|
|
108
|
-
expect(container.firstChild).toHaveClass('calendar-component');
|
|
109
|
-
expect(container.firstChild).toHaveClass('-danger');
|
|
110
|
-
});
|
|
111
|
-
it('should apply success style', function () {
|
|
112
|
-
var _render10 = (0, _react2.render)( /*#__PURE__*/_react.default.createElement(_.SuccessCalendar, null)),
|
|
113
|
-
container = _render10.container;
|
|
114
|
-
expect(container.firstChild).toBeTruthy();
|
|
115
|
-
expect(container.firstChild).toHaveClass('calendar-component');
|
|
116
|
-
expect(container.firstChild).toHaveClass('-success');
|
|
117
|
-
});
|
|
118
|
-
it('should apply primary style', function () {
|
|
119
|
-
var _render11 = (0, _react2.render)( /*#__PURE__*/_react.default.createElement(_.PrimaryCalendar, null)),
|
|
120
|
-
container = _render11.container;
|
|
121
|
-
expect(container.firstChild).toBeTruthy();
|
|
122
|
-
expect(container.firstChild).toHaveClass('calendar-component');
|
|
123
|
-
expect(container.firstChild).toHaveClass('-primary');
|
|
124
|
-
});
|
|
125
|
-
it('should apply warning style', function () {
|
|
126
|
-
var _render12 = (0, _react2.render)( /*#__PURE__*/_react.default.createElement(_.WarningCalendar, null)),
|
|
127
|
-
container = _render12.container;
|
|
128
|
-
expect(container.firstChild).toBeTruthy();
|
|
129
|
-
expect(container.firstChild).toHaveClass('calendar-component');
|
|
130
|
-
expect(container.firstChild).toHaveClass('-warning');
|
|
131
|
-
});
|
|
132
|
-
it('should apply info style', function () {
|
|
133
|
-
var _render13 = (0, _react2.render)( /*#__PURE__*/_react.default.createElement(_.InfoCalendar, null)),
|
|
134
|
-
container = _render13.container;
|
|
135
|
-
expect(container.firstChild).toBeTruthy();
|
|
136
|
-
expect(container.firstChild).toHaveClass('calendar-component');
|
|
137
|
-
expect(container.firstChild).toHaveClass('-info');
|
|
138
|
-
});
|
|
139
|
-
});
|
|
140
|
-
});
|
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
var _react = require("@testing-library/react");
|
|
5
|
-
var _react2 = _interopRequireDefault(require("react"));
|
|
6
|
-
require("babel-polyfill");
|
|
7
|
-
var _ = _interopRequireDefault(require("."));
|
|
8
|
-
var _storageMock = _interopRequireWildcard(require("../../../config/jest/storageMock"));
|
|
9
|
-
var _gridlayout = require("../gridlayout");
|
|
10
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
11
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
12
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
14
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
15
|
-
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
16
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
17
|
-
var CheckBoxTest = function CheckBoxTest(props) {
|
|
18
|
-
return /*#__PURE__*/_react2.default.createElement(_gridlayout.GridRow, {
|
|
19
|
-
style: {
|
|
20
|
-
marginBottom: 20
|
|
21
|
-
}
|
|
22
|
-
}, /*#__PURE__*/_react2.default.createElement(_.default, _extends({}, props, {
|
|
23
|
-
name: "test",
|
|
24
|
-
value: "1",
|
|
25
|
-
label: "testLabel",
|
|
26
|
-
id: "1",
|
|
27
|
-
hint: "test",
|
|
28
|
-
gridLayout: "6 6 6 6"
|
|
29
|
-
})));
|
|
30
|
-
};
|
|
31
|
-
describe('CheckBox', function () {
|
|
32
|
-
describe('Default', function () {
|
|
33
|
-
it('should render without errors', function () {
|
|
34
|
-
var _render = (0, _react.render)(CheckBoxTest({})),
|
|
35
|
-
container = _render.container;
|
|
36
|
-
expect(container.firstChild).toBeTruthy();
|
|
37
|
-
});
|
|
38
|
-
it('should hint', function () {
|
|
39
|
-
var _render2 = (0, _react.render)(CheckBoxTest({})),
|
|
40
|
-
container = _render2.container;
|
|
41
|
-
expect(container.firstChild).toContainElement(container.querySelector('.hint'));
|
|
42
|
-
});
|
|
43
|
-
it('should label text match with prop label', function () {
|
|
44
|
-
var _render3 = (0, _react.render)(CheckBoxTest({})),
|
|
45
|
-
container = _render3.container;
|
|
46
|
-
expect(container.querySelector('.description')).toHaveTextContent('testLabel');
|
|
47
|
-
});
|
|
48
|
-
it('should checkbox have id ', function () {
|
|
49
|
-
var _render4 = (0, _react.render)(CheckBoxTest({})),
|
|
50
|
-
container = _render4.container;
|
|
51
|
-
expect(container.querySelector('.input').id).toBe('1');
|
|
52
|
-
});
|
|
53
|
-
it('should checkbox have name test', function () {
|
|
54
|
-
var _render5 = (0, _react.render)(CheckBoxTest({})),
|
|
55
|
-
container = _render5.container;
|
|
56
|
-
expect(container.querySelector('.input').name).toBe('test');
|
|
57
|
-
});
|
|
58
|
-
it('should checkbox have value', function () {
|
|
59
|
-
var _render6 = (0, _react.render)(CheckBoxTest({})),
|
|
60
|
-
container = _render6.container;
|
|
61
|
-
expect(container.querySelector('.input').value).toBe('1');
|
|
62
|
-
});
|
|
63
|
-
it('should change checked', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
64
|
-
var _render7, container;
|
|
65
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
66
|
-
while (1) {
|
|
67
|
-
switch (_context.prev = _context.next) {
|
|
68
|
-
case 0:
|
|
69
|
-
_render7 = (0, _react.render)(CheckBoxTest({})), container = _render7.container;
|
|
70
|
-
expect(container.querySelector('.input').checked).toEqual(false);
|
|
71
|
-
_react.fireEvent.click(container.querySelector('.input'));
|
|
72
|
-
expect(container.querySelector('.input').checked).toEqual(true);
|
|
73
|
-
case 4:
|
|
74
|
-
case "end":
|
|
75
|
-
return _context.stop();
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}, _callee);
|
|
79
|
-
})));
|
|
80
|
-
it('should disable', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
81
|
-
var _render8, container;
|
|
82
|
-
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
83
|
-
while (1) {
|
|
84
|
-
switch (_context2.prev = _context2.next) {
|
|
85
|
-
case 0:
|
|
86
|
-
_render8 = (0, _react.render)(CheckBoxTest({
|
|
87
|
-
disabled: true
|
|
88
|
-
})), container = _render8.container;
|
|
89
|
-
expect(container.querySelector('.input').checked).toEqual(false);
|
|
90
|
-
_react.fireEvent.click(container.querySelector('.input'));
|
|
91
|
-
expect(container.querySelector('.input').checked).toEqual(false);
|
|
92
|
-
case 4:
|
|
93
|
-
case "end":
|
|
94
|
-
return _context2.stop();
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}, _callee2);
|
|
98
|
-
})));
|
|
99
|
-
it('should required', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
100
|
-
var _render9, container;
|
|
101
|
-
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
102
|
-
while (1) {
|
|
103
|
-
switch (_context3.prev = _context3.next) {
|
|
104
|
-
case 0:
|
|
105
|
-
_render9 = (0, _react.render)(CheckBoxTest({
|
|
106
|
-
required: true
|
|
107
|
-
})), container = _render9.container;
|
|
108
|
-
expect(container.querySelector('.input').required).toEqual(true);
|
|
109
|
-
case 2:
|
|
110
|
-
case "end":
|
|
111
|
-
return _context3.stop();
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
}, _callee3);
|
|
115
|
-
})));
|
|
116
|
-
it('should autoFocus', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
117
|
-
var _render10, container;
|
|
118
|
-
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
119
|
-
while (1) {
|
|
120
|
-
switch (_context4.prev = _context4.next) {
|
|
121
|
-
case 0:
|
|
122
|
-
_render10 = (0, _react.render)(CheckBoxTest({
|
|
123
|
-
autoFocus: true
|
|
124
|
-
})), container = _render10.container;
|
|
125
|
-
container.querySelector('.input').focus();
|
|
126
|
-
expect(container.querySelector('.input')).toHaveFocus();
|
|
127
|
-
case 3:
|
|
128
|
-
case "end":
|
|
129
|
-
return _context4.stop();
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
}, _callee4);
|
|
133
|
-
})));
|
|
134
|
-
});
|
|
135
|
-
describe('Permission', function () {
|
|
136
|
-
var defineStorage = function defineStorage() {
|
|
137
|
-
Object.defineProperty(window, 'sessionStorage', {
|
|
138
|
-
value: (0, _storageMock.default)()
|
|
139
|
-
});
|
|
140
|
-
};
|
|
141
|
-
it('should check permission', function () {
|
|
142
|
-
defineStorage();
|
|
143
|
-
var _render11 = (0, _react.render)( /*#__PURE__*/_react2.default.createElement(_.default, {
|
|
144
|
-
permissionAttr: (0, _storageMock.permissionAttrMockAuthorized)('disabled')
|
|
145
|
-
})),
|
|
146
|
-
container = _render11.container;
|
|
147
|
-
expect(container.firstChild).not.toHaveClass('disabled');
|
|
148
|
-
expect(container.firstChild).toBeTruthy();
|
|
149
|
-
});
|
|
150
|
-
it('should check permission, be unavaible and onDenied is disabled', function () {
|
|
151
|
-
defineStorage();
|
|
152
|
-
var mockOnClick = jest.fn();
|
|
153
|
-
var mockCheckbox = /*#__PURE__*/_react2.default.createElement(_.default, {
|
|
154
|
-
onClick: mockOnClick,
|
|
155
|
-
permissionAttr: (0, _storageMock.permissionAttrMockUnauthorized)('disabled')
|
|
156
|
-
});
|
|
157
|
-
var _render12 = (0, _react.render)(mockCheckbox),
|
|
158
|
-
getByTestId = _render12.getByTestId,
|
|
159
|
-
container = _render12.container;
|
|
160
|
-
_react.fireEvent.click(container.firstChild);
|
|
161
|
-
expect(getByTestId('checkbox-container')).toBeVisible();
|
|
162
|
-
expect(container.querySelector('.input')).toBeDisabled();
|
|
163
|
-
expect(mockOnClick).toBeCalledTimes(0);
|
|
164
|
-
});
|
|
165
|
-
it('should check permission, be unavaible and onDenied is unvisible', function () {
|
|
166
|
-
defineStorage();
|
|
167
|
-
var _render13 = (0, _react.render)( /*#__PURE__*/_react2.default.createElement(_.default, {
|
|
168
|
-
permissionAttr: (0, _storageMock.permissionAttrMockUnauthorized)('unvisible')
|
|
169
|
-
})),
|
|
170
|
-
container = _render13.container;
|
|
171
|
-
expect(container.firstChild).not.toBeTruthy();
|
|
172
|
-
});
|
|
173
|
-
});
|
|
174
|
-
});
|