@dxc-technology/halstack-react 11.0.0 → 12.0.1
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.d.ts +1 -10
- package/BackgroundColorContext.js +3 -8
- package/HalstackContext.d.ts +32 -145
- package/HalstackContext.js +3 -7
- package/accordion/Accordion.accessibility.test.d.ts +1 -0
- package/accordion/Accordion.accessibility.test.js +71 -0
- package/accordion/Accordion.js +18 -35
- 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 +4 -0
- package/action-icon/ActionIcon.js +48 -0
- 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 +26 -0
- package/action-icon/types.js +5 -0
- package/alert/Alert.accessibility.test.d.ts +1 -0
- package/alert/Alert.accessibility.test.js +95 -0
- package/alert/Alert.js +21 -75
- 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 +2 -5
- 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 +169 -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 +16 -23
- package/bulleted-list/BulletedList.stories.tsx +1 -2
- package/button/Button.accessibility.test.d.ts +1 -0
- package/button/Button.accessibility.test.js +127 -0
- package/button/Button.js +16 -16
- 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.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 +36 -44
- 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 +69 -0
- package/chip/Chip.js +20 -26
- package/chip/Chip.stories.tsx +67 -50
- package/chip/Chip.test.d.ts +1 -0
- package/chip/Chip.test.js +5 -5
- package/chip/types.d.ts +35 -12
- package/common/coreTokens.d.ts +105 -14
- package/common/coreTokens.js +40 -22
- package/common/fonts.css +2 -0
- package/common/variables.d.ts +31 -141
- package/common/variables.js +104 -214
- package/container/Container.d.ts +4 -0
- package/container/Container.js +194 -0
- package/container/Container.stories.tsx +214 -0
- package/container/types.d.ts +74 -0
- package/container/types.js +5 -0
- 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 +88 -0
- package/contextual-menu/ContextualMenu.stories.tsx +232 -0
- package/contextual-menu/ContextualMenu.test.d.ts +1 -0
- package/contextual-menu/ContextualMenu.test.js +205 -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 +51 -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 +58 -0
- package/contextual-menu/types.js +5 -0
- package/date-input/Calendar.js +1 -1
- package/date-input/DateInput.accessibility.test.d.ts +1 -0
- package/date-input/DateInput.accessibility.test.js +230 -0
- package/date-input/DateInput.js +19 -20
- package/date-input/DateInput.stories.tsx +15 -8
- package/date-input/DateInput.test.d.ts +1 -0
- package/date-input/DateInput.test.js +9 -8
- package/date-input/DatePicker.js +13 -7
- package/date-input/YearPicker.js +1 -1
- 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 +11 -25
- package/dialog/Dialog.stories.tsx +175 -0
- package/dialog/Dialog.test.d.ts +1 -0
- package/dialog/Dialog.test.js +113 -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 +184 -0
- package/dropdown/Dropdown.js +37 -51
- package/dropdown/Dropdown.stories.tsx +15 -26
- package/dropdown/Dropdown.test.d.ts +1 -0
- package/dropdown/Dropdown.test.js +100 -70
- 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 +127 -145
- package/file-input/FileInput.test.d.ts +1 -0
- package/file-input/FileInput.test.js +125 -129
- package/file-input/FileItem.js +18 -28
- package/file-input/types.d.ts +1 -1
- 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 +36 -31
- 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 +8 -8
- package/header/Header.accessibility.test.d.ts +1 -0
- package/header/Header.accessibility.test.js +94 -0
- package/header/Header.js +20 -41
- package/header/Header.stories.tsx +16 -0
- 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 +4 -3
- 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 +8 -3
- package/main.js +38 -9
- 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 +25 -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 +228 -0
- package/number-input/NumberInput.d.ts +0 -7
- package/number-input/NumberInput.js +24 -5
- package/number-input/NumberInput.test.d.ts +1 -0
- package/number-input/NumberInput.test.js +166 -7
- 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 +20 -18
- package/paginator/Paginator.accessibility.test.d.ts +1 -0
- package/paginator/Paginator.accessibility.test.js +79 -0
- package/paginator/Paginator.js +14 -14
- package/paginator/Paginator.test.d.ts +1 -0
- package/paginator/Paginator.test.js +1 -1
- package/paragraph/Paragraph.accessibility.test.d.ts +1 -0
- package/paragraph/Paragraph.accessibility.test.js +28 -0
- package/paragraph/Paragraph.js +2 -7
- package/password-input/PasswordInput.accessibility.test.d.ts +1 -0
- package/password-input/PasswordInput.accessibility.test.js +153 -0
- package/password-input/PasswordInput.js +7 -7
- package/password-input/PasswordInput.stories.tsx +0 -1
- package/password-input/PasswordInput.test.d.ts +1 -0
- package/password-input/PasswordInput.test.js +5 -5
- package/progress-bar/ProgressBar.accessibility.test.d.ts +1 -0
- package/progress-bar/ProgressBar.accessibility.test.js +35 -0
- package/progress-bar/ProgressBar.js +11 -15
- 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 +15 -17
- 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 +285 -0
- package/resultset-table/ResultsetTable.d.ts +4 -1
- package/resultset-table/ResultsetTable.js +25 -13
- package/resultset-table/ResultsetTable.stories.tsx +118 -5
- package/resultset-table/ResultsetTable.test.d.ts +1 -0
- package/resultset-table/ResultsetTable.test.js +76 -1
- package/resultset-table/types.d.ts +40 -7
- package/select/Listbox.js +24 -16
- package/select/Option.js +19 -10
- package/select/Select.accessibility.test.d.ts +1 -0
- package/select/Select.accessibility.test.js +228 -0
- package/select/Select.js +72 -54
- package/select/Select.stories.tsx +59 -111
- package/select/Select.test.d.ts +1 -0
- package/select/Select.test.js +393 -459
- package/select/types.d.ts +3 -3
- package/sidenav/Sidenav.accessibility.test.d.ts +1 -0
- package/sidenav/Sidenav.accessibility.test.js +59 -0
- package/sidenav/Sidenav.js +21 -19
- package/sidenav/Sidenav.stories.tsx +4 -9
- 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 +104 -0
- package/slider/Slider.js +31 -42
- package/slider/Slider.stories.tsx +180 -0
- package/slider/Slider.test.d.ts +1 -0
- package/slider/Slider.test.js +12 -9
- package/spinner/Spinner.accessibility.test.d.ts +1 -0
- package/spinner/Spinner.accessibility.test.js +96 -0
- package/spinner/Spinner.js +12 -16
- 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 +29 -37
- 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 +93 -0
- package/table/Table.d.ts +6 -2
- package/table/Table.js +74 -12
- package/table/Table.stories.tsx +309 -2
- package/table/Table.test.d.ts +1 -0
- package/table/Table.test.js +92 -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 +12 -24
- 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 +4 -7
- 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 +19 -14
- package/text-input/TextInput.accessibility.test.d.ts +1 -0
- package/text-input/TextInput.accessibility.test.js +321 -0
- package/text-input/TextInput.js +103 -126
- package/text-input/TextInput.stories.tsx +17 -8
- package/text-input/TextInput.test.d.ts +1 -0
- package/text-input/TextInput.test.js +97 -80
- package/textarea/Textarea.accessibility.test.d.ts +1 -0
- package/textarea/Textarea.accessibility.test.js +155 -0
- package/textarea/Textarea.js +13 -21
- package/textarea/Textarea.stories.tsx +0 -1
- 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 +11 -16
- package/toggle-group/ToggleGroup.stories.tsx +3 -3
- 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/useTheme.d.ts +31 -141
- package/utils/BaseTypography.js +1 -1
- package/utils/FocusLock.js +16 -6
- 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 +19 -0
- 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 = {
|
|
@@ -700,17 +700,34 @@ describe("TextInput component tests", function () {
|
|
|
700
700
|
var options = getAllByRole("option");
|
|
701
701
|
expect(options[0].getAttribute("aria-selected")).toBeNull();
|
|
702
702
|
});
|
|
703
|
+
test("Mouse wheel interaction does not affect the text value", function () {
|
|
704
|
+
var _render25 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_TextInput["default"], {
|
|
705
|
+
label: "Default label",
|
|
706
|
+
placeholder: "Placeholder",
|
|
707
|
+
defaultValue: "Example text"
|
|
708
|
+
})),
|
|
709
|
+
getByRole = _render25.getByRole;
|
|
710
|
+
var input = getByRole("textbox");
|
|
711
|
+
_react2.fireEvent.wheel(input, {
|
|
712
|
+
deltaY: -100
|
|
713
|
+
});
|
|
714
|
+
expect(input.value).toBe("Example text");
|
|
715
|
+
_react2.fireEvent.wheel(input, {
|
|
716
|
+
deltaY: 100
|
|
717
|
+
});
|
|
718
|
+
expect(input.value).toBe("Example text");
|
|
719
|
+
});
|
|
703
720
|
});
|
|
704
721
|
describe("TextInput component synchronous autosuggest tests", function () {
|
|
705
722
|
test("Autosuggest is displayed when the input gains focus", function () {
|
|
706
723
|
var onChange = jest.fn();
|
|
707
|
-
var
|
|
724
|
+
var _render26 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_TextInput["default"], {
|
|
708
725
|
label: "Autocomplete Countries",
|
|
709
726
|
suggestions: countries,
|
|
710
727
|
onChange: onChange
|
|
711
728
|
})),
|
|
712
|
-
getByRole =
|
|
713
|
-
getByText =
|
|
729
|
+
getByRole = _render26.getByRole,
|
|
730
|
+
getByText = _render26.getByText;
|
|
714
731
|
var input = getByRole("combobox");
|
|
715
732
|
_react2.fireEvent.focus(input);
|
|
716
733
|
var list = getByRole("listbox");
|
|
@@ -721,16 +738,16 @@ describe("TextInput component synchronous autosuggest tests", function () {
|
|
|
721
738
|
expect(getByText("Andorra")).toBeTruthy();
|
|
722
739
|
});
|
|
723
740
|
test("Autosuggest is displayed when the user clicks the input", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7() {
|
|
724
|
-
var onChange,
|
|
741
|
+
var onChange, _render27, getByRole, getByText, input, list;
|
|
725
742
|
return _regenerator["default"].wrap(function _callee7$(_context7) {
|
|
726
743
|
while (1) switch (_context7.prev = _context7.next) {
|
|
727
744
|
case 0:
|
|
728
745
|
onChange = jest.fn();
|
|
729
|
-
|
|
746
|
+
_render27 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_TextInput["default"], {
|
|
730
747
|
label: "Autocomplete Countries",
|
|
731
748
|
suggestions: countries,
|
|
732
749
|
onChange: onChange
|
|
733
|
-
})), getByRole =
|
|
750
|
+
})), getByRole = _render27.getByRole, getByText = _render27.getByText;
|
|
734
751
|
input = getByRole("combobox");
|
|
735
752
|
_context7.next = 5;
|
|
736
753
|
return _userEvent["default"].click(input);
|
|
@@ -748,14 +765,14 @@ describe("TextInput component synchronous autosuggest tests", function () {
|
|
|
748
765
|
}, _callee7);
|
|
749
766
|
})));
|
|
750
767
|
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
|
|
768
|
+
var _render28, getByRole, getByText, getAllByText, input;
|
|
752
769
|
return _regenerator["default"].wrap(function _callee8$(_context8) {
|
|
753
770
|
while (1) switch (_context8.prev = _context8.next) {
|
|
754
771
|
case 0:
|
|
755
|
-
|
|
772
|
+
_render28 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_TextInput["default"], {
|
|
756
773
|
label: "Autocomplete Countries",
|
|
757
774
|
suggestions: countries
|
|
758
|
-
})), getByRole =
|
|
775
|
+
})), getByRole = _render28.getByRole, getByText = _render28.getByText, getAllByText = _render28.getAllByText;
|
|
759
776
|
input = getByRole("combobox");
|
|
760
777
|
_context8.next = 4;
|
|
761
778
|
return _userEvent["default"].type(input, "Bah");
|
|
@@ -771,17 +788,17 @@ describe("TextInput component synchronous autosuggest tests", function () {
|
|
|
771
788
|
}, _callee8);
|
|
772
789
|
})));
|
|
773
790
|
test("Read-only text input does not open the suggestions list", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee9() {
|
|
774
|
-
var onChange,
|
|
791
|
+
var onChange, _render29, getByRole, queryByRole, input;
|
|
775
792
|
return _regenerator["default"].wrap(function _callee9$(_context9) {
|
|
776
793
|
while (1) switch (_context9.prev = _context9.next) {
|
|
777
794
|
case 0:
|
|
778
795
|
onChange = jest.fn();
|
|
779
|
-
|
|
796
|
+
_render29 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_TextInput["default"], {
|
|
780
797
|
label: "Autocomplete Countries",
|
|
781
798
|
suggestions: countries,
|
|
782
799
|
onChange: onChange,
|
|
783
800
|
readOnly: true
|
|
784
|
-
})), getByRole =
|
|
801
|
+
})), getByRole = _render29.getByRole, queryByRole = _render29.queryByRole;
|
|
785
802
|
input = getByRole("combobox");
|
|
786
803
|
_react2.fireEvent.focus(input);
|
|
787
804
|
expect(queryByRole("listbox")).toBeFalsy();
|
|
@@ -796,7 +813,7 @@ describe("TextInput component synchronous autosuggest tests", function () {
|
|
|
796
813
|
}, _callee9);
|
|
797
814
|
})));
|
|
798
815
|
test("Autosuggest displays filtered when the input has a default value", function () {
|
|
799
|
-
var
|
|
816
|
+
var _render30 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_TextInput["default"], {
|
|
800
817
|
label: "Uncontrolled suggestions filtered by default",
|
|
801
818
|
helperText: "Example of helper text",
|
|
802
819
|
placeholder: "Placeholder",
|
|
@@ -805,9 +822,9 @@ describe("TextInput component synchronous autosuggest tests", function () {
|
|
|
805
822
|
suggestions: ["Suggestion 11", "Suggestion 12", "Suggestion 23", "Suggestion 24"],
|
|
806
823
|
clearable: true
|
|
807
824
|
})),
|
|
808
|
-
getByRole =
|
|
809
|
-
getByText =
|
|
810
|
-
getAllByText =
|
|
825
|
+
getByRole = _render30.getByRole,
|
|
826
|
+
getByText = _render30.getByText,
|
|
827
|
+
getAllByText = _render30.getAllByText;
|
|
811
828
|
var input = getByRole("combobox");
|
|
812
829
|
expect(input.value).toBe("Suggestion 2");
|
|
813
830
|
_react2.fireEvent.focus(input);
|
|
@@ -817,27 +834,27 @@ describe("TextInput component synchronous autosuggest tests", function () {
|
|
|
817
834
|
});
|
|
818
835
|
test("Autosuggest is not displayed when prop suggestions is an empty array", function () {
|
|
819
836
|
var onChange = jest.fn();
|
|
820
|
-
var
|
|
837
|
+
var _render31 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_TextInput["default"], {
|
|
821
838
|
label: "Autocomplete Countries",
|
|
822
839
|
suggestions: [],
|
|
823
840
|
onChange: onChange
|
|
824
841
|
})),
|
|
825
|
-
queryByRole =
|
|
842
|
+
queryByRole = _render31.queryByRole;
|
|
826
843
|
var input = queryByRole("textbox");
|
|
827
844
|
_react2.fireEvent.focus(input);
|
|
828
845
|
expect(queryByRole("listbox")).toBeFalsy();
|
|
829
846
|
});
|
|
830
847
|
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,
|
|
848
|
+
var onChange, _render32, getByRole, queryByRole, input;
|
|
832
849
|
return _regenerator["default"].wrap(function _callee11$(_context11) {
|
|
833
850
|
while (1) switch (_context11.prev = _context11.next) {
|
|
834
851
|
case 0:
|
|
835
852
|
onChange = jest.fn();
|
|
836
|
-
|
|
853
|
+
_render32 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_TextInput["default"], {
|
|
837
854
|
label: "Autocomplete Countries",
|
|
838
855
|
suggestions: countries,
|
|
839
856
|
onChange: onChange
|
|
840
|
-
})), getByRole =
|
|
857
|
+
})), getByRole = _render32.getByRole, queryByRole = _render32.queryByRole;
|
|
841
858
|
input = getByRole("combobox");
|
|
842
859
|
_context11.next = 5;
|
|
843
860
|
return (0, _react2.act)( /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee10() {
|
|
@@ -860,16 +877,16 @@ describe("TextInput component synchronous autosuggest tests", function () {
|
|
|
860
877
|
}, _callee11);
|
|
861
878
|
})));
|
|
862
879
|
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,
|
|
880
|
+
var onChange, _render33, getByRole, queryByRole, input;
|
|
864
881
|
return _regenerator["default"].wrap(function _callee13$(_context13) {
|
|
865
882
|
while (1) switch (_context13.prev = _context13.next) {
|
|
866
883
|
case 0:
|
|
867
884
|
onChange = jest.fn();
|
|
868
|
-
|
|
885
|
+
_render33 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_TextInput["default"], {
|
|
869
886
|
label: "Autocomplete Countries",
|
|
870
887
|
suggestions: countries,
|
|
871
888
|
onChange: onChange
|
|
872
|
-
})), getByRole =
|
|
889
|
+
})), getByRole = _render33.getByRole, queryByRole = _render33.queryByRole;
|
|
873
890
|
input = getByRole("combobox");
|
|
874
891
|
_context13.next = 5;
|
|
875
892
|
return (0, _react2.act)( /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee12() {
|
|
@@ -908,16 +925,16 @@ describe("TextInput component synchronous autosuggest tests", function () {
|
|
|
908
925
|
}, _callee13);
|
|
909
926
|
})));
|
|
910
927
|
test("Autosuggest uncontrolled - Suggestion selected by click", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee16() {
|
|
911
|
-
var onChange,
|
|
928
|
+
var onChange, _render34, getByRole, getByText, queryByRole, input;
|
|
912
929
|
return _regenerator["default"].wrap(function _callee16$(_context16) {
|
|
913
930
|
while (1) switch (_context16.prev = _context16.next) {
|
|
914
931
|
case 0:
|
|
915
932
|
onChange = jest.fn();
|
|
916
|
-
|
|
933
|
+
_render34 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_TextInput["default"], {
|
|
917
934
|
label: "Autocomplete Countries",
|
|
918
935
|
suggestions: countries,
|
|
919
936
|
onChange: onChange
|
|
920
|
-
})), getByRole =
|
|
937
|
+
})), getByRole = _render34.getByRole, getByText = _render34.getByText, queryByRole = _render34.queryByRole;
|
|
921
938
|
input = getByRole("combobox");
|
|
922
939
|
_react2.fireEvent.focus(input);
|
|
923
940
|
_context16.next = 6;
|
|
@@ -958,17 +975,17 @@ describe("TextInput component synchronous autosuggest tests", function () {
|
|
|
958
975
|
}, _callee16);
|
|
959
976
|
})));
|
|
960
977
|
test("Autosuggest controlled - Suggestion selected by click", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee17() {
|
|
961
|
-
var onChange,
|
|
978
|
+
var onChange, _render35, getByRole, getByText, queryByRole, input;
|
|
962
979
|
return _regenerator["default"].wrap(function _callee17$(_context17) {
|
|
963
980
|
while (1) switch (_context17.prev = _context17.next) {
|
|
964
981
|
case 0:
|
|
965
982
|
onChange = jest.fn();
|
|
966
|
-
|
|
983
|
+
_render35 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_TextInput["default"], {
|
|
967
984
|
label: "Autocomplete Countries",
|
|
968
985
|
value: "Andor",
|
|
969
986
|
suggestions: countries,
|
|
970
987
|
onChange: onChange
|
|
971
|
-
})), getByRole =
|
|
988
|
+
})), getByRole = _render35.getByRole, getByText = _render35.getByText, queryByRole = _render35.queryByRole;
|
|
972
989
|
input = getByRole("combobox");
|
|
973
990
|
_context17.next = 5;
|
|
974
991
|
return _userEvent["default"].click(getByText("Autocomplete Countries"));
|
|
@@ -990,19 +1007,19 @@ describe("TextInput component synchronous autosuggest tests", function () {
|
|
|
990
1007
|
}, _callee17);
|
|
991
1008
|
})));
|
|
992
1009
|
test("Autosuggest - Pattern constraint", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee20() {
|
|
993
|
-
var onChange, onBlur,
|
|
1010
|
+
var onChange, onBlur, _render36, getByRole, getByText, input;
|
|
994
1011
|
return _regenerator["default"].wrap(function _callee20$(_context20) {
|
|
995
1012
|
while (1) switch (_context20.prev = _context20.next) {
|
|
996
1013
|
case 0:
|
|
997
1014
|
onChange = jest.fn();
|
|
998
1015
|
onBlur = jest.fn();
|
|
999
|
-
|
|
1016
|
+
_render36 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_TextInput["default"], {
|
|
1000
1017
|
label: "Autocomplete Countries",
|
|
1001
1018
|
suggestions: countries,
|
|
1002
1019
|
onChange: onChange,
|
|
1003
1020
|
onBlur: onBlur,
|
|
1004
1021
|
pattern: "^.*(?=.*[a-zA-Z])(?=.*\\d)(?=.*[!&$%&? \"]).*$"
|
|
1005
|
-
})), getByRole =
|
|
1022
|
+
})), getByRole = _render36.getByRole, getByText = _render36.getByText;
|
|
1006
1023
|
input = getByRole("combobox");
|
|
1007
1024
|
_react2.fireEvent.focus(input);
|
|
1008
1025
|
_context20.next = 7;
|
|
@@ -1049,20 +1066,20 @@ describe("TextInput component synchronous autosuggest tests", function () {
|
|
|
1049
1066
|
}, _callee20);
|
|
1050
1067
|
})));
|
|
1051
1068
|
test("Autosuggest - Length constraint", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee23() {
|
|
1052
|
-
var onChange, onBlur,
|
|
1069
|
+
var onChange, onBlur, _render37, getByText, getByRole, input;
|
|
1053
1070
|
return _regenerator["default"].wrap(function _callee23$(_context23) {
|
|
1054
1071
|
while (1) switch (_context23.prev = _context23.next) {
|
|
1055
1072
|
case 0:
|
|
1056
1073
|
onChange = jest.fn();
|
|
1057
1074
|
onBlur = jest.fn();
|
|
1058
|
-
|
|
1075
|
+
_render37 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_TextInput["default"], {
|
|
1059
1076
|
label: "Autocomplete Countries",
|
|
1060
1077
|
suggestions: countries,
|
|
1061
1078
|
onChange: onChange,
|
|
1062
1079
|
onBlur: onBlur,
|
|
1063
1080
|
minLength: 5,
|
|
1064
1081
|
maxLength: 10
|
|
1065
|
-
})), getByText =
|
|
1082
|
+
})), getByText = _render37.getByText, getByRole = _render37.getByRole;
|
|
1066
1083
|
input = getByRole("combobox");
|
|
1067
1084
|
_react2.fireEvent.focus(input);
|
|
1068
1085
|
_context23.next = 7;
|
|
@@ -1110,13 +1127,13 @@ describe("TextInput component synchronous autosuggest tests", function () {
|
|
|
1110
1127
|
})));
|
|
1111
1128
|
test("Autosuggest keys: arrow down key opens autosuggest, active first option is selected with Enter and closes the autosuggest", function () {
|
|
1112
1129
|
var onChange = jest.fn();
|
|
1113
|
-
var
|
|
1130
|
+
var _render38 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_TextInput["default"], {
|
|
1114
1131
|
label: "Autocomplete Countries",
|
|
1115
1132
|
suggestions: countries,
|
|
1116
1133
|
onChange: onChange
|
|
1117
1134
|
})),
|
|
1118
|
-
getByRole =
|
|
1119
|
-
queryByRole =
|
|
1135
|
+
getByRole = _render38.getByRole,
|
|
1136
|
+
queryByRole = _render38.queryByRole;
|
|
1120
1137
|
var input = getByRole("combobox");
|
|
1121
1138
|
_react2.fireEvent.keyDown(input, {
|
|
1122
1139
|
key: "ArrowDown",
|
|
@@ -1137,13 +1154,13 @@ describe("TextInput component synchronous autosuggest tests", function () {
|
|
|
1137
1154
|
});
|
|
1138
1155
|
test("Autosuggest keys: arrow up key opens autosuggest, active last option is selected with Enter and closes the autosuggest", function () {
|
|
1139
1156
|
var onChange = jest.fn();
|
|
1140
|
-
var
|
|
1157
|
+
var _render39 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_TextInput["default"], {
|
|
1141
1158
|
label: "Autocomplete Countries",
|
|
1142
1159
|
suggestions: countries,
|
|
1143
1160
|
onChange: onChange
|
|
1144
1161
|
})),
|
|
1145
|
-
getByRole =
|
|
1146
|
-
queryByRole =
|
|
1162
|
+
getByRole = _render39.getByRole,
|
|
1163
|
+
queryByRole = _render39.queryByRole;
|
|
1147
1164
|
var input = getByRole("combobox");
|
|
1148
1165
|
_react2.fireEvent.keyDown(input, {
|
|
1149
1166
|
key: "ArrowUp",
|
|
@@ -1164,13 +1181,13 @@ describe("TextInput component synchronous autosuggest tests", function () {
|
|
|
1164
1181
|
});
|
|
1165
1182
|
test("Autosuggest keys: Esc key closes the autosuggest and cleans the input", function () {
|
|
1166
1183
|
var onChange = jest.fn();
|
|
1167
|
-
var
|
|
1184
|
+
var _render40 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_TextInput["default"], {
|
|
1168
1185
|
label: "Autocomplete Countries",
|
|
1169
1186
|
suggestions: countries,
|
|
1170
1187
|
onChange: onChange
|
|
1171
1188
|
})),
|
|
1172
|
-
getByRole =
|
|
1173
|
-
queryByRole =
|
|
1189
|
+
getByRole = _render40.getByRole,
|
|
1190
|
+
queryByRole = _render40.queryByRole;
|
|
1174
1191
|
var input = getByRole("combobox");
|
|
1175
1192
|
_react2.fireEvent.focus(input);
|
|
1176
1193
|
_userEvent["default"].type(input, "Bangla");
|
|
@@ -1187,13 +1204,13 @@ describe("TextInput component synchronous autosuggest tests", function () {
|
|
|
1187
1204
|
});
|
|
1188
1205
|
test("Autosuggest keys: Enter, if no active suggestion closes the autosuggest", function () {
|
|
1189
1206
|
var onChange = jest.fn();
|
|
1190
|
-
var
|
|
1207
|
+
var _render41 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_TextInput["default"], {
|
|
1191
1208
|
label: "Autocomplete Countries",
|
|
1192
1209
|
suggestions: countries,
|
|
1193
1210
|
onChange: onChange
|
|
1194
1211
|
})),
|
|
1195
|
-
getByRole =
|
|
1196
|
-
queryByRole =
|
|
1212
|
+
getByRole = _render41.getByRole,
|
|
1213
|
+
queryByRole = _render41.queryByRole;
|
|
1197
1214
|
var input = getByRole("combobox");
|
|
1198
1215
|
_react2.fireEvent.focus(input);
|
|
1199
1216
|
var list = getByRole("listbox");
|
|
@@ -1208,16 +1225,16 @@ describe("TextInput component synchronous autosuggest tests", function () {
|
|
|
1208
1225
|
expect(queryByRole("list")).toBeFalsy();
|
|
1209
1226
|
});
|
|
1210
1227
|
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,
|
|
1228
|
+
var onChange, _render42, getByRole, queryByRole, input;
|
|
1212
1229
|
return _regenerator["default"].wrap(function _callee25$(_context25) {
|
|
1213
1230
|
while (1) switch (_context25.prev = _context25.next) {
|
|
1214
1231
|
case 0:
|
|
1215
1232
|
onChange = jest.fn();
|
|
1216
|
-
|
|
1233
|
+
_render42 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_TextInput["default"], {
|
|
1217
1234
|
label: "Autocomplete Countries",
|
|
1218
1235
|
suggestions: countries,
|
|
1219
1236
|
onChange: onChange
|
|
1220
|
-
})), getByRole =
|
|
1237
|
+
})), getByRole = _render42.getByRole, queryByRole = _render42.queryByRole;
|
|
1221
1238
|
input = getByRole("combobox");
|
|
1222
1239
|
_react2.fireEvent.focus(input);
|
|
1223
1240
|
_context25.next = 6;
|
|
@@ -1275,13 +1292,13 @@ describe("TextInput component synchronous autosuggest tests", function () {
|
|
|
1275
1292
|
})));
|
|
1276
1293
|
test("Autosuggest escapes special characters", function () {
|
|
1277
1294
|
var onChange = jest.fn();
|
|
1278
|
-
var
|
|
1295
|
+
var _render43 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_TextInput["default"], {
|
|
1279
1296
|
label: "Autocomplete Countries",
|
|
1280
1297
|
suggestions: specialCharacters,
|
|
1281
1298
|
onChange: onChange
|
|
1282
1299
|
})),
|
|
1283
|
-
getAllByText =
|
|
1284
|
-
getByRole =
|
|
1300
|
+
getAllByText = _render43.getAllByText,
|
|
1301
|
+
getByRole = _render43.getByRole;
|
|
1285
1302
|
var input = getByRole("combobox");
|
|
1286
1303
|
_react2.fireEvent.focus(input);
|
|
1287
1304
|
var list = getByRole("listbox");
|
|
@@ -1352,7 +1369,7 @@ describe("TextInput component synchronous autosuggest tests", function () {
|
|
|
1352
1369
|
});
|
|
1353
1370
|
describe("TextInput component asynchronous autosuggest tests", function () {
|
|
1354
1371
|
test("Autosuggest 'Searching...' message is shown", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee27() {
|
|
1355
|
-
var callbackFunc, onChange,
|
|
1372
|
+
var callbackFunc, onChange, _render44, getByRole, getByText, input;
|
|
1356
1373
|
return _regenerator["default"].wrap(function _callee27$(_context27) {
|
|
1357
1374
|
while (1) switch (_context27.prev = _context27.next) {
|
|
1358
1375
|
case 0:
|
|
@@ -1367,11 +1384,11 @@ describe("TextInput component asynchronous autosuggest tests", function () {
|
|
|
1367
1384
|
return result;
|
|
1368
1385
|
});
|
|
1369
1386
|
onChange = jest.fn();
|
|
1370
|
-
|
|
1387
|
+
_render44 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_TextInput["default"], {
|
|
1371
1388
|
label: "Autosuggest Countries",
|
|
1372
1389
|
suggestions: callbackFunc,
|
|
1373
1390
|
onChange: onChange
|
|
1374
|
-
})), getByRole =
|
|
1391
|
+
})), getByRole = _render44.getByRole, getByText = _render44.getByText;
|
|
1375
1392
|
input = getByRole("combobox");
|
|
1376
1393
|
_react2.fireEvent.focus(input);
|
|
1377
1394
|
expect(getByRole("listbox")).toBeTruthy();
|
|
@@ -1434,14 +1451,14 @@ describe("TextInput component asynchronous autosuggest tests", function () {
|
|
|
1434
1451
|
return result;
|
|
1435
1452
|
});
|
|
1436
1453
|
var onChange = jest.fn();
|
|
1437
|
-
var
|
|
1454
|
+
var _render45 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_TextInput["default"], {
|
|
1438
1455
|
label: "Autosuggest Countries",
|
|
1439
1456
|
suggestions: callbackFunc,
|
|
1440
1457
|
onChange: onChange
|
|
1441
1458
|
})),
|
|
1442
|
-
getByRole =
|
|
1443
|
-
queryByText =
|
|
1444
|
-
queryByRole =
|
|
1459
|
+
getByRole = _render45.getByRole,
|
|
1460
|
+
queryByText = _render45.queryByText,
|
|
1461
|
+
queryByRole = _render45.queryByRole;
|
|
1445
1462
|
var input = getByRole("combobox");
|
|
1446
1463
|
_react2.fireEvent.focus(input);
|
|
1447
1464
|
expect(getByRole("listbox")).toBeTruthy();
|
|
@@ -1457,7 +1474,7 @@ describe("TextInput component asynchronous autosuggest tests", function () {
|
|
|
1457
1474
|
expect(input.value).toBe("");
|
|
1458
1475
|
});
|
|
1459
1476
|
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,
|
|
1477
|
+
var callbackFunc, onChange, _render46, getByRole, getByText, queryByText, queryByRole, input, list;
|
|
1461
1478
|
return _regenerator["default"].wrap(function _callee28$(_context28) {
|
|
1462
1479
|
while (1) switch (_context28.prev = _context28.next) {
|
|
1463
1480
|
case 0:
|
|
@@ -1472,11 +1489,11 @@ describe("TextInput component asynchronous autosuggest tests", function () {
|
|
|
1472
1489
|
return result;
|
|
1473
1490
|
});
|
|
1474
1491
|
onChange = jest.fn();
|
|
1475
|
-
|
|
1492
|
+
_render46 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_TextInput["default"], {
|
|
1476
1493
|
label: "Autosuggest Countries",
|
|
1477
1494
|
suggestions: callbackFunc,
|
|
1478
1495
|
onChange: onChange
|
|
1479
|
-
})), getByRole =
|
|
1496
|
+
})), getByRole = _render46.getByRole, getByText = _render46.getByText, queryByText = _render46.queryByText, queryByRole = _render46.queryByRole;
|
|
1480
1497
|
input = getByRole("combobox");
|
|
1481
1498
|
_react2.fireEvent.focus(input);
|
|
1482
1499
|
list = getByRole("listbox");
|
|
@@ -1514,7 +1531,7 @@ describe("TextInput component asynchronous autosuggest tests", function () {
|
|
|
1514
1531
|
}, _callee28);
|
|
1515
1532
|
})));
|
|
1516
1533
|
test("Asynchronous uncontrolled autosuggest test", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee29() {
|
|
1517
|
-
var callbackFunc, onChange,
|
|
1534
|
+
var callbackFunc, onChange, _render47, getByRole, getByText, input;
|
|
1518
1535
|
return _regenerator["default"].wrap(function _callee29$(_context29) {
|
|
1519
1536
|
while (1) switch (_context29.prev = _context29.next) {
|
|
1520
1537
|
case 0:
|
|
@@ -1529,11 +1546,11 @@ describe("TextInput component asynchronous autosuggest tests", function () {
|
|
|
1529
1546
|
return result;
|
|
1530
1547
|
});
|
|
1531
1548
|
onChange = jest.fn();
|
|
1532
|
-
|
|
1549
|
+
_render47 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_TextInput["default"], {
|
|
1533
1550
|
label: "Autosuggest Countries",
|
|
1534
1551
|
onChange: onChange,
|
|
1535
1552
|
suggestions: callbackFunc
|
|
1536
|
-
})), getByRole =
|
|
1553
|
+
})), getByRole = _render47.getByRole, getByText = _render47.getByText;
|
|
1537
1554
|
input = getByRole("combobox");
|
|
1538
1555
|
_react2.fireEvent.focus(input);
|
|
1539
1556
|
_userEvent["default"].type(input, "Den");
|
|
@@ -1557,7 +1574,7 @@ describe("TextInput component asynchronous autosuggest tests", function () {
|
|
|
1557
1574
|
}, _callee29);
|
|
1558
1575
|
})));
|
|
1559
1576
|
test("Asynchronous controlled autosuggest test", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee30() {
|
|
1560
|
-
var callbackFunc, onChange,
|
|
1577
|
+
var callbackFunc, onChange, _render48, getByRole, getByText, queryByRole, input;
|
|
1561
1578
|
return _regenerator["default"].wrap(function _callee30$(_context30) {
|
|
1562
1579
|
while (1) switch (_context30.prev = _context30.next) {
|
|
1563
1580
|
case 0:
|
|
@@ -1572,12 +1589,12 @@ describe("TextInput component asynchronous autosuggest tests", function () {
|
|
|
1572
1589
|
return result;
|
|
1573
1590
|
});
|
|
1574
1591
|
onChange = jest.fn();
|
|
1575
|
-
|
|
1592
|
+
_render48 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_TextInput["default"], {
|
|
1576
1593
|
label: "Autosuggest Countries",
|
|
1577
1594
|
value: "Denm",
|
|
1578
1595
|
onChange: onChange,
|
|
1579
1596
|
suggestions: callbackFunc
|
|
1580
|
-
})), getByRole =
|
|
1597
|
+
})), getByRole = _render48.getByRole, getByText = _render48.getByText, queryByRole = _render48.queryByRole;
|
|
1581
1598
|
input = getByRole("combobox");
|
|
1582
1599
|
expect(input.value).toBe("Denm");
|
|
1583
1600
|
_context30.next = 7;
|
|
@@ -1604,7 +1621,7 @@ describe("TextInput component asynchronous autosuggest tests", function () {
|
|
|
1604
1621
|
}, _callee30);
|
|
1605
1622
|
})));
|
|
1606
1623
|
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,
|
|
1624
|
+
var callbackFunc, onChange, _render49, getByText, getByRole, queryByRole, input;
|
|
1608
1625
|
return _regenerator["default"].wrap(function _callee32$(_context32) {
|
|
1609
1626
|
while (1) switch (_context32.prev = _context32.next) {
|
|
1610
1627
|
case 0:
|
|
@@ -1619,11 +1636,11 @@ describe("TextInput component asynchronous autosuggest tests", function () {
|
|
|
1619
1636
|
return result;
|
|
1620
1637
|
});
|
|
1621
1638
|
onChange = jest.fn();
|
|
1622
|
-
|
|
1639
|
+
_render49 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_TextInput["default"], {
|
|
1623
1640
|
label: "Autosuggest Countries",
|
|
1624
1641
|
onChange: onChange,
|
|
1625
1642
|
suggestions: callbackFunc
|
|
1626
|
-
})), getByText =
|
|
1643
|
+
})), getByText = _render49.getByText, getByRole = _render49.getByRole, queryByRole = _render49.queryByRole;
|
|
1627
1644
|
input = getByRole("combobox");
|
|
1628
1645
|
_react2.fireEvent.focus(input);
|
|
1629
1646
|
_context32.next = 7;
|
|
@@ -1652,7 +1669,7 @@ describe("TextInput component asynchronous autosuggest tests", function () {
|
|
|
1652
1669
|
}, _callee32);
|
|
1653
1670
|
})));
|
|
1654
1671
|
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,
|
|
1672
|
+
var callbackFunc, onChange, _render50, getByText, getByRole, queryByRole, input;
|
|
1656
1673
|
return _regenerator["default"].wrap(function _callee33$(_context33) {
|
|
1657
1674
|
while (1) switch (_context33.prev = _context33.next) {
|
|
1658
1675
|
case 0:
|
|
@@ -1667,11 +1684,11 @@ describe("TextInput component asynchronous autosuggest tests", function () {
|
|
|
1667
1684
|
return result;
|
|
1668
1685
|
});
|
|
1669
1686
|
onChange = jest.fn();
|
|
1670
|
-
|
|
1687
|
+
_render50 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_TextInput["default"], {
|
|
1671
1688
|
label: "Autosuggest Countries",
|
|
1672
1689
|
onChange: onChange,
|
|
1673
1690
|
suggestions: callbackFunc
|
|
1674
|
-
})), getByText =
|
|
1691
|
+
})), getByText = _render50.getByText, getByRole = _render50.getByRole, queryByRole = _render50.queryByRole;
|
|
1675
1692
|
input = getByRole("combobox");
|
|
1676
1693
|
_react2.fireEvent.focus(input);
|
|
1677
1694
|
_userEvent["default"].type(input, "wrong");
|
|
@@ -1704,7 +1721,7 @@ describe("TextInput component asynchronous autosuggest tests", function () {
|
|
|
1704
1721
|
}, _callee33);
|
|
1705
1722
|
})));
|
|
1706
1723
|
test("Asynchronous autosuggest request failed, shows 'Error fetching data' message", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee34() {
|
|
1707
|
-
var errorCallbackFunc, onChange,
|
|
1724
|
+
var errorCallbackFunc, onChange, _render51, getByRole, getByText, input;
|
|
1708
1725
|
return _regenerator["default"].wrap(function _callee34$(_context34) {
|
|
1709
1726
|
while (1) switch (_context34.prev = _context34.next) {
|
|
1710
1727
|
case 0:
|
|
@@ -1717,11 +1734,11 @@ describe("TextInput component asynchronous autosuggest tests", function () {
|
|
|
1717
1734
|
return result;
|
|
1718
1735
|
});
|
|
1719
1736
|
onChange = jest.fn();
|
|
1720
|
-
|
|
1737
|
+
_render51 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_TextInput["default"], {
|
|
1721
1738
|
label: "Autosuggest Countries",
|
|
1722
1739
|
onChange: onChange,
|
|
1723
1740
|
suggestions: errorCallbackFunc
|
|
1724
|
-
})), getByRole =
|
|
1741
|
+
})), getByRole = _render51.getByRole, getByText = _render51.getByText;
|
|
1725
1742
|
input = getByRole("combobox");
|
|
1726
1743
|
_react2.fireEvent.focus(input);
|
|
1727
1744
|
_context34.next = 7;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|