@dxc-technology/halstack-react 0.0.0-509f1eb → 0.0.0-50acff4
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/BackgroundColorContext.js +1 -1
- package/HalstackContext.d.ts +31 -20
- package/HalstackContext.js +6 -6
- package/accordion/Accordion.accessibility.test.d.ts +1 -0
- package/accordion/Accordion.accessibility.test.js +71 -0
- package/accordion/Accordion.js +17 -31
- package/accordion/Accordion.stories.tsx +7 -49
- package/accordion/Accordion.test.d.ts +1 -0
- package/accordion/Accordion.test.js +3 -3
- package/accordion/types.d.ts +1 -1
- package/accordion-group/AccordionGroup.accessibility.test.d.ts +1 -0
- package/accordion-group/AccordionGroup.accessibility.test.js +82 -0
- package/accordion-group/AccordionGroup.d.ts +2 -3
- package/accordion-group/AccordionGroup.js +4 -4
- package/accordion-group/AccordionGroup.stories.tsx +23 -23
- package/accordion-group/AccordionGroup.test.d.ts +1 -0
- package/accordion-group/AccordionGroup.test.js +5 -9
- package/accordion-group/AccordionGroupAccordion.js +3 -3
- package/accordion-group/AccordionGroupContext.d.ts +3 -0
- package/accordion-group/AccordionGroupContext.js +8 -0
- package/accordion-group/types.d.ts +1 -1
- package/action-icon/ActionIcon.accessibility.test.d.ts +1 -0
- package/action-icon/ActionIcon.accessibility.test.js +63 -0
- package/action-icon/ActionIcon.d.ts +2 -2
- package/action-icon/ActionIcon.js +11 -6
- package/action-icon/ActionIcon.stories.tsx +41 -0
- package/action-icon/ActionIcon.test.d.ts +1 -0
- package/action-icon/ActionIcon.test.js +64 -0
- package/action-icon/types.d.ts +1 -1
- package/alert/Alert.accessibility.test.d.ts +1 -0
- package/alert/Alert.accessibility.test.js +95 -0
- package/alert/Alert.js +21 -72
- package/alert/Alert.test.d.ts +1 -0
- package/alert/Alert.test.js +1 -1
- package/badge/Badge.accessibility.test.d.ts +1 -0
- package/badge/Badge.accessibility.test.js +129 -0
- package/badge/Badge.d.ts +1 -1
- package/badge/Badge.js +141 -28
- package/badge/Badge.stories.tsx +210 -0
- package/badge/Badge.test.d.ts +1 -0
- package/badge/Badge.test.js +30 -0
- package/badge/types.d.ts +52 -3
- package/box/Box.accessibility.test.d.ts +1 -0
- package/box/Box.accessibility.test.js +33 -0
- package/box/Box.js +1 -1
- package/box/Box.test.d.ts +1 -0
- package/box/Box.test.js +1 -1
- package/breadcrumbs/Breadcrumbs.accessibility.test.d.ts +1 -0
- package/breadcrumbs/Breadcrumbs.accessibility.test.js +96 -0
- package/breadcrumbs/Breadcrumbs.d.ts +4 -0
- package/breadcrumbs/Breadcrumbs.js +79 -0
- package/breadcrumbs/Breadcrumbs.stories.tsx +194 -0
- package/breadcrumbs/Breadcrumbs.test.d.ts +1 -0
- package/breadcrumbs/Breadcrumbs.test.js +168 -0
- package/breadcrumbs/Item.d.ts +4 -0
- package/breadcrumbs/Item.js +52 -0
- package/breadcrumbs/dropdownTheme.d.ts +53 -0
- package/breadcrumbs/dropdownTheme.js +62 -0
- package/breadcrumbs/types.d.ts +16 -0
- package/breadcrumbs/types.js +5 -0
- package/bulleted-list/BulletedList.accessibility.test.d.ts +1 -0
- package/bulleted-list/BulletedList.accessibility.test.js +119 -0
- package/bulleted-list/BulletedList.js +7 -4
- package/bulleted-list/BulletedList.stories.tsx +1 -1
- package/button/Button.accessibility.test.d.ts +1 -0
- package/button/Button.accessibility.test.js +127 -0
- package/button/Button.js +5 -4
- package/button/Button.stories.tsx +34 -53
- package/button/Button.test.d.ts +1 -0
- package/button/Button.test.js +4 -2
- package/button/types.d.ts +1 -1
- package/card/Card.accessibility.test.d.ts +1 -0
- package/card/Card.accessibility.test.js +36 -0
- package/card/Card.js +3 -2
- package/card/Card.stories.tsx +1 -1
- package/card/Card.test.d.ts +1 -0
- package/card/Card.test.js +1 -1
- package/checkbox/Checkbox.accessibility.test.d.ts +1 -0
- package/checkbox/Checkbox.accessibility.test.js +87 -0
- package/checkbox/Checkbox.js +10 -13
- package/checkbox/Checkbox.test.d.ts +1 -0
- package/checkbox/Checkbox.test.js +1 -1
- package/chip/Chip.accessibility.test.d.ts +1 -0
- package/chip/Chip.accessibility.test.js +67 -0
- package/chip/Chip.js +11 -6
- package/chip/Chip.stories.tsx +6 -25
- package/chip/Chip.test.d.ts +1 -0
- package/chip/Chip.test.js +5 -5
- package/common/coreTokens.js +4 -4
- package/common/variables.d.ts +31 -20
- package/common/variables.js +101 -90
- package/container/Container.js +1 -1
- package/container/Container.stories.tsx +3 -3
- package/contextual-menu/ContextualMenu.accessibility.test.d.ts +1 -0
- package/contextual-menu/ContextualMenu.accessibility.test.js +98 -0
- package/contextual-menu/ContextualMenu.d.ts +5 -0
- package/contextual-menu/ContextualMenu.js +108 -0
- package/contextual-menu/ContextualMenu.stories.tsx +223 -0
- package/contextual-menu/ContextualMenu.test.d.ts +1 -0
- package/contextual-menu/ContextualMenu.test.js +247 -0
- package/contextual-menu/GroupItem.d.ts +4 -0
- package/contextual-menu/GroupItem.js +67 -0
- package/contextual-menu/ItemAction.d.ts +4 -0
- package/contextual-menu/ItemAction.js +50 -0
- package/contextual-menu/MenuItem.d.ts +4 -0
- package/contextual-menu/MenuItem.js +29 -0
- package/contextual-menu/SingleItem.d.ts +4 -0
- package/contextual-menu/SingleItem.js +38 -0
- package/contextual-menu/types.d.ts +61 -0
- package/contextual-menu/types.js +5 -0
- package/date-input/Calendar.js +47 -31
- package/date-input/DateInput.accessibility.test.d.ts +1 -0
- package/date-input/DateInput.accessibility.test.js +229 -0
- package/date-input/DateInput.js +28 -23
- package/date-input/DateInput.stories.tsx +18 -12
- package/date-input/DateInput.test.d.ts +1 -0
- package/date-input/DateInput.test.js +39 -39
- package/date-input/DatePicker.js +13 -7
- package/date-input/YearPicker.js +10 -5
- package/date-input/types.d.ts +2 -2
- package/dialog/Dialog.accessibility.test.d.ts +1 -0
- package/dialog/Dialog.accessibility.test.js +69 -0
- package/dialog/Dialog.js +9 -20
- package/dialog/Dialog.stories.tsx +8 -4
- package/dialog/Dialog.test.d.ts +1 -0
- package/dialog/Dialog.test.js +112 -49
- package/divider/Divider.accessibility.test.d.ts +1 -0
- package/divider/Divider.accessibility.test.js +33 -0
- package/divider/Divider.d.ts +4 -0
- package/divider/Divider.js +36 -0
- package/divider/Divider.stories.tsx +223 -0
- package/divider/Divider.test.d.ts +1 -0
- package/divider/Divider.test.js +38 -0
- package/divider/types.d.ts +21 -0
- package/divider/types.js +5 -0
- package/dropdown/Dropdown.accessibility.test.d.ts +1 -0
- package/dropdown/Dropdown.accessibility.test.js +183 -0
- package/dropdown/Dropdown.js +37 -51
- package/dropdown/Dropdown.stories.tsx +16 -27
- package/dropdown/Dropdown.test.d.ts +1 -0
- package/dropdown/Dropdown.test.js +101 -72
- package/dropdown/DropdownMenu.js +4 -4
- package/dropdown/DropdownMenuItem.js +8 -4
- package/dropdown/types.d.ts +3 -5
- package/file-input/FileInput.accessibility.test.d.ts +1 -0
- package/file-input/FileInput.accessibility.test.js +167 -0
- package/file-input/FileInput.js +6 -47
- package/file-input/FileInput.test.d.ts +1 -0
- package/file-input/FileInput.test.js +51 -106
- package/file-input/FileItem.js +18 -28
- package/file-input/types.d.ts +0 -4
- package/footer/Footer.accessibility.test.d.ts +1 -0
- package/footer/Footer.accessibility.test.js +125 -0
- package/footer/Footer.d.ts +1 -1
- package/footer/Footer.js +31 -16
- package/footer/Footer.stories.tsx +58 -2
- package/footer/Footer.test.d.ts +1 -0
- package/footer/Footer.test.js +1 -1
- package/footer/Icons.d.ts +1 -0
- package/footer/Icons.js +52 -16
- package/footer/types.d.ts +7 -1
- package/grid/Grid.stories.tsx +3 -1
- package/header/Header.accessibility.test.d.ts +1 -0
- package/header/Header.accessibility.test.js +94 -0
- package/header/Header.js +12 -22
- package/header/Header.stories.tsx +17 -1
- package/header/Header.test.d.ts +1 -0
- package/header/Header.test.js +1 -1
- package/header/Icons.js +1 -6
- package/header/types.d.ts +2 -2
- package/heading/Heading.accessibility.test.d.ts +1 -0
- package/heading/Heading.accessibility.test.js +33 -0
- package/heading/Heading.js +1 -1
- package/heading/Heading.test.d.ts +1 -0
- package/heading/Heading.test.js +1 -14
- package/icon/Icon.accessibility.test.d.ts +1 -0
- package/icon/Icon.accessibility.test.js +30 -0
- package/icon/Icon.d.ts +4 -0
- package/icon/Icon.js +33 -0
- package/icon/Icon.stories.tsx +28 -0
- package/icon/types.d.ts +4 -0
- package/icon/types.js +5 -0
- package/image/Image.accessibility.test.d.ts +1 -0
- package/image/Image.accessibility.test.js +56 -0
- package/image/Image.js +1 -1
- package/image/Image.stories.tsx +3 -1
- package/layout/ApplicationLayout.d.ts +1 -1
- package/layout/ApplicationLayout.js +10 -7
- package/layout/Icons.d.ts +0 -1
- package/layout/Icons.js +1 -11
- package/link/Link.accessibility.test.d.ts +1 -0
- package/link/Link.accessibility.test.js +108 -0
- package/link/Link.js +8 -6
- package/link/Link.stories.tsx +4 -4
- package/link/Link.test.d.ts +1 -0
- package/link/Link.test.js +1 -1
- package/link/types.d.ts +1 -1
- package/main.d.ts +6 -2
- package/main.js +30 -2
- package/nav-tabs/NavTabs.accessibility.test.d.ts +1 -0
- package/nav-tabs/NavTabs.accessibility.test.js +44 -0
- package/nav-tabs/NavTabs.d.ts +1 -2
- package/nav-tabs/NavTabs.js +22 -7
- package/nav-tabs/NavTabs.stories.tsx +44 -24
- package/nav-tabs/NavTabs.test.d.ts +1 -0
- package/nav-tabs/NavTabs.test.js +12 -10
- package/nav-tabs/NavTabsContext.d.ts +3 -0
- package/nav-tabs/NavTabsContext.js +8 -0
- package/nav-tabs/Tab.js +23 -23
- package/nav-tabs/types.d.ts +1 -1
- package/number-input/NumberInput.accessibility.test.d.ts +1 -0
- package/number-input/NumberInput.accessibility.test.js +227 -0
- package/number-input/NumberInput.d.ts +0 -7
- package/number-input/NumberInput.js +28 -6
- package/number-input/NumberInput.stories.tsx +11 -16
- package/number-input/NumberInput.test.d.ts +1 -0
- package/number-input/NumberInput.test.js +167 -9
- package/number-input/NumberInputContext.d.ts +3 -0
- package/number-input/NumberInputContext.js +8 -0
- package/number-input/types.d.ts +6 -0
- package/package.json +31 -27
- package/paginator/Paginator.accessibility.test.d.ts +1 -0
- package/paginator/Paginator.accessibility.test.js +78 -0
- package/paginator/Paginator.js +13 -10
- package/paginator/Paginator.test.d.ts +1 -0
- package/paginator/Paginator.test.js +2 -3
- package/paragraph/Paragraph.accessibility.test.d.ts +1 -0
- package/paragraph/Paragraph.accessibility.test.js +28 -0
- package/password-input/PasswordInput.accessibility.test.d.ts +1 -0
- package/password-input/PasswordInput.accessibility.test.js +152 -0
- package/password-input/PasswordInput.js +11 -8
- package/password-input/PasswordInput.stories.tsx +10 -1
- package/password-input/PasswordInput.test.d.ts +1 -0
- package/password-input/PasswordInput.test.js +6 -7
- package/progress-bar/ProgressBar.accessibility.test.d.ts +1 -0
- package/progress-bar/ProgressBar.accessibility.test.js +35 -0
- package/progress-bar/ProgressBar.js +6 -4
- package/progress-bar/ProgressBar.test.d.ts +1 -0
- package/progress-bar/ProgressBar.test.js +1 -1
- package/quick-nav/QuickNav.accessibility.test.d.ts +1 -0
- package/quick-nav/QuickNav.accessibility.test.js +57 -0
- package/quick-nav/QuickNav.js +1 -1
- package/radio-group/Radio.js +6 -9
- package/radio-group/RadioGroup.accessibility.test.d.ts +1 -0
- package/radio-group/RadioGroup.accessibility.test.js +97 -0
- package/radio-group/RadioGroup.js +14 -16
- package/radio-group/RadioGroup.test.d.ts +1 -0
- package/radio-group/RadioGroup.test.js +3 -5
- package/resultset-table/ResultsetTable.accessibility.test.d.ts +1 -0
- package/resultset-table/ResultsetTable.accessibility.test.js +284 -0
- package/resultset-table/ResultsetTable.d.ts +4 -1
- package/resultset-table/ResultsetTable.js +25 -13
- package/resultset-table/ResultsetTable.stories.tsx +119 -6
- package/resultset-table/ResultsetTable.test.d.ts +1 -0
- package/resultset-table/ResultsetTable.test.js +77 -3
- package/resultset-table/types.d.ts +40 -7
- package/select/Listbox.js +24 -16
- package/select/Option.js +12 -10
- package/select/Select.accessibility.test.d.ts +1 -0
- package/select/Select.accessibility.test.js +227 -0
- package/select/Select.js +41 -29
- package/select/Select.stories.tsx +69 -112
- package/select/Select.test.d.ts +1 -0
- package/select/Select.test.js +371 -474
- package/select/types.d.ts +1 -1
- package/sidenav/Sidenav.accessibility.test.d.ts +1 -0
- package/sidenav/Sidenav.accessibility.test.js +59 -0
- package/sidenav/Sidenav.js +19 -14
- package/sidenav/Sidenav.stories.tsx +5 -10
- package/sidenav/Sidenav.test.d.ts +1 -0
- package/sidenav/Sidenav.test.js +1 -1
- package/sidenav/types.d.ts +2 -2
- package/slider/Slider.accessibility.test.d.ts +1 -0
- package/slider/Slider.accessibility.test.js +103 -0
- package/slider/Slider.js +11 -13
- package/slider/Slider.stories.tsx +180 -0
- package/slider/Slider.test.d.ts +1 -0
- package/slider/Slider.test.js +13 -11
- package/spinner/Spinner.accessibility.test.d.ts +1 -0
- package/spinner/Spinner.accessibility.test.js +96 -0
- package/spinner/Spinner.js +6 -2
- package/spinner/Spinner.test.d.ts +1 -0
- package/spinner/Spinner.test.js +1 -1
- package/status-light/StatusLight.accessibility.test.d.ts +1 -0
- package/status-light/StatusLight.accessibility.test.js +157 -0
- package/status-light/StatusLight.d.ts +4 -0
- package/status-light/StatusLight.js +51 -0
- package/status-light/StatusLight.stories.tsx +74 -0
- package/status-light/StatusLight.test.d.ts +1 -0
- package/status-light/StatusLight.test.js +25 -0
- package/status-light/types.d.ts +17 -0
- package/status-light/types.js +5 -0
- package/switch/Switch.accessibility.test.d.ts +1 -0
- package/switch/Switch.accessibility.test.js +98 -0
- package/switch/Switch.js +6 -9
- package/switch/Switch.stories.tsx +12 -0
- package/switch/Switch.test.d.ts +1 -0
- package/switch/Switch.test.js +1 -1
- package/table/DropdownTheme.js +62 -0
- package/table/Table.accessibility.test.d.ts +1 -0
- package/table/Table.accessibility.test.js +92 -0
- package/table/Table.d.ts +6 -2
- package/table/Table.js +74 -9
- package/table/Table.stories.tsx +309 -2
- package/table/Table.test.d.ts +1 -0
- package/table/Table.test.js +91 -1
- package/table/types.d.ts +28 -0
- package/tabs/Tab.js +13 -9
- package/tabs/Tabs.accessibility.test.d.ts +1 -0
- package/tabs/Tabs.accessibility.test.js +56 -0
- package/tabs/Tabs.js +9 -20
- package/tabs/Tabs.stories.tsx +8 -4
- package/tabs/Tabs.test.d.ts +1 -0
- package/tabs/Tabs.test.js +20 -38
- package/tabs/types.d.ts +2 -2
- package/tag/Tag.accessibility.test.d.ts +1 -0
- package/tag/Tag.accessibility.test.js +69 -0
- package/tag/Tag.js +7 -7
- package/tag/Tag.stories.tsx +5 -8
- package/tag/Tag.test.d.ts +1 -0
- package/tag/Tag.test.js +5 -13
- package/tag/types.d.ts +2 -2
- package/text-input/Suggestion.js +1 -1
- package/text-input/Suggestions.js +17 -7
- package/text-input/TextInput.accessibility.test.d.ts +1 -0
- package/text-input/TextInput.accessibility.test.js +320 -0
- package/text-input/TextInput.js +69 -70
- package/text-input/TextInput.stories.tsx +20 -8
- package/text-input/TextInput.test.d.ts +1 -0
- package/text-input/TextInput.test.js +98 -82
- package/textarea/Textarea.accessibility.test.d.ts +1 -0
- package/textarea/Textarea.accessibility.test.js +155 -0
- package/textarea/Textarea.js +14 -13
- package/textarea/Textarea.test.d.ts +1 -0
- package/textarea/Textarea.test.js +1 -1
- package/toggle-group/ToggleGroup.accessibility.test.d.ts +1 -0
- package/toggle-group/ToggleGroup.accessibility.test.js +107 -0
- package/toggle-group/ToggleGroup.js +10 -12
- package/toggle-group/ToggleGroup.stories.tsx +4 -4
- package/toggle-group/ToggleGroup.test.d.ts +1 -0
- package/toggle-group/ToggleGroup.test.js +1 -1
- package/toggle-group/types.d.ts +2 -2
- package/typography/Typography.accessibility.test.d.ts +1 -0
- package/typography/Typography.accessibility.test.js +339 -0
- package/typography/Typography.stories.tsx +1 -3
- package/useTheme.d.ts +31 -20
- package/utils/BaseTypography.js +1 -1
- package/utils/FocusLock.js +6 -2
- package/wizard/Wizard.accessibility.test.d.ts +1 -0
- package/wizard/Wizard.accessibility.test.js +55 -0
- package/wizard/Wizard.js +14 -25
- package/wizard/Wizard.stories.tsx +20 -1
- package/wizard/Wizard.test.d.ts +1 -0
- package/wizard/Wizard.test.js +1 -1
- package/wizard/types.d.ts +2 -2
- package/common/OpenSans.css +0 -69
- package/common/fonts/OpenSans-Bold.ttf +0 -0
- package/common/fonts/OpenSans-BoldItalic.ttf +0 -0
- package/common/fonts/OpenSans-ExtraBold.ttf +0 -0
- package/common/fonts/OpenSans-ExtraBoldItalic.ttf +0 -0
- package/common/fonts/OpenSans-Italic.ttf +0 -0
- package/common/fonts/OpenSans-Light.ttf +0 -0
- package/common/fonts/OpenSans-LightItalic.ttf +0 -0
- package/common/fonts/OpenSans-Regular.ttf +0 -0
- package/common/fonts/OpenSans-SemiBold.ttf +0 -0
- package/common/fonts/OpenSans-SemiBoldItalic.ttf +0 -0
- package/date-input/Icons.d.ts +0 -6
- package/date-input/Icons.js +0 -58
- package/paginator/Icons.d.ts +0 -5
- package/paginator/Icons.js +0 -40
- package/password-input/Icons.d.ts +0 -6
- package/password-input/Icons.js +0 -35
- package/select/Icons.d.ts +0 -10
- package/select/Icons.js +0 -89
- package/sidenav/Icons.d.ts +0 -7
- package/sidenav/Icons.js +0 -47
- package/text-input/Icons.d.ts +0 -8
- package/text-input/Icons.js +0 -56
- /package/{layout → sidenav}/SidenavContext.d.ts +0 -0
- /package/{layout → sidenav}/SidenavContext.js +0 -0
|
@@ -8,7 +8,7 @@ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/creat
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _react2 = require("@testing-library/react");
|
|
10
10
|
var _userEvent = _interopRequireDefault(require("@testing-library/user-event"));
|
|
11
|
-
var _TextInput = _interopRequireDefault(require("./TextInput
|
|
11
|
+
var _TextInput = _interopRequireDefault(require("./TextInput"));
|
|
12
12
|
// Mocking DOMRect for Radix Primitive Popover
|
|
13
13
|
global.globalThis = global;
|
|
14
14
|
global.DOMRect = {
|
|
@@ -27,7 +27,7 @@ global.ResizeObserver = /*#__PURE__*/function () {
|
|
|
27
27
|
function ResizeObserver() {
|
|
28
28
|
(0, _classCallCheck2["default"])(this, ResizeObserver);
|
|
29
29
|
}
|
|
30
|
-
(0, _createClass2["default"])(ResizeObserver, [{
|
|
30
|
+
return (0, _createClass2["default"])(ResizeObserver, [{
|
|
31
31
|
key: "observe",
|
|
32
32
|
value: function observe() {}
|
|
33
33
|
}, {
|
|
@@ -37,7 +37,6 @@ global.ResizeObserver = /*#__PURE__*/function () {
|
|
|
37
37
|
key: "disconnect",
|
|
38
38
|
value: function disconnect() {}
|
|
39
39
|
}]);
|
|
40
|
-
return ResizeObserver;
|
|
41
40
|
}();
|
|
42
41
|
var countries = ["Afghanistan", "Albania", "Algeria", "Andorra", "Angola", "Antigua and Barbuda", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Cabo Verde", "Cambodia", "Cameroon", "Canada", "Cayman Islands, The", "Central African Republic", "Chad", "Democratic Republic of the Congo", "Dominican Republic", "Dominica", "Denmark", "Djibouti"];
|
|
43
42
|
var specialCharacters = ["/", "\\", "*", "(", ")", "[", "]", "+", "?", "*{[]}|"];
|
|
@@ -700,17 +699,34 @@ describe("TextInput component tests", function () {
|
|
|
700
699
|
var options = getAllByRole("option");
|
|
701
700
|
expect(options[0].getAttribute("aria-selected")).toBeNull();
|
|
702
701
|
});
|
|
702
|
+
test("Mouse wheel interaction does not affect the text value", function () {
|
|
703
|
+
var _render25 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_TextInput["default"], {
|
|
704
|
+
label: "Default label",
|
|
705
|
+
placeholder: "Placeholder",
|
|
706
|
+
defaultValue: "Example text"
|
|
707
|
+
})),
|
|
708
|
+
getByRole = _render25.getByRole;
|
|
709
|
+
var input = getByRole("textbox");
|
|
710
|
+
_react2.fireEvent.wheel(input, {
|
|
711
|
+
deltaY: -100
|
|
712
|
+
});
|
|
713
|
+
expect(input.value).toBe("Example text");
|
|
714
|
+
_react2.fireEvent.wheel(input, {
|
|
715
|
+
deltaY: 100
|
|
716
|
+
});
|
|
717
|
+
expect(input.value).toBe("Example text");
|
|
718
|
+
});
|
|
703
719
|
});
|
|
704
720
|
describe("TextInput component synchronous autosuggest tests", function () {
|
|
705
721
|
test("Autosuggest is displayed when the input gains focus", function () {
|
|
706
722
|
var onChange = jest.fn();
|
|
707
|
-
var
|
|
723
|
+
var _render26 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_TextInput["default"], {
|
|
708
724
|
label: "Autocomplete Countries",
|
|
709
725
|
suggestions: countries,
|
|
710
726
|
onChange: onChange
|
|
711
727
|
})),
|
|
712
|
-
getByRole =
|
|
713
|
-
getByText =
|
|
728
|
+
getByRole = _render26.getByRole,
|
|
729
|
+
getByText = _render26.getByText;
|
|
714
730
|
var input = getByRole("combobox");
|
|
715
731
|
_react2.fireEvent.focus(input);
|
|
716
732
|
var list = getByRole("listbox");
|
|
@@ -721,16 +737,16 @@ describe("TextInput component synchronous autosuggest tests", function () {
|
|
|
721
737
|
expect(getByText("Andorra")).toBeTruthy();
|
|
722
738
|
});
|
|
723
739
|
test("Autosuggest is displayed when the user clicks the input", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7() {
|
|
724
|
-
var onChange,
|
|
740
|
+
var onChange, _render27, getByRole, getByText, input, list;
|
|
725
741
|
return _regenerator["default"].wrap(function _callee7$(_context7) {
|
|
726
742
|
while (1) switch (_context7.prev = _context7.next) {
|
|
727
743
|
case 0:
|
|
728
744
|
onChange = jest.fn();
|
|
729
|
-
|
|
745
|
+
_render27 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_TextInput["default"], {
|
|
730
746
|
label: "Autocomplete Countries",
|
|
731
747
|
suggestions: countries,
|
|
732
748
|
onChange: onChange
|
|
733
|
-
})), getByRole =
|
|
749
|
+
})), getByRole = _render27.getByRole, getByText = _render27.getByText;
|
|
734
750
|
input = getByRole("combobox");
|
|
735
751
|
_context7.next = 5;
|
|
736
752
|
return _userEvent["default"].click(input);
|
|
@@ -748,14 +764,14 @@ describe("TextInput component synchronous autosuggest tests", function () {
|
|
|
748
764
|
}, _callee7);
|
|
749
765
|
})));
|
|
750
766
|
test("Autosuggest is displayed while the user is writing (if closed previously, if it is open stays open)", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8() {
|
|
751
|
-
var
|
|
767
|
+
var _render28, getByRole, getByText, getAllByText, input;
|
|
752
768
|
return _regenerator["default"].wrap(function _callee8$(_context8) {
|
|
753
769
|
while (1) switch (_context8.prev = _context8.next) {
|
|
754
770
|
case 0:
|
|
755
|
-
|
|
771
|
+
_render28 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_TextInput["default"], {
|
|
756
772
|
label: "Autocomplete Countries",
|
|
757
773
|
suggestions: countries
|
|
758
|
-
})), getByRole =
|
|
774
|
+
})), getByRole = _render28.getByRole, getByText = _render28.getByText, getAllByText = _render28.getAllByText;
|
|
759
775
|
input = getByRole("combobox");
|
|
760
776
|
_context8.next = 4;
|
|
761
777
|
return _userEvent["default"].type(input, "Bah");
|
|
@@ -771,17 +787,17 @@ describe("TextInput component synchronous autosuggest tests", function () {
|
|
|
771
787
|
}, _callee8);
|
|
772
788
|
})));
|
|
773
789
|
test("Read-only text input does not open the suggestions list", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee9() {
|
|
774
|
-
var onChange,
|
|
790
|
+
var onChange, _render29, getByRole, queryByRole, input;
|
|
775
791
|
return _regenerator["default"].wrap(function _callee9$(_context9) {
|
|
776
792
|
while (1) switch (_context9.prev = _context9.next) {
|
|
777
793
|
case 0:
|
|
778
794
|
onChange = jest.fn();
|
|
779
|
-
|
|
795
|
+
_render29 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_TextInput["default"], {
|
|
780
796
|
label: "Autocomplete Countries",
|
|
781
797
|
suggestions: countries,
|
|
782
798
|
onChange: onChange,
|
|
783
799
|
readOnly: true
|
|
784
|
-
})), getByRole =
|
|
800
|
+
})), getByRole = _render29.getByRole, queryByRole = _render29.queryByRole;
|
|
785
801
|
input = getByRole("combobox");
|
|
786
802
|
_react2.fireEvent.focus(input);
|
|
787
803
|
expect(queryByRole("listbox")).toBeFalsy();
|
|
@@ -796,7 +812,7 @@ describe("TextInput component synchronous autosuggest tests", function () {
|
|
|
796
812
|
}, _callee9);
|
|
797
813
|
})));
|
|
798
814
|
test("Autosuggest displays filtered when the input has a default value", function () {
|
|
799
|
-
var
|
|
815
|
+
var _render30 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_TextInput["default"], {
|
|
800
816
|
label: "Uncontrolled suggestions filtered by default",
|
|
801
817
|
helperText: "Example of helper text",
|
|
802
818
|
placeholder: "Placeholder",
|
|
@@ -805,9 +821,9 @@ describe("TextInput component synchronous autosuggest tests", function () {
|
|
|
805
821
|
suggestions: ["Suggestion 11", "Suggestion 12", "Suggestion 23", "Suggestion 24"],
|
|
806
822
|
clearable: true
|
|
807
823
|
})),
|
|
808
|
-
getByRole =
|
|
809
|
-
getByText =
|
|
810
|
-
getAllByText =
|
|
824
|
+
getByRole = _render30.getByRole,
|
|
825
|
+
getByText = _render30.getByText,
|
|
826
|
+
getAllByText = _render30.getAllByText;
|
|
811
827
|
var input = getByRole("combobox");
|
|
812
828
|
expect(input.value).toBe("Suggestion 2");
|
|
813
829
|
_react2.fireEvent.focus(input);
|
|
@@ -817,27 +833,27 @@ describe("TextInput component synchronous autosuggest tests", function () {
|
|
|
817
833
|
});
|
|
818
834
|
test("Autosuggest is not displayed when prop suggestions is an empty array", function () {
|
|
819
835
|
var onChange = jest.fn();
|
|
820
|
-
var
|
|
836
|
+
var _render31 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_TextInput["default"], {
|
|
821
837
|
label: "Autocomplete Countries",
|
|
822
838
|
suggestions: [],
|
|
823
839
|
onChange: onChange
|
|
824
840
|
})),
|
|
825
|
-
queryByRole =
|
|
841
|
+
queryByRole = _render31.queryByRole;
|
|
826
842
|
var input = queryByRole("textbox");
|
|
827
843
|
_react2.fireEvent.focus(input);
|
|
828
844
|
expect(queryByRole("listbox")).toBeFalsy();
|
|
829
845
|
});
|
|
830
846
|
test("Autosuggest closes the listbox when there are no matches for the user's input", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee11() {
|
|
831
|
-
var onChange,
|
|
847
|
+
var onChange, _render32, getByRole, queryByRole, input;
|
|
832
848
|
return _regenerator["default"].wrap(function _callee11$(_context11) {
|
|
833
849
|
while (1) switch (_context11.prev = _context11.next) {
|
|
834
850
|
case 0:
|
|
835
851
|
onChange = jest.fn();
|
|
836
|
-
|
|
852
|
+
_render32 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_TextInput["default"], {
|
|
837
853
|
label: "Autocomplete Countries",
|
|
838
854
|
suggestions: countries,
|
|
839
855
|
onChange: onChange
|
|
840
|
-
})), getByRole =
|
|
856
|
+
})), getByRole = _render32.getByRole, queryByRole = _render32.queryByRole;
|
|
841
857
|
input = getByRole("combobox");
|
|
842
858
|
_context11.next = 5;
|
|
843
859
|
return (0, _react2.act)( /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee10() {
|
|
@@ -860,16 +876,16 @@ describe("TextInput component synchronous autosuggest tests", function () {
|
|
|
860
876
|
}, _callee11);
|
|
861
877
|
})));
|
|
862
878
|
test("Autosuggest with no matches founded doesn't let the listbox to be opened", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee13() {
|
|
863
|
-
var onChange,
|
|
879
|
+
var onChange, _render33, getByRole, queryByRole, input;
|
|
864
880
|
return _regenerator["default"].wrap(function _callee13$(_context13) {
|
|
865
881
|
while (1) switch (_context13.prev = _context13.next) {
|
|
866
882
|
case 0:
|
|
867
883
|
onChange = jest.fn();
|
|
868
|
-
|
|
884
|
+
_render33 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_TextInput["default"], {
|
|
869
885
|
label: "Autocomplete Countries",
|
|
870
886
|
suggestions: countries,
|
|
871
887
|
onChange: onChange
|
|
872
|
-
})), getByRole =
|
|
888
|
+
})), getByRole = _render33.getByRole, queryByRole = _render33.queryByRole;
|
|
873
889
|
input = getByRole("combobox");
|
|
874
890
|
_context13.next = 5;
|
|
875
891
|
return (0, _react2.act)( /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee12() {
|
|
@@ -908,16 +924,16 @@ describe("TextInput component synchronous autosuggest tests", function () {
|
|
|
908
924
|
}, _callee13);
|
|
909
925
|
})));
|
|
910
926
|
test("Autosuggest uncontrolled - Suggestion selected by click", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee16() {
|
|
911
|
-
var onChange,
|
|
927
|
+
var onChange, _render34, getByRole, getByText, queryByRole, input;
|
|
912
928
|
return _regenerator["default"].wrap(function _callee16$(_context16) {
|
|
913
929
|
while (1) switch (_context16.prev = _context16.next) {
|
|
914
930
|
case 0:
|
|
915
931
|
onChange = jest.fn();
|
|
916
|
-
|
|
932
|
+
_render34 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_TextInput["default"], {
|
|
917
933
|
label: "Autocomplete Countries",
|
|
918
934
|
suggestions: countries,
|
|
919
935
|
onChange: onChange
|
|
920
|
-
})), getByRole =
|
|
936
|
+
})), getByRole = _render34.getByRole, getByText = _render34.getByText, queryByRole = _render34.queryByRole;
|
|
921
937
|
input = getByRole("combobox");
|
|
922
938
|
_react2.fireEvent.focus(input);
|
|
923
939
|
_context16.next = 6;
|
|
@@ -958,17 +974,17 @@ describe("TextInput component synchronous autosuggest tests", function () {
|
|
|
958
974
|
}, _callee16);
|
|
959
975
|
})));
|
|
960
976
|
test("Autosuggest controlled - Suggestion selected by click", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee17() {
|
|
961
|
-
var onChange,
|
|
977
|
+
var onChange, _render35, getByRole, getByText, queryByRole, input;
|
|
962
978
|
return _regenerator["default"].wrap(function _callee17$(_context17) {
|
|
963
979
|
while (1) switch (_context17.prev = _context17.next) {
|
|
964
980
|
case 0:
|
|
965
981
|
onChange = jest.fn();
|
|
966
|
-
|
|
982
|
+
_render35 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_TextInput["default"], {
|
|
967
983
|
label: "Autocomplete Countries",
|
|
968
984
|
value: "Andor",
|
|
969
985
|
suggestions: countries,
|
|
970
986
|
onChange: onChange
|
|
971
|
-
})), getByRole =
|
|
987
|
+
})), getByRole = _render35.getByRole, getByText = _render35.getByText, queryByRole = _render35.queryByRole;
|
|
972
988
|
input = getByRole("combobox");
|
|
973
989
|
_context17.next = 5;
|
|
974
990
|
return _userEvent["default"].click(getByText("Autocomplete Countries"));
|
|
@@ -990,19 +1006,19 @@ describe("TextInput component synchronous autosuggest tests", function () {
|
|
|
990
1006
|
}, _callee17);
|
|
991
1007
|
})));
|
|
992
1008
|
test("Autosuggest - Pattern constraint", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee20() {
|
|
993
|
-
var onChange, onBlur,
|
|
1009
|
+
var onChange, onBlur, _render36, getByRole, getByText, input;
|
|
994
1010
|
return _regenerator["default"].wrap(function _callee20$(_context20) {
|
|
995
1011
|
while (1) switch (_context20.prev = _context20.next) {
|
|
996
1012
|
case 0:
|
|
997
1013
|
onChange = jest.fn();
|
|
998
1014
|
onBlur = jest.fn();
|
|
999
|
-
|
|
1015
|
+
_render36 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_TextInput["default"], {
|
|
1000
1016
|
label: "Autocomplete Countries",
|
|
1001
1017
|
suggestions: countries,
|
|
1002
1018
|
onChange: onChange,
|
|
1003
1019
|
onBlur: onBlur,
|
|
1004
1020
|
pattern: "^.*(?=.*[a-zA-Z])(?=.*\\d)(?=.*[!&$%&? \"]).*$"
|
|
1005
|
-
})), getByRole =
|
|
1021
|
+
})), getByRole = _render36.getByRole, getByText = _render36.getByText;
|
|
1006
1022
|
input = getByRole("combobox");
|
|
1007
1023
|
_react2.fireEvent.focus(input);
|
|
1008
1024
|
_context20.next = 7;
|
|
@@ -1049,20 +1065,20 @@ describe("TextInput component synchronous autosuggest tests", function () {
|
|
|
1049
1065
|
}, _callee20);
|
|
1050
1066
|
})));
|
|
1051
1067
|
test("Autosuggest - Length constraint", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee23() {
|
|
1052
|
-
var onChange, onBlur,
|
|
1068
|
+
var onChange, onBlur, _render37, getByText, getByRole, input;
|
|
1053
1069
|
return _regenerator["default"].wrap(function _callee23$(_context23) {
|
|
1054
1070
|
while (1) switch (_context23.prev = _context23.next) {
|
|
1055
1071
|
case 0:
|
|
1056
1072
|
onChange = jest.fn();
|
|
1057
1073
|
onBlur = jest.fn();
|
|
1058
|
-
|
|
1074
|
+
_render37 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_TextInput["default"], {
|
|
1059
1075
|
label: "Autocomplete Countries",
|
|
1060
1076
|
suggestions: countries,
|
|
1061
1077
|
onChange: onChange,
|
|
1062
1078
|
onBlur: onBlur,
|
|
1063
1079
|
minLength: 5,
|
|
1064
1080
|
maxLength: 10
|
|
1065
|
-
})), getByText =
|
|
1081
|
+
})), getByText = _render37.getByText, getByRole = _render37.getByRole;
|
|
1066
1082
|
input = getByRole("combobox");
|
|
1067
1083
|
_react2.fireEvent.focus(input);
|
|
1068
1084
|
_context23.next = 7;
|
|
@@ -1110,13 +1126,13 @@ describe("TextInput component synchronous autosuggest tests", function () {
|
|
|
1110
1126
|
})));
|
|
1111
1127
|
test("Autosuggest keys: arrow down key opens autosuggest, active first option is selected with Enter and closes the autosuggest", function () {
|
|
1112
1128
|
var onChange = jest.fn();
|
|
1113
|
-
var
|
|
1129
|
+
var _render38 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_TextInput["default"], {
|
|
1114
1130
|
label: "Autocomplete Countries",
|
|
1115
1131
|
suggestions: countries,
|
|
1116
1132
|
onChange: onChange
|
|
1117
1133
|
})),
|
|
1118
|
-
getByRole =
|
|
1119
|
-
queryByRole =
|
|
1134
|
+
getByRole = _render38.getByRole,
|
|
1135
|
+
queryByRole = _render38.queryByRole;
|
|
1120
1136
|
var input = getByRole("combobox");
|
|
1121
1137
|
_react2.fireEvent.keyDown(input, {
|
|
1122
1138
|
key: "ArrowDown",
|
|
@@ -1137,13 +1153,13 @@ describe("TextInput component synchronous autosuggest tests", function () {
|
|
|
1137
1153
|
});
|
|
1138
1154
|
test("Autosuggest keys: arrow up key opens autosuggest, active last option is selected with Enter and closes the autosuggest", function () {
|
|
1139
1155
|
var onChange = jest.fn();
|
|
1140
|
-
var
|
|
1156
|
+
var _render39 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_TextInput["default"], {
|
|
1141
1157
|
label: "Autocomplete Countries",
|
|
1142
1158
|
suggestions: countries,
|
|
1143
1159
|
onChange: onChange
|
|
1144
1160
|
})),
|
|
1145
|
-
getByRole =
|
|
1146
|
-
queryByRole =
|
|
1161
|
+
getByRole = _render39.getByRole,
|
|
1162
|
+
queryByRole = _render39.queryByRole;
|
|
1147
1163
|
var input = getByRole("combobox");
|
|
1148
1164
|
_react2.fireEvent.keyDown(input, {
|
|
1149
1165
|
key: "ArrowUp",
|
|
@@ -1164,13 +1180,13 @@ describe("TextInput component synchronous autosuggest tests", function () {
|
|
|
1164
1180
|
});
|
|
1165
1181
|
test("Autosuggest keys: Esc key closes the autosuggest and cleans the input", function () {
|
|
1166
1182
|
var onChange = jest.fn();
|
|
1167
|
-
var
|
|
1183
|
+
var _render40 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_TextInput["default"], {
|
|
1168
1184
|
label: "Autocomplete Countries",
|
|
1169
1185
|
suggestions: countries,
|
|
1170
1186
|
onChange: onChange
|
|
1171
1187
|
})),
|
|
1172
|
-
getByRole =
|
|
1173
|
-
queryByRole =
|
|
1188
|
+
getByRole = _render40.getByRole,
|
|
1189
|
+
queryByRole = _render40.queryByRole;
|
|
1174
1190
|
var input = getByRole("combobox");
|
|
1175
1191
|
_react2.fireEvent.focus(input);
|
|
1176
1192
|
_userEvent["default"].type(input, "Bangla");
|
|
@@ -1187,13 +1203,13 @@ describe("TextInput component synchronous autosuggest tests", function () {
|
|
|
1187
1203
|
});
|
|
1188
1204
|
test("Autosuggest keys: Enter, if no active suggestion closes the autosuggest", function () {
|
|
1189
1205
|
var onChange = jest.fn();
|
|
1190
|
-
var
|
|
1206
|
+
var _render41 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_TextInput["default"], {
|
|
1191
1207
|
label: "Autocomplete Countries",
|
|
1192
1208
|
suggestions: countries,
|
|
1193
1209
|
onChange: onChange
|
|
1194
1210
|
})),
|
|
1195
|
-
getByRole =
|
|
1196
|
-
queryByRole =
|
|
1211
|
+
getByRole = _render41.getByRole,
|
|
1212
|
+
queryByRole = _render41.queryByRole;
|
|
1197
1213
|
var input = getByRole("combobox");
|
|
1198
1214
|
_react2.fireEvent.focus(input);
|
|
1199
1215
|
var list = getByRole("listbox");
|
|
@@ -1208,16 +1224,16 @@ describe("TextInput component synchronous autosuggest tests", function () {
|
|
|
1208
1224
|
expect(queryByRole("list")).toBeFalsy();
|
|
1209
1225
|
});
|
|
1210
1226
|
test("Autosuggest complex key sequence: write, arrow up two times, arrow down and select with Enter. Then, clean with Esc.", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee25() {
|
|
1211
|
-
var onChange,
|
|
1227
|
+
var onChange, _render42, getByRole, queryByRole, input;
|
|
1212
1228
|
return _regenerator["default"].wrap(function _callee25$(_context25) {
|
|
1213
1229
|
while (1) switch (_context25.prev = _context25.next) {
|
|
1214
1230
|
case 0:
|
|
1215
1231
|
onChange = jest.fn();
|
|
1216
|
-
|
|
1232
|
+
_render42 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_TextInput["default"], {
|
|
1217
1233
|
label: "Autocomplete Countries",
|
|
1218
1234
|
suggestions: countries,
|
|
1219
1235
|
onChange: onChange
|
|
1220
|
-
})), getByRole =
|
|
1236
|
+
})), getByRole = _render42.getByRole, queryByRole = _render42.queryByRole;
|
|
1221
1237
|
input = getByRole("combobox");
|
|
1222
1238
|
_react2.fireEvent.focus(input);
|
|
1223
1239
|
_context25.next = 6;
|
|
@@ -1275,13 +1291,13 @@ describe("TextInput component synchronous autosuggest tests", function () {
|
|
|
1275
1291
|
})));
|
|
1276
1292
|
test("Autosuggest escapes special characters", function () {
|
|
1277
1293
|
var onChange = jest.fn();
|
|
1278
|
-
var
|
|
1294
|
+
var _render43 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_TextInput["default"], {
|
|
1279
1295
|
label: "Autocomplete Countries",
|
|
1280
1296
|
suggestions: specialCharacters,
|
|
1281
1297
|
onChange: onChange
|
|
1282
1298
|
})),
|
|
1283
|
-
getAllByText =
|
|
1284
|
-
getByRole =
|
|
1299
|
+
getAllByText = _render43.getAllByText,
|
|
1300
|
+
getByRole = _render43.getByRole;
|
|
1285
1301
|
var input = getByRole("combobox");
|
|
1286
1302
|
_react2.fireEvent.focus(input);
|
|
1287
1303
|
var list = getByRole("listbox");
|
|
@@ -1352,7 +1368,7 @@ describe("TextInput component synchronous autosuggest tests", function () {
|
|
|
1352
1368
|
});
|
|
1353
1369
|
describe("TextInput component asynchronous autosuggest tests", function () {
|
|
1354
1370
|
test("Autosuggest 'Searching...' message is shown", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee27() {
|
|
1355
|
-
var callbackFunc, onChange,
|
|
1371
|
+
var callbackFunc, onChange, _render44, getByRole, getByText, input;
|
|
1356
1372
|
return _regenerator["default"].wrap(function _callee27$(_context27) {
|
|
1357
1373
|
while (1) switch (_context27.prev = _context27.next) {
|
|
1358
1374
|
case 0:
|
|
@@ -1367,11 +1383,11 @@ describe("TextInput component asynchronous autosuggest tests", function () {
|
|
|
1367
1383
|
return result;
|
|
1368
1384
|
});
|
|
1369
1385
|
onChange = jest.fn();
|
|
1370
|
-
|
|
1386
|
+
_render44 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_TextInput["default"], {
|
|
1371
1387
|
label: "Autosuggest Countries",
|
|
1372
1388
|
suggestions: callbackFunc,
|
|
1373
1389
|
onChange: onChange
|
|
1374
|
-
})), getByRole =
|
|
1390
|
+
})), getByRole = _render44.getByRole, getByText = _render44.getByText;
|
|
1375
1391
|
input = getByRole("combobox");
|
|
1376
1392
|
_react2.fireEvent.focus(input);
|
|
1377
1393
|
expect(getByRole("listbox")).toBeTruthy();
|
|
@@ -1434,14 +1450,14 @@ describe("TextInput component asynchronous autosuggest tests", function () {
|
|
|
1434
1450
|
return result;
|
|
1435
1451
|
});
|
|
1436
1452
|
var onChange = jest.fn();
|
|
1437
|
-
var
|
|
1453
|
+
var _render45 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_TextInput["default"], {
|
|
1438
1454
|
label: "Autosuggest Countries",
|
|
1439
1455
|
suggestions: callbackFunc,
|
|
1440
1456
|
onChange: onChange
|
|
1441
1457
|
})),
|
|
1442
|
-
getByRole =
|
|
1443
|
-
queryByText =
|
|
1444
|
-
queryByRole =
|
|
1458
|
+
getByRole = _render45.getByRole,
|
|
1459
|
+
queryByText = _render45.queryByText,
|
|
1460
|
+
queryByRole = _render45.queryByRole;
|
|
1445
1461
|
var input = getByRole("combobox");
|
|
1446
1462
|
_react2.fireEvent.focus(input);
|
|
1447
1463
|
expect(getByRole("listbox")).toBeTruthy();
|
|
@@ -1457,7 +1473,7 @@ describe("TextInput component asynchronous autosuggest tests", function () {
|
|
|
1457
1473
|
expect(input.value).toBe("");
|
|
1458
1474
|
});
|
|
1459
1475
|
test("Autosuggest Esc + arrow down working while 'Searching...' message is shown", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee28() {
|
|
1460
|
-
var callbackFunc, onChange,
|
|
1476
|
+
var callbackFunc, onChange, _render46, getByRole, getByText, queryByText, queryByRole, input, list;
|
|
1461
1477
|
return _regenerator["default"].wrap(function _callee28$(_context28) {
|
|
1462
1478
|
while (1) switch (_context28.prev = _context28.next) {
|
|
1463
1479
|
case 0:
|
|
@@ -1472,11 +1488,11 @@ describe("TextInput component asynchronous autosuggest tests", function () {
|
|
|
1472
1488
|
return result;
|
|
1473
1489
|
});
|
|
1474
1490
|
onChange = jest.fn();
|
|
1475
|
-
|
|
1491
|
+
_render46 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_TextInput["default"], {
|
|
1476
1492
|
label: "Autosuggest Countries",
|
|
1477
1493
|
suggestions: callbackFunc,
|
|
1478
1494
|
onChange: onChange
|
|
1479
|
-
})), getByRole =
|
|
1495
|
+
})), getByRole = _render46.getByRole, getByText = _render46.getByText, queryByText = _render46.queryByText, queryByRole = _render46.queryByRole;
|
|
1480
1496
|
input = getByRole("combobox");
|
|
1481
1497
|
_react2.fireEvent.focus(input);
|
|
1482
1498
|
list = getByRole("listbox");
|
|
@@ -1514,7 +1530,7 @@ describe("TextInput component asynchronous autosuggest tests", function () {
|
|
|
1514
1530
|
}, _callee28);
|
|
1515
1531
|
})));
|
|
1516
1532
|
test("Asynchronous uncontrolled autosuggest test", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee29() {
|
|
1517
|
-
var callbackFunc, onChange,
|
|
1533
|
+
var callbackFunc, onChange, _render47, getByRole, getByText, input;
|
|
1518
1534
|
return _regenerator["default"].wrap(function _callee29$(_context29) {
|
|
1519
1535
|
while (1) switch (_context29.prev = _context29.next) {
|
|
1520
1536
|
case 0:
|
|
@@ -1529,11 +1545,11 @@ describe("TextInput component asynchronous autosuggest tests", function () {
|
|
|
1529
1545
|
return result;
|
|
1530
1546
|
});
|
|
1531
1547
|
onChange = jest.fn();
|
|
1532
|
-
|
|
1548
|
+
_render47 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_TextInput["default"], {
|
|
1533
1549
|
label: "Autosuggest Countries",
|
|
1534
1550
|
onChange: onChange,
|
|
1535
1551
|
suggestions: callbackFunc
|
|
1536
|
-
})), getByRole =
|
|
1552
|
+
})), getByRole = _render47.getByRole, getByText = _render47.getByText;
|
|
1537
1553
|
input = getByRole("combobox");
|
|
1538
1554
|
_react2.fireEvent.focus(input);
|
|
1539
1555
|
_userEvent["default"].type(input, "Den");
|
|
@@ -1557,7 +1573,7 @@ describe("TextInput component asynchronous autosuggest tests", function () {
|
|
|
1557
1573
|
}, _callee29);
|
|
1558
1574
|
})));
|
|
1559
1575
|
test("Asynchronous controlled autosuggest test", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee30() {
|
|
1560
|
-
var callbackFunc, onChange,
|
|
1576
|
+
var callbackFunc, onChange, _render48, getByRole, getByText, queryByRole, input;
|
|
1561
1577
|
return _regenerator["default"].wrap(function _callee30$(_context30) {
|
|
1562
1578
|
while (1) switch (_context30.prev = _context30.next) {
|
|
1563
1579
|
case 0:
|
|
@@ -1572,12 +1588,12 @@ describe("TextInput component asynchronous autosuggest tests", function () {
|
|
|
1572
1588
|
return result;
|
|
1573
1589
|
});
|
|
1574
1590
|
onChange = jest.fn();
|
|
1575
|
-
|
|
1591
|
+
_render48 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_TextInput["default"], {
|
|
1576
1592
|
label: "Autosuggest Countries",
|
|
1577
1593
|
value: "Denm",
|
|
1578
1594
|
onChange: onChange,
|
|
1579
1595
|
suggestions: callbackFunc
|
|
1580
|
-
})), getByRole =
|
|
1596
|
+
})), getByRole = _render48.getByRole, getByText = _render48.getByText, queryByRole = _render48.queryByRole;
|
|
1581
1597
|
input = getByRole("combobox");
|
|
1582
1598
|
expect(input.value).toBe("Denm");
|
|
1583
1599
|
_context30.next = 7;
|
|
@@ -1604,7 +1620,7 @@ describe("TextInput component asynchronous autosuggest tests", function () {
|
|
|
1604
1620
|
}, _callee30);
|
|
1605
1621
|
})));
|
|
1606
1622
|
test("Asynchronous autosuggest closes the listbox after finishing no matches search", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee32() {
|
|
1607
|
-
var callbackFunc, onChange,
|
|
1623
|
+
var callbackFunc, onChange, _render49, getByText, getByRole, queryByRole, input;
|
|
1608
1624
|
return _regenerator["default"].wrap(function _callee32$(_context32) {
|
|
1609
1625
|
while (1) switch (_context32.prev = _context32.next) {
|
|
1610
1626
|
case 0:
|
|
@@ -1619,11 +1635,11 @@ describe("TextInput component asynchronous autosuggest tests", function () {
|
|
|
1619
1635
|
return result;
|
|
1620
1636
|
});
|
|
1621
1637
|
onChange = jest.fn();
|
|
1622
|
-
|
|
1638
|
+
_render49 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_TextInput["default"], {
|
|
1623
1639
|
label: "Autosuggest Countries",
|
|
1624
1640
|
onChange: onChange,
|
|
1625
1641
|
suggestions: callbackFunc
|
|
1626
|
-
})), getByText =
|
|
1642
|
+
})), getByText = _render49.getByText, getByRole = _render49.getByRole, queryByRole = _render49.queryByRole;
|
|
1627
1643
|
input = getByRole("combobox");
|
|
1628
1644
|
_react2.fireEvent.focus(input);
|
|
1629
1645
|
_context32.next = 7;
|
|
@@ -1652,7 +1668,7 @@ describe("TextInput component asynchronous autosuggest tests", function () {
|
|
|
1652
1668
|
}, _callee32);
|
|
1653
1669
|
})));
|
|
1654
1670
|
test("Asynchronous autosuggest with no matches founded doesn't let the listbox to be opened", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee33() {
|
|
1655
|
-
var callbackFunc, onChange,
|
|
1671
|
+
var callbackFunc, onChange, _render50, getByText, getByRole, queryByRole, input;
|
|
1656
1672
|
return _regenerator["default"].wrap(function _callee33$(_context33) {
|
|
1657
1673
|
while (1) switch (_context33.prev = _context33.next) {
|
|
1658
1674
|
case 0:
|
|
@@ -1667,11 +1683,11 @@ describe("TextInput component asynchronous autosuggest tests", function () {
|
|
|
1667
1683
|
return result;
|
|
1668
1684
|
});
|
|
1669
1685
|
onChange = jest.fn();
|
|
1670
|
-
|
|
1686
|
+
_render50 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_TextInput["default"], {
|
|
1671
1687
|
label: "Autosuggest Countries",
|
|
1672
1688
|
onChange: onChange,
|
|
1673
1689
|
suggestions: callbackFunc
|
|
1674
|
-
})), getByText =
|
|
1690
|
+
})), getByText = _render50.getByText, getByRole = _render50.getByRole, queryByRole = _render50.queryByRole;
|
|
1675
1691
|
input = getByRole("combobox");
|
|
1676
1692
|
_react2.fireEvent.focus(input);
|
|
1677
1693
|
_userEvent["default"].type(input, "wrong");
|
|
@@ -1704,7 +1720,7 @@ describe("TextInput component asynchronous autosuggest tests", function () {
|
|
|
1704
1720
|
}, _callee33);
|
|
1705
1721
|
})));
|
|
1706
1722
|
test("Asynchronous autosuggest request failed, shows 'Error fetching data' message", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee34() {
|
|
1707
|
-
var errorCallbackFunc, onChange,
|
|
1723
|
+
var errorCallbackFunc, onChange, _render51, getByRole, getByText, input;
|
|
1708
1724
|
return _regenerator["default"].wrap(function _callee34$(_context34) {
|
|
1709
1725
|
while (1) switch (_context34.prev = _context34.next) {
|
|
1710
1726
|
case 0:
|
|
@@ -1717,11 +1733,11 @@ describe("TextInput component asynchronous autosuggest tests", function () {
|
|
|
1717
1733
|
return result;
|
|
1718
1734
|
});
|
|
1719
1735
|
onChange = jest.fn();
|
|
1720
|
-
|
|
1736
|
+
_render51 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_TextInput["default"], {
|
|
1721
1737
|
label: "Autosuggest Countries",
|
|
1722
1738
|
onChange: onChange,
|
|
1723
1739
|
suggestions: errorCallbackFunc
|
|
1724
|
-
})), getByRole =
|
|
1740
|
+
})), getByRole = _render51.getByRole, getByText = _render51.getByText;
|
|
1725
1741
|
input = getByRole("combobox");
|
|
1726
1742
|
_react2.fireEvent.focus(input);
|
|
1727
1743
|
_context34.next = 7;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|