linear-react-components-ui 0.4.77-beta.25 → 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/.eslintrc.json +2 -0
- package/.vscode/settings.json +2 -2
- package/babel.config.json +11 -0
- package/lib/@types/Align.d.ts +3 -0
- package/lib/@types/ButtonTypes.d.ts +3 -0
- package/lib/@types/ColorStyles.d.ts +3 -0
- package/lib/@types/DataCombo.d.ts +3 -0
- package/lib/@types/Icon.d.ts +5 -0
- package/lib/@types/LabelStyles.d.ts +3 -0
- package/lib/@types/Period.d.ts +6 -0
- package/lib/@types/PermissionAttr.d.ts +14 -0
- package/lib/@types/PointerEvents.d.ts +3 -0
- package/lib/@types/Position.d.ts +3 -0
- package/lib/@types/PositionAlert.d.ts +3 -0
- package/lib/@types/Size.d.ts +3 -0
- package/lib/@types/SizePixels.d.ts +3 -0
- package/lib/@types/StorageMock.d.ts +5 -0
- package/lib/alerts/AlertContainer.d.ts +16 -0
- package/lib/alerts/AlertProvider.d.ts +7 -0
- package/lib/alerts/AlertProvider.js +1 -1
- package/lib/alerts/BaseAlert.d.ts +7 -0
- package/lib/alerts/Message.d.ts +7 -0
- package/lib/alerts/helpers.d.ts +7 -0
- package/lib/alerts/index.d.ts +6 -0
- package/lib/alerts/types.d.ts +48 -0
- package/lib/alerts/withAlert.d.ts +7 -0
- package/lib/alerts/withAlert.js +5 -3
- package/lib/avatar/index.d.ts +12 -0
- package/lib/avatar/types.d.ts +31 -0
- package/lib/badge/index.d.ts +6 -0
- package/lib/badge/types.d.ts +13 -0
- package/lib/buttons/ActivateButton.d.ts +9 -0
- package/lib/buttons/AddButton.d.ts +9 -0
- package/lib/buttons/Button.d.ts +12 -0
- package/lib/buttons/ButtonGroups.d.ts +8 -0
- package/lib/buttons/CancelButton.d.ts +9 -0
- package/lib/buttons/DangerButton.d.ts +9 -0
- package/lib/buttons/DefaultButton.d.ts +12 -0
- package/lib/buttons/DefaultButton.js +5 -3
- package/lib/buttons/DestroyButton.d.ts +9 -0
- package/lib/buttons/EditButton.d.ts +9 -0
- package/lib/buttons/InactivateButton.d.ts +9 -0
- package/lib/buttons/InfoButton.d.ts +9 -0
- package/lib/buttons/PrimaryButton.d.ts +9 -0
- package/lib/buttons/RestoreButton.d.ts +9 -0
- package/lib/buttons/SaveButton.d.ts +9 -0
- package/lib/buttons/SuccessButton.d.ts +9 -0
- package/lib/buttons/WarningButton.d.ts +9 -0
- package/lib/buttons/button_container/index.d.ts +12 -0
- package/lib/buttons/index.d.ts +21 -0
- package/lib/buttons/split_button/index.d.ts +9 -0
- package/lib/buttons/split_button/index.js +22 -2
- package/lib/buttons/types.d.ts +44 -0
- package/lib/calendar/DangerCalendar.d.ts +7 -0
- package/lib/calendar/InfoCalendar.d.ts +7 -0
- package/lib/calendar/PrimaryCalendar.d.ts +7 -0
- package/lib/calendar/SuccessCalendar.d.ts +7 -0
- package/lib/calendar/WarningCalendar.d.ts +7 -0
- package/lib/calendar/base/Day.d.ts +7 -0
- package/lib/calendar/base/Month.d.ts +7 -0
- package/lib/calendar/base/Week.d.ts +7 -0
- package/lib/calendar/base/helpers.d.ts +62 -0
- package/lib/calendar/base/helpers.js +1 -1
- package/lib/calendar/base/index.d.ts +7 -0
- package/lib/calendar/index.d.ts +10 -0
- package/lib/calendar/types.d.ts +25 -0
- package/lib/checkbox/Label.d.ts +11 -0
- package/lib/checkbox/index.d.ts +13 -0
- package/lib/checkbox/index.js +1 -1
- package/lib/checkbox/types.d.ts +42 -0
- package/lib/dialog/Alert.d.ts +6 -0
- package/lib/dialog/Custom.d.ts +6 -0
- package/lib/dialog/Custom.js +4 -4
- package/lib/dialog/Error.d.ts +6 -0
- package/lib/dialog/Information.d.ts +6 -0
- package/lib/dialog/Question.d.ts +6 -0
- package/lib/dialog/Warning.d.ts +6 -0
- package/lib/dialog/base/Content.d.ts +6 -0
- package/lib/dialog/base/Footer.d.ts +6 -0
- package/lib/dialog/base/Header.d.ts +6 -0
- package/lib/dialog/base/index.d.ts +6 -0
- package/lib/dialog/form/index.d.ts +6 -0
- package/lib/dialog/index.d.ts +10 -0
- package/lib/dialog/types.d.ts +68 -0
- package/lib/drawer/Content.d.ts +7 -0
- package/lib/drawer/Drawer.d.ts +7 -0
- package/lib/drawer/Drawer.js +1 -1
- package/lib/drawer/Header.d.ts +7 -0
- package/lib/drawer/helpers.d.ts +7 -0
- package/lib/drawer/index.d.ts +9 -0
- package/lib/drawer/types.d.ts +34 -0
- package/lib/dropdown/Popup.d.ts +6 -0
- package/lib/dropdown/Popup.js +4 -2
- package/lib/dropdown/helper.d.ts +4 -0
- package/lib/dropdown/types.d.ts +43 -0
- package/lib/dropdown/withDropdown.d.ts +10 -0
- package/lib/dropdown/withDropdown.js +3 -1
- package/lib/fieldset/index.d.ts +8 -0
- package/lib/fieldset/index.js +1 -1
- package/lib/fieldset/types.d.ts +28 -0
- package/lib/form/Field.d.ts +6 -0
- package/lib/form/Field.js +11 -38
- package/lib/form/FieldArray.d.ts +6 -0
- package/lib/form/FieldArray.js +18 -48
- package/lib/form/FieldNumber.d.ts +6 -0
- package/lib/form/FieldNumber.js +2 -26
- package/lib/form/FieldPeriod.d.ts +6 -0
- package/lib/form/FieldPeriod.js +18 -40
- package/lib/form/helpers.d.ts +11 -0
- package/lib/form/helpers.js +10 -16
- package/lib/form/index.d.ts +9 -0
- package/lib/form/index.js +50 -85
- package/lib/form/types.d.ts +168 -0
- package/lib/{treetable/types.d.js → form/types.js} +0 -0
- package/lib/form/withFieldHOC.d.ts +6 -0
- package/lib/form/withFieldHOC.js +38 -118
- package/lib/form/withFormSecurity.d.ts +7 -0
- package/lib/form/withFormSecurity.js +13 -34
- package/lib/gridlayout/GridCol.d.ts +6 -0
- package/lib/gridlayout/GridRow.d.ts +6 -0
- package/lib/gridlayout/index.d.ts +5 -0
- package/lib/gridlayout/types.d.ts +20 -0
- package/lib/icons/helper.d.ts +560 -0
- package/lib/icons/index.d.ts +8 -0
- package/lib/icons/types.d.ts +28 -0
- package/lib/index.d.ts +35 -0
- package/lib/inputs/base/InputTextBase.d.ts +8 -0
- package/lib/inputs/base/InputTextBase.js +2 -2
- package/lib/inputs/base/helpers.d.ts +14 -0
- package/lib/inputs/base/helpers.js +1 -1
- package/lib/inputs/base/types.d.ts +68 -0
- package/lib/inputs/color/index.d.ts +7 -0
- package/lib/inputs/color/types.d.ts +14 -0
- package/lib/inputs/date/Dialog.d.ts +10 -0
- package/lib/inputs/date/Dropdown.d.ts +10 -0
- package/lib/inputs/date/helpers.d.ts +14 -0
- package/lib/inputs/date/index.d.ts +10 -0
- package/lib/inputs/date/types.d.ts +53 -0
- package/lib/inputs/inputHOC.d.ts +11 -0
- package/lib/inputs/mask/BaseMask.d.ts +12 -0
- package/lib/inputs/mask/Cnpj.d.ts +12 -0
- package/lib/inputs/mask/Cnpj.js +3 -1
- package/lib/inputs/mask/Cpf.d.ts +12 -0
- package/lib/inputs/mask/Cpf.js +5 -2
- package/lib/inputs/mask/Phone.d.ts +9 -0
- package/lib/inputs/mask/ZipCode.d.ts +9 -0
- package/lib/inputs/mask/helpers.d.ts +14 -0
- package/lib/inputs/mask/imaskHOC.d.ts +14 -0
- package/lib/inputs/mask/imaskHOC.js +9 -10
- package/lib/inputs/mask/index.d.ts +11 -0
- package/lib/inputs/mask/types.d.ts +66 -0
- package/lib/inputs/multiSelect/ActionButtons.d.ts +10 -0
- package/lib/inputs/multiSelect/Dropdown.d.ts +10 -0
- package/lib/inputs/multiSelect/helper.d.ts +9 -0
- package/lib/inputs/multiSelect/index.d.ts +10 -0
- package/lib/inputs/multiSelect/index.js +6 -3
- package/lib/inputs/multiSelect/types.d.ts +49 -0
- package/lib/inputs/number/BaseNumber.d.ts +12 -0
- package/lib/inputs/number/BaseNumber.js +1 -1
- package/lib/inputs/number/Currency.d.ts +12 -0
- package/lib/inputs/number/Decimal.d.ts +12 -0
- package/lib/inputs/number/format_number.d.ts +4 -0
- package/lib/inputs/number/index.d.ts +14 -0
- package/lib/inputs/number/types.d.ts +30 -0
- package/lib/inputs/period/Dialog.d.ts +11 -0
- package/lib/inputs/period/Dropdown.d.ts +11 -0
- package/lib/inputs/period/PeriodList.d.ts +11 -0
- package/lib/inputs/period/helper.d.ts +19 -0
- package/lib/inputs/period/index.d.ts +11 -0
- package/lib/inputs/period/index.js +7 -5
- package/lib/inputs/period/types.d.ts +58 -0
- package/lib/inputs/search/index.d.ts +11 -0
- package/lib/inputs/search/index.js +0 -3
- package/lib/inputs/select/ActionButtons.d.ts +11 -0
- package/lib/inputs/select/Dropdown.d.ts +11 -0
- package/lib/inputs/select/helper.d.ts +25 -0
- package/lib/inputs/select/index.d.ts +10 -0
- package/lib/inputs/select/index.js +3 -1
- package/lib/inputs/select/multiple/Selecteds.d.ts +10 -0
- package/lib/inputs/select/multiple/index.d.ts +10 -0
- package/lib/inputs/select/simple/index.d.ts +10 -0
- package/lib/inputs/select/simple/index.js +19 -1
- package/lib/inputs/select/types.d.ts +98 -0
- package/lib/inputs/text/index.d.ts +11 -0
- package/lib/inputs/text/types.d.ts +25 -0
- package/lib/inputs/textarea/index.d.ts +9 -0
- package/lib/inputs/textarea/types.d.ts +13 -0
- package/lib/inputs/types.d.ts +146 -0
- package/lib/internals/colorStyles.d.ts +9 -0
- package/lib/internals/constants.d.ts +11 -0
- package/lib/internals/types.d.ts +21 -0
- package/lib/internals/withTooltip.d.ts +11 -0
- package/lib/labelMessages/index.d.ts +7 -0
- package/lib/labelMessages/types.d.ts +18 -0
- package/lib/labels/DangerLabel.d.ts +9 -0
- package/lib/labels/DefaultLabel.d.ts +12 -0
- package/lib/labels/DefaultLabel.js +1 -1
- package/lib/labels/InfoLabel.d.ts +9 -0
- package/lib/labels/PrimaryLabel.d.ts +9 -0
- package/lib/labels/SuccessLabel.d.ts +9 -0
- package/lib/labels/WarningLabel.d.ts +9 -0
- package/lib/labels/index.d.ts +13 -0
- package/lib/labels/label_container/index.d.ts +12 -0
- package/lib/labels/types.d.ts +24 -0
- package/lib/list/Header.d.ts +7 -0
- package/lib/list/Item.d.ts +7 -0
- package/lib/list/Item.js +8 -6
- package/lib/list/Separator.d.ts +3 -0
- package/lib/list/helpers.d.ts +12 -0
- package/lib/list/helpers.js +8 -3
- package/lib/list/index.d.ts +10 -0
- package/lib/list/index.js +87 -18
- package/lib/list/types.d.ts +64 -0
- package/lib/menus/float/MenuItem.d.ts +7 -0
- package/lib/menus/float/helpers.d.ts +7 -0
- package/lib/menus/float/index.d.ts +8 -0
- package/lib/menus/float/types.d.ts +27 -0
- package/lib/menus/index.d.ts +6 -0
- package/lib/menus/sidenav/ExpandMenu.d.ts +10 -0
- package/lib/menus/sidenav/MenuLink.d.ts +13 -0
- package/lib/menus/sidenav/NavMenuGroup.d.ts +10 -0
- package/lib/menus/sidenav/NavMenuItem.d.ts +13 -0
- package/lib/menus/sidenav/NavMenuItem.js +1 -1
- package/lib/menus/sidenav/NavSubMenuItem.d.ts +10 -0
- package/lib/menus/sidenav/NavSubMenuItem.js +1 -1
- package/lib/menus/sidenav/helpers.d.ts +12 -0
- package/lib/menus/sidenav/index.d.ts +14 -0
- package/lib/menus/sidenav/popup_menu_search/EmptyList.d.ts +10 -0
- package/lib/menus/sidenav/popup_menu_search/index.d.ts +10 -0
- package/lib/menus/sidenav/types.d.ts +82 -0
- package/lib/noPermission/index.d.ts +3 -0
- package/lib/panel/Content.d.ts +8 -0
- package/lib/panel/DangerPanel.d.ts +8 -0
- package/lib/panel/Default.d.ts +8 -0
- package/lib/panel/Default.js +1 -1
- package/lib/panel/Header.d.ts +8 -0
- package/lib/panel/InfoPanel.d.ts +8 -0
- package/lib/panel/PrimaryPanel.d.ts +8 -0
- package/lib/panel/SuccessPanel.d.ts +8 -0
- package/lib/panel/ToolBar.d.ts +8 -0
- package/lib/panel/WarningPanel.d.ts +8 -0
- package/lib/panel/helpers.d.ts +4 -0
- package/lib/panel/index.d.ts +13 -0
- package/lib/panel/types.d.ts +4 -0
- package/lib/permissionValidations.d.ts +14 -0
- package/lib/permissionValidations.js +14 -12
- package/lib/popover/PopoverText.d.ts +8 -0
- package/lib/popover/PopoverTitle.d.ts +8 -0
- package/lib/popover/index.d.ts +13 -0
- package/lib/popover/types.d.ts +21 -0
- package/lib/progress/Bar.d.ts +6 -0
- package/lib/progress/index.d.ts +7 -0
- package/lib/progress/types.d.ts +37 -0
- package/lib/radio/index.d.ts +12 -0
- package/lib/radio/index.js +1 -1
- package/lib/radio/types.d.ts +18 -0
- package/lib/skeleton/SkeletonContainer.d.ts +7 -0
- package/lib/skeleton/SkeletonContainer.js +0 -13
- package/lib/skeleton/index.d.ts +8 -0
- package/lib/skeleton/index.js +6 -25
- package/lib/skeleton/types.d.ts +21 -0
- package/lib/skeleton/types.js +5 -0
- package/lib/spinner/SpinnerLoading.d.ts +7 -0
- package/lib/spinner/index.d.ts +7 -0
- package/lib/spinner/types.d.ts +20 -0
- package/lib/split/Split.d.ts +6 -0
- package/lib/split/SplitSide.d.ts +6 -0
- package/lib/split/helpers.d.ts +10 -0
- package/lib/split/index.d.ts +5 -0
- package/lib/split/types.d.ts +34 -0
- package/lib/table/Body.d.ts +6 -0
- package/lib/table/Header.d.ts +6 -0
- package/lib/table/Header.js +34 -6
- package/lib/table/HeaderColumn.d.ts +6 -0
- package/lib/table/HeaderColumn.js +1 -1
- package/lib/table/Row.d.ts +6 -0
- package/lib/table/Row.js +4 -9
- package/lib/table/RowColumn.d.ts +6 -0
- package/lib/table/RowColumn.js +2 -2
- package/lib/table/helpers.d.ts +8 -0
- package/lib/table/index.d.ts +11 -0
- package/lib/table/types.d.ts +84 -0
- package/lib/tabs/DropdownItems.d.ts +9 -0
- package/lib/tabs/Menu.d.ts +9 -0
- package/lib/tabs/MenuItems.d.ts +9 -0
- package/lib/tabs/MenuItems.js +1 -1
- package/lib/tabs/Panel.d.ts +9 -0
- package/lib/tabs/Panel.js +1 -1
- package/lib/tabs/index.d.ts +10 -0
- package/lib/tabs/tabHelpers.d.ts +21 -0
- package/lib/tabs/types.d.ts +63 -0
- package/lib/toolbar/ButtonBar.d.ts +10 -0
- package/lib/toolbar/LabelBar.d.ts +10 -0
- package/lib/toolbar/LabelBar.js +1 -1
- package/lib/toolbar/Separator.d.ts +3 -0
- package/lib/toolbar/ToolBarGroup.d.ts +10 -0
- package/lib/toolbar/helpers.d.ts +10 -0
- package/lib/toolbar/index.d.ts +14 -0
- package/lib/toolbar/index.js +2 -3
- package/lib/toolbar/types.d.ts +43 -0
- package/lib/tooltip/index.d.ts +6 -0
- package/lib/tooltip/types.d.ts +16 -0
- package/lib/treeview/Header.d.ts +7 -0
- package/lib/treeview/Node.d.ts +7 -0
- package/lib/treeview/Node.js +30 -18
- package/lib/treeview/constants.d.ts +7 -0
- package/lib/treeview/constants.js +0 -1
- package/lib/treeview/index.d.ts +9 -0
- package/lib/treeview/index.js +28 -21
- package/lib/treeview/types.d.ts +104 -0
- package/lib/types-3c6f1c20.d.ts +46 -0
- package/lib/uitour/helpers.d.ts +8 -0
- package/lib/uitour/index.d.ts +6 -0
- package/lib/uitour/index.js +11 -28
- package/lib/uitour/types.d.ts +30 -0
- package/lib/uitour/types.js +5 -0
- package/package.json +15 -5
- package/tsconfig.json +24 -9
- package/tsup.config.ts +10 -0
- package/images.d.ts +0 -3
- package/lib/alerts/alert.spec.js +0 -137
- package/lib/assets/styles/treetable.scss +0 -100
- package/lib/avatar/avatar.spec.js +0 -192
- package/lib/badge/badge.spec.js +0 -127
- package/lib/buttons/buttons.spec.js +0 -504
- package/lib/calendar/calendar.spec.js +0 -173
- package/lib/checkbox/checkbox.spec.js +0 -216
- package/lib/dialog/dialog.spec.js +0 -492
- package/lib/drawer/Drawer.spec.js +0 -261
- package/lib/dropdown/dropdown.spec.js +0 -181
- package/lib/fieldset/fieldset.spec.js +0 -329
- package/lib/form/form.spec.js +0 -295
- package/lib/gridlayout/gridLayout.spec.js +0 -169
- package/lib/icons/icons.spec.js +0 -86
- package/lib/inputs/base/base.spec.js +0 -691
- package/lib/inputs/color/color_input.spec.js +0 -174
- package/lib/inputs/date/date.spec.js +0 -352
- package/lib/inputs/mask/input_mask.spec.js +0 -584
- package/lib/inputs/number/numberfield.spec.js +0 -216
- package/lib/inputs/search/search_input.spec.js +0 -215
- package/lib/inputs/select/select.spec.js +0 -408
- package/lib/inputs/text/textfield.spec.js +0 -215
- package/lib/inputs/textarea/textarea.spec.js +0 -59
- package/lib/labelMessages/labelMessages.spec.js +0 -176
- package/lib/labels/label.spec.js +0 -162
- package/lib/list/list.spec.js +0 -739
- package/lib/menus/float/float-menu.spec.js +0 -227
- package/lib/menus/sidenav/sidenav.spec.js +0 -383
- package/lib/panel/panel.spec.js +0 -216
- package/lib/popover/popover.spec.js +0 -146
- package/lib/progress/progress.spec.js +0 -94
- package/lib/radio/radio.spec.js +0 -191
- package/lib/spinner/spinner.spec.js +0 -156
- package/lib/split/split.spec.js +0 -168
- package/lib/table/table.spec.js +0 -353
- package/lib/tabs/tabs.spec.js +0 -314
- package/lib/toolbar/toolbar.spec.js +0 -394
- package/lib/tooltip/tooltip.spec.js +0 -222
- package/lib/treetable/Body.js +0 -64
- package/lib/treetable/Header.js +0 -37
- package/lib/treetable/Row.js +0 -317
- package/lib/treetable/helpers.js +0 -51
- package/lib/treetable/index.js +0 -35
- package/lib/treeview/treeview.spec.js +0 -289
- package/lib/uitour/uitour.spec.js +0 -176
|
@@ -1,261 +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
|
-
|
|
5
|
-
var _react = _interopRequireDefault(require("react"));
|
|
6
|
-
|
|
7
|
-
var _react2 = require("@testing-library/react");
|
|
8
|
-
|
|
9
|
-
require("@testing-library/jest-dom/extend-expect");
|
|
10
|
-
|
|
11
|
-
require("babel-polyfill");
|
|
12
|
-
|
|
13
|
-
var _ = _interopRequireWildcard(require("."));
|
|
14
|
-
|
|
15
|
-
var _icons = _interopRequireDefault(require("../icons"));
|
|
16
|
-
|
|
17
|
-
var _avatar = _interopRequireDefault(require("../avatar"));
|
|
18
|
-
|
|
19
|
-
var _storageMock = _interopRequireWildcard(require("../../../config/jest/storageMock"));
|
|
20
|
-
|
|
21
|
-
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); }
|
|
22
|
-
|
|
23
|
-
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; }
|
|
24
|
-
|
|
25
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
26
|
-
|
|
27
|
-
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; }
|
|
28
|
-
|
|
29
|
-
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); } }
|
|
30
|
-
|
|
31
|
-
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); }); }; }
|
|
32
|
-
|
|
33
|
-
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); }
|
|
34
|
-
|
|
35
|
-
var drawerMock = function drawerMock(drawerProps, drawerHeaderProps) {
|
|
36
|
-
return /*#__PURE__*/_react.default.createElement(_.default, _extends({
|
|
37
|
-
position: "right",
|
|
38
|
-
customClass: "customMockClass",
|
|
39
|
-
customClassForContent: "CustomContentMockClass",
|
|
40
|
-
style: {
|
|
41
|
-
backgroundColor: '#FFF'
|
|
42
|
-
},
|
|
43
|
-
overlay: true,
|
|
44
|
-
handlerClose: function handlerClose() {}
|
|
45
|
-
}, drawerProps), /*#__PURE__*/_react.default.createElement(_.DrawerHeader, _extends({
|
|
46
|
-
title: "Header Test",
|
|
47
|
-
subTitle: "Subtitle test",
|
|
48
|
-
titleIcon: "user",
|
|
49
|
-
customClass: "customMockHeaderClass",
|
|
50
|
-
showCloseButton: true
|
|
51
|
-
}, drawerHeaderProps)), /*#__PURE__*/_react.default.createElement(_.DrawerContent, {
|
|
52
|
-
style: {
|
|
53
|
-
background: '#333',
|
|
54
|
-
marginTop: 10
|
|
55
|
-
}
|
|
56
|
-
}, "DrawerContent", /*#__PURE__*/_react.default.createElement(_avatar.default, null)));
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
describe('Drawer', function () {
|
|
60
|
-
describe('Drawer Container', function () {
|
|
61
|
-
var DrawerTestId = 'drawercontainer-component';
|
|
62
|
-
var DrawerContentTestId = 'drawercontent';
|
|
63
|
-
it('should render the drawer component with children', function () {
|
|
64
|
-
var _render = (0, _react2.render)(drawerMock({}, {})),
|
|
65
|
-
getByTestId = _render.getByTestId;
|
|
66
|
-
|
|
67
|
-
expect(getByTestId(DrawerTestId)).toHaveTextContent('DrawerContent');
|
|
68
|
-
});
|
|
69
|
-
it('should change the position of Drawer', function () {
|
|
70
|
-
var _render2 = (0, _react2.render)(drawerMock({}, {})),
|
|
71
|
-
getByTestId = _render2.getByTestId;
|
|
72
|
-
|
|
73
|
-
expect(getByTestId(DrawerTestId)).toHaveClass('right');
|
|
74
|
-
});
|
|
75
|
-
it('should apply customClass', function () {
|
|
76
|
-
var _render3 = (0, _react2.render)(drawerMock({}, {})),
|
|
77
|
-
getByTestId = _render3.getByTestId;
|
|
78
|
-
|
|
79
|
-
expect(getByTestId(DrawerTestId)).toHaveClass('customMockClass');
|
|
80
|
-
});
|
|
81
|
-
it('should apply customClassContent', function () {
|
|
82
|
-
var _render4 = (0, _react2.render)(drawerMock({}, {})),
|
|
83
|
-
getByTestId = _render4.getByTestId;
|
|
84
|
-
|
|
85
|
-
expect(getByTestId(DrawerContentTestId)).toHaveClass('CustomContentMockClass');
|
|
86
|
-
});
|
|
87
|
-
it('should apply inline style', function () {
|
|
88
|
-
var _render5 = (0, _react2.render)(drawerMock({}, {})),
|
|
89
|
-
getByTestId = _render5.getByTestId;
|
|
90
|
-
|
|
91
|
-
expect(getByTestId(DrawerTestId)).toHaveStyle('background-color: #FFF');
|
|
92
|
-
});
|
|
93
|
-
it('should render overlay over the page', function () {
|
|
94
|
-
(0, _react2.render)(drawerMock({}, {}));
|
|
95
|
-
expect(_react2.screen.getByTestId('drawer-overlay')).toBeInTheDocument();
|
|
96
|
-
});
|
|
97
|
-
it('should close the Drawer when press Escape', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
98
|
-
var mockHandlerClose, _render6, container;
|
|
99
|
-
|
|
100
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
101
|
-
while (1) {
|
|
102
|
-
switch (_context.prev = _context.next) {
|
|
103
|
-
case 0:
|
|
104
|
-
mockHandlerClose = jest.fn();
|
|
105
|
-
_render6 = (0, _react2.render)(drawerMock({
|
|
106
|
-
handlerClose: mockHandlerClose,
|
|
107
|
-
closeOnEsc: true
|
|
108
|
-
}, {})), container = _render6.container;
|
|
109
|
-
|
|
110
|
-
_react2.fireEvent.keyUp(container, {
|
|
111
|
-
key: 'Escape',
|
|
112
|
-
code: 'Escape',
|
|
113
|
-
keyCode: 27,
|
|
114
|
-
charCode: 27
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
expect(mockHandlerClose).toHaveBeenCalled();
|
|
118
|
-
|
|
119
|
-
case 4:
|
|
120
|
-
case "end":
|
|
121
|
-
return _context.stop();
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
}, _callee);
|
|
125
|
-
})));
|
|
126
|
-
});
|
|
127
|
-
describe('Drawer Header', function () {
|
|
128
|
-
var CloseButtonTestId = 'header-closebutton';
|
|
129
|
-
var mockHandlerClose = jest.fn();
|
|
130
|
-
|
|
131
|
-
var mockImage = /*#__PURE__*/_react.default.createElement("img", {
|
|
132
|
-
src: "https://devfront.erplinear.com.br/auth/static/media/auth_bg.96d98c39.jpg",
|
|
133
|
-
alt: "imagem teste"
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
var DrawerHeaderMock = drawerMock({
|
|
137
|
-
handlerClose: mockHandlerClose
|
|
138
|
-
}, {});
|
|
139
|
-
it('should renders correctly DrawerHeader', function () {
|
|
140
|
-
var _render7 = (0, _react2.render)(DrawerHeaderMock),
|
|
141
|
-
getByText = _render7.getByText;
|
|
142
|
-
|
|
143
|
-
expect(getByText('Header Test')).toBeInTheDocument();
|
|
144
|
-
});
|
|
145
|
-
it('should render titleContent', function () {
|
|
146
|
-
var _render8 = (0, _react2.render)(drawerMock({}, {
|
|
147
|
-
titleContent: mockImage
|
|
148
|
-
})),
|
|
149
|
-
getByAltText = _render8.getByAltText;
|
|
150
|
-
|
|
151
|
-
expect(getByAltText('imagem teste')).toBeInTheDocument();
|
|
152
|
-
});
|
|
153
|
-
it('should render titleRightContent', function () {
|
|
154
|
-
var _render9 = (0, _react2.render)(drawerMock({}, {
|
|
155
|
-
titleRightContent: mockImage
|
|
156
|
-
})),
|
|
157
|
-
getByAltText = _render9.getByAltText;
|
|
158
|
-
|
|
159
|
-
expect(getByAltText('imagem teste')).toBeInTheDocument();
|
|
160
|
-
});
|
|
161
|
-
it('should render subtitle', function () {
|
|
162
|
-
var _render10 = (0, _react2.render)(DrawerHeaderMock),
|
|
163
|
-
getByText = _render10.getByText;
|
|
164
|
-
|
|
165
|
-
expect(getByText('Subtitle test')).toBeInTheDocument();
|
|
166
|
-
});
|
|
167
|
-
it('should render subTitleContent', function () {
|
|
168
|
-
var _render11 = (0, _react2.render)(drawerMock({}, {
|
|
169
|
-
subTitleContent: mockImage
|
|
170
|
-
})),
|
|
171
|
-
getByAltText = _render11.getByAltText;
|
|
172
|
-
|
|
173
|
-
expect(getByAltText('imagem teste')).toBeInTheDocument();
|
|
174
|
-
});
|
|
175
|
-
it('should render title icon', function () {
|
|
176
|
-
var _render12 = (0, _react2.render)(DrawerHeaderMock),
|
|
177
|
-
getByTestId = _render12.getByTestId;
|
|
178
|
-
|
|
179
|
-
expect(getByTestId('icon-header')).toBeInTheDocument();
|
|
180
|
-
expect(getByTestId('icon-header')).toHaveClass('icon-header');
|
|
181
|
-
});
|
|
182
|
-
it('should render icon', function () {
|
|
183
|
-
var _render13 = (0, _react2.render)(drawerMock({}, {
|
|
184
|
-
icon: /*#__PURE__*/_react.default.createElement(_icons.default, {
|
|
185
|
-
name: "user"
|
|
186
|
-
}),
|
|
187
|
-
showCloseButton: true
|
|
188
|
-
})),
|
|
189
|
-
getByTestId = _render13.getByTestId;
|
|
190
|
-
|
|
191
|
-
expect(getByTestId('icon-header')).toBeInTheDocument();
|
|
192
|
-
expect(getByTestId('icon-header')).toHaveClass('icon-header');
|
|
193
|
-
});
|
|
194
|
-
it('should render close button', function () {
|
|
195
|
-
var _render14 = (0, _react2.render)(DrawerHeaderMock),
|
|
196
|
-
getByTestId = _render14.getByTestId;
|
|
197
|
-
|
|
198
|
-
expect(getByTestId(CloseButtonTestId)).toBeInTheDocument();
|
|
199
|
-
expect(getByTestId(CloseButtonTestId)).toHaveClass('closebutton');
|
|
200
|
-
});
|
|
201
|
-
it('should fire click in close button', function () {
|
|
202
|
-
var _render15 = (0, _react2.render)(DrawerHeaderMock),
|
|
203
|
-
getByTestId = _render15.getByTestId;
|
|
204
|
-
|
|
205
|
-
_react2.fireEvent.click(getByTestId(CloseButtonTestId));
|
|
206
|
-
|
|
207
|
-
expect(mockHandlerClose).toHaveBeenCalledTimes(1);
|
|
208
|
-
});
|
|
209
|
-
it('should apply customClass', function () {
|
|
210
|
-
var _render16 = (0, _react2.render)(DrawerHeaderMock),
|
|
211
|
-
getByTestId = _render16.getByTestId;
|
|
212
|
-
|
|
213
|
-
expect(getByTestId('drawerheader')).toHaveClass('customMockHeaderClass');
|
|
214
|
-
});
|
|
215
|
-
});
|
|
216
|
-
describe('Drawer Content', function () {
|
|
217
|
-
it('should DrawerContent renders correctly', function () {
|
|
218
|
-
var _render17 = (0, _react2.render)(drawerMock({}, {})),
|
|
219
|
-
getByText = _render17.getByText,
|
|
220
|
-
getByTestId = _render17.getByTestId;
|
|
221
|
-
|
|
222
|
-
expect(getByText('DrawerContent')).toBeInTheDocument();
|
|
223
|
-
expect(getByTestId('avatar')).toBeInTheDocument();
|
|
224
|
-
});
|
|
225
|
-
it('should apply inline style', function () {
|
|
226
|
-
var _render18 = (0, _react2.render)(drawerMock({}, {})),
|
|
227
|
-
getByText = _render18.getByText;
|
|
228
|
-
|
|
229
|
-
expect(getByText('DrawerContent')).toHaveStyle('background-color: #333; margin-top: 10px;');
|
|
230
|
-
});
|
|
231
|
-
});
|
|
232
|
-
describe('Permissions', function () {
|
|
233
|
-
var defineStorageMock = function defineStorageMock() {
|
|
234
|
-
Object.defineProperty(window, 'sessionStorage', {
|
|
235
|
-
value: (0, _storageMock.default)()
|
|
236
|
-
});
|
|
237
|
-
};
|
|
238
|
-
|
|
239
|
-
it('should check permission', function () {
|
|
240
|
-
defineStorageMock();
|
|
241
|
-
|
|
242
|
-
var _render19 = (0, _react2.render)(drawerMock({
|
|
243
|
-
permissionAttr: (0, _storageMock.permissionAttrMockAuthorized)('hideContent')
|
|
244
|
-
}, {})),
|
|
245
|
-
container = _render19.container;
|
|
246
|
-
|
|
247
|
-
expect(container.querySelector('.no-permission-component')).not.toBeInTheDocument();
|
|
248
|
-
});
|
|
249
|
-
it('should render non-permission', function () {
|
|
250
|
-
defineStorageMock();
|
|
251
|
-
|
|
252
|
-
var _render20 = (0, _react2.render)(drawerMock({
|
|
253
|
-
permissionAttr: (0, _storageMock.permissionAttrMockUnauthorized)('hideContent')
|
|
254
|
-
}, {})),
|
|
255
|
-
getByText = _render20.getByText;
|
|
256
|
-
|
|
257
|
-
expect(getByText('Acesso Negado')).toBeInTheDocument();
|
|
258
|
-
expect(getByText('Você não tem permissão para acessar este conteúdo. Consulte o Administrador do sistema!')).toBeInTheDocument();
|
|
259
|
-
});
|
|
260
|
-
});
|
|
261
|
-
});
|
|
@@ -1,181 +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
|
-
|
|
5
|
-
var _react = require("@testing-library/react");
|
|
6
|
-
|
|
7
|
-
var _react2 = _interopRequireWildcard(require("react"));
|
|
8
|
-
|
|
9
|
-
require("babel-polyfill");
|
|
10
|
-
|
|
11
|
-
var _withDropdown = _interopRequireDefault(require("./withDropdown"));
|
|
12
|
-
|
|
13
|
-
var _excluded = ["dropdown"];
|
|
14
|
-
|
|
15
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
-
|
|
17
|
-
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); }
|
|
18
|
-
|
|
19
|
-
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; }
|
|
20
|
-
|
|
21
|
-
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; }
|
|
22
|
-
|
|
23
|
-
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); } }
|
|
24
|
-
|
|
25
|
-
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); }); }; }
|
|
26
|
-
|
|
27
|
-
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); }
|
|
28
|
-
|
|
29
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
30
|
-
|
|
31
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
32
|
-
|
|
33
|
-
var WrappedComponent = function WrappedComponent(_ref) {
|
|
34
|
-
var getDropdownPopup = _ref.getDropdownPopup,
|
|
35
|
-
showDropdown = _ref.showDropdown;
|
|
36
|
-
var btnRef = (0, _react2.useRef)(null);
|
|
37
|
-
return /*#__PURE__*/_react2.default.createElement(_react2.Fragment, null, /*#__PURE__*/_react2.default.createElement("button", {
|
|
38
|
-
ref: btnRef,
|
|
39
|
-
onClick: function onClick() {
|
|
40
|
-
return showDropdown && showDropdown();
|
|
41
|
-
}
|
|
42
|
-
}, "OPEN"), getDropdownPopup && getDropdownPopup(btnRef.current));
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
var DropdownTest = (0, _withDropdown.default)(WrappedComponent);
|
|
46
|
-
|
|
47
|
-
var renderDropdownTestMock = function renderDropdownTestMock(_ref2) {
|
|
48
|
-
var dropdown = _ref2.dropdown,
|
|
49
|
-
props = _objectWithoutProperties(_ref2, _excluded);
|
|
50
|
-
|
|
51
|
-
return /*#__PURE__*/_react2.default.createElement(DropdownTest, _extends({
|
|
52
|
-
dropdown: true
|
|
53
|
-
}, props), /*#__PURE__*/_react2.default.createElement("div", null, "DROP_DOWN_CONTENT"));
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
describe('withDropdown', function () {
|
|
57
|
-
describe('Default', function () {
|
|
58
|
-
it('should render dropdown', function () {
|
|
59
|
-
var _render = (0, _react.render)(renderDropdownTestMock({})),
|
|
60
|
-
container = _render.container,
|
|
61
|
-
getByTestId = _render.getByTestId,
|
|
62
|
-
getByText = _render.getByText;
|
|
63
|
-
|
|
64
|
-
_react.fireEvent.click(container.firstChild);
|
|
65
|
-
|
|
66
|
-
expect(getByTestId('dropdown-component')).toBeInTheDocument();
|
|
67
|
-
expect(getByText('DROP_DOWN_CONTENT')).toBeInTheDocument();
|
|
68
|
-
});
|
|
69
|
-
it('should apply customClass in dropdown', function () {
|
|
70
|
-
var _render2 = (0, _react.render)(renderDropdownTestMock({
|
|
71
|
-
customClassForDropdown: 'customClass'
|
|
72
|
-
})),
|
|
73
|
-
container = _render2.container,
|
|
74
|
-
getByTestId = _render2.getByTestId;
|
|
75
|
-
|
|
76
|
-
_react.fireEvent.click(container.firstChild);
|
|
77
|
-
|
|
78
|
-
expect(getByTestId('dropdown-component')).toBeInTheDocument();
|
|
79
|
-
expect(getByTestId('dropdown-component')).toHaveClass('customClass');
|
|
80
|
-
});
|
|
81
|
-
it('should control dropdown open with dropdownOpened prop', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
82
|
-
var _render3, rerender, getByTestId;
|
|
83
|
-
|
|
84
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
85
|
-
while (1) {
|
|
86
|
-
switch (_context.prev = _context.next) {
|
|
87
|
-
case 0:
|
|
88
|
-
_render3 = (0, _react.render)(renderDropdownTestMock({})), rerender = _render3.rerender, getByTestId = _render3.getByTestId;
|
|
89
|
-
rerender(renderDropdownTestMock({
|
|
90
|
-
dropdownOpened: true
|
|
91
|
-
}));
|
|
92
|
-
_context.next = 4;
|
|
93
|
-
return (0, _react.waitFor)(function () {
|
|
94
|
-
return expect(getByTestId('dropdown-component')).toBeInTheDocument();
|
|
95
|
-
}, {
|
|
96
|
-
timeout: 3000
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
case 4:
|
|
100
|
-
case "end":
|
|
101
|
-
return _context.stop();
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
}, _callee);
|
|
105
|
-
})));
|
|
106
|
-
it('should closeDropdownOnClickOutside', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
107
|
-
var _render4, getByText, queryByTestId;
|
|
108
|
-
|
|
109
|
-
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
110
|
-
while (1) {
|
|
111
|
-
switch (_context2.prev = _context2.next) {
|
|
112
|
-
case 0:
|
|
113
|
-
_render4 = (0, _react.render)( /*#__PURE__*/_react2.default.createElement("div", null, /*#__PURE__*/_react2.default.createElement("p", null, "OUTSIDE_CLICK"), renderDropdownTestMock({}))), getByText = _render4.getByText, queryByTestId = _render4.queryByTestId;
|
|
114
|
-
|
|
115
|
-
_react.fireEvent.click(getByText('OPEN'));
|
|
116
|
-
|
|
117
|
-
_context2.next = 4;
|
|
118
|
-
return (0, _react.waitFor)(function () {
|
|
119
|
-
return expect(queryByTestId('dropdown-component')).toBeInTheDocument();
|
|
120
|
-
}, {
|
|
121
|
-
timeout: 3000
|
|
122
|
-
});
|
|
123
|
-
|
|
124
|
-
case 4:
|
|
125
|
-
_react.fireEvent.click(getByText('OUTSIDE_CLICK'));
|
|
126
|
-
|
|
127
|
-
_context2.next = 7;
|
|
128
|
-
return (0, _react.waitFor)(function () {
|
|
129
|
-
return expect(queryByTestId('dropdown-component')).not.toBeInTheDocument();
|
|
130
|
-
}, {
|
|
131
|
-
timeout: 3000
|
|
132
|
-
});
|
|
133
|
-
|
|
134
|
-
case 7:
|
|
135
|
-
case "end":
|
|
136
|
-
return _context2.stop();
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
}, _callee2);
|
|
140
|
-
})));
|
|
141
|
-
it('should not closeDropdownOnClickOutside', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
142
|
-
var _render5, getByText, queryByTestId;
|
|
143
|
-
|
|
144
|
-
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
145
|
-
while (1) {
|
|
146
|
-
switch (_context3.prev = _context3.next) {
|
|
147
|
-
case 0:
|
|
148
|
-
// eslint-disable-next-line function-paren-newline
|
|
149
|
-
_render5 = (0, _react.render)( /*#__PURE__*/_react2.default.createElement("div", null, /*#__PURE__*/_react2.default.createElement("p", null, "OUTSIDE_CLICK"), renderDropdownTestMock({
|
|
150
|
-
closeDropdownOnClickOutside: false
|
|
151
|
-
})) // eslint-disable-next-line function-paren-newline
|
|
152
|
-
), getByText = _render5.getByText, queryByTestId = _render5.queryByTestId;
|
|
153
|
-
|
|
154
|
-
_react.fireEvent.click(getByText('OPEN'));
|
|
155
|
-
|
|
156
|
-
_context3.next = 4;
|
|
157
|
-
return (0, _react.waitFor)(function () {
|
|
158
|
-
return expect(queryByTestId('dropdown-component')).toBeInTheDocument();
|
|
159
|
-
}, {
|
|
160
|
-
timeout: 3000
|
|
161
|
-
});
|
|
162
|
-
|
|
163
|
-
case 4:
|
|
164
|
-
_react.fireEvent.click(getByText('OUTSIDE_CLICK'));
|
|
165
|
-
|
|
166
|
-
_context3.next = 7;
|
|
167
|
-
return (0, _react.waitFor)(function () {
|
|
168
|
-
return expect(queryByTestId('dropdown-component')).toBeInTheDocument();
|
|
169
|
-
}, {
|
|
170
|
-
timeout: 3000
|
|
171
|
-
});
|
|
172
|
-
|
|
173
|
-
case 7:
|
|
174
|
-
case "end":
|
|
175
|
-
return _context3.stop();
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
}, _callee3);
|
|
179
|
-
})));
|
|
180
|
-
});
|
|
181
|
-
});
|