intelicoreact 1.5.40 → 1.5.41
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/package.json +1 -1
- package/dist/Atomic/FormElements/ActionAlert/ActionAlert.interface.js +0 -4
- package/dist/Atomic/FormElements/ActionAlert/ActionAlert.stories.js +0 -89
- package/dist/Atomic/FormElements/ActionAlert/ActionAlert.test.js +0 -130
- package/dist/Atomic/FormElements/ActionAlert/index.js +0 -17
- package/dist/Atomic/FormElements/AdvancedStatus/AdvancedStatus.interface.js +0 -4
- package/dist/Atomic/FormElements/AdvancedStatus/AdvancedStatus.stories.js +0 -81
- package/dist/Atomic/FormElements/AdvancedStatus/AdvancedStatus.test.js +0 -104
- package/dist/Atomic/FormElements/AdvancedStatus/index.js +0 -17
- package/dist/Atomic/FormElements/Calendar/Calendar.props.js +0 -4
- package/dist/Atomic/FormElements/Calendar/Calendar.stories.js +0 -108
- package/dist/Atomic/FormElements/CheckboxInput/CheckboxInput.interface.js +0 -4
- package/dist/Atomic/FormElements/CheckboxInput/CheckboxInput.stories.js +0 -100
- package/dist/Atomic/FormElements/CheckboxInput/CheckboxInput.test.js +0 -143
- package/dist/Atomic/FormElements/CheckboxInput/index.js +0 -17
- package/dist/Atomic/FormElements/CheckboxesLine/CheckboxesLine.interface.js +0 -4
- package/dist/Atomic/FormElements/CheckboxesLine/CheckboxesLine.stories.js +0 -94
- package/dist/Atomic/FormElements/CheckboxesLine/CheckboxesLine.test.js +0 -177
- package/dist/Atomic/FormElements/CheckboxesLine/index.js +0 -17
- package/dist/Atomic/FormElements/Datepicker/Datepicker.stories.js +0 -51
- package/dist/Atomic/FormElements/Dropdown/Dropdown.stories.js +0 -596
- package/dist/Atomic/FormElements/DropdownLiveSearch/DropdownLiveSearch.stories.js +0 -272
- package/dist/Atomic/FormElements/FileLoader/FileLoader.stories.js +0 -182
- package/dist/Atomic/FormElements/FileLoaderDescription/FileLoaderDescription.stories.js +0 -327
- package/dist/Atomic/FormElements/FileLoaderLocal/FileLoaderLocal.stories.js +0 -186
- package/dist/Atomic/FormElements/FileLoaderLocalGroup/FileLoaderLocalGroup.stories.js +0 -84
- package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN.stories.js +0 -107
- package/dist/Atomic/FormElements/Input/Input.stories.js +0 -251
- package/dist/Atomic/FormElements/InputCalendar/InputCalendar.stories.js +0 -115
- package/dist/Atomic/FormElements/InputColor/InputColor.stories.js +0 -119
- package/dist/Atomic/FormElements/InputCurrency/InputCurrency.interface.js +0 -4
- package/dist/Atomic/FormElements/InputCurrency/InputCurrency.stories.js +0 -178
- package/dist/Atomic/FormElements/InputCurrency/InputCurrency.test.js +0 -129
- package/dist/Atomic/FormElements/InputCurrency/index.js +0 -16
- package/dist/Atomic/FormElements/InputDateRange/InputDateRange.stories.js +0 -123
- package/dist/Atomic/FormElements/InputLink/InputLink.stories.js +0 -140
- package/dist/Atomic/FormElements/InputMask/InputMask.stories.js +0 -303
- package/dist/Atomic/FormElements/InputMask2/InputMask2.stories.js +0 -314
- package/dist/Atomic/FormElements/InputMask3/InputMask3.stories.js +0 -335
- package/dist/Atomic/FormElements/InputWithAction/InputWithAction.stories.js +0 -276
- package/dist/Atomic/FormElements/InputsRow/InputsRow.stories.js +0 -56
- package/dist/Atomic/FormElements/Label/Label.interface.js +0 -4
- package/dist/Atomic/FormElements/Label/Label.stories.js +0 -47
- package/dist/Atomic/FormElements/Label/Label.test.js +0 -167
- package/dist/Atomic/FormElements/Label/index.js +0 -17
- package/dist/Atomic/FormElements/MobileCalendar/MobileCalendar.stories.js +0 -172
- package/dist/Atomic/FormElements/MultiSelect/MultiSelect.stories.js +0 -121
- package/dist/Atomic/FormElements/NumericInput/NumericInput.stories.js +0 -184
- package/dist/Atomic/FormElements/RadioGroup/RadioGroup.stories.js +0 -79
- package/dist/Atomic/FormElements/RadioGroupWithInput/RadioGroupWithInput.stories.js +0 -151
- package/dist/Atomic/FormElements/RadioInput/RadioInput.stories.js +0 -67
- package/dist/Atomic/FormElements/RadioRowSwitcher/RadioRowSwitcher.stories.js +0 -116
- package/dist/Atomic/FormElements/RangeCalendar/RangeCalendar.stories.js +0 -107
- package/dist/Atomic/FormElements/RangeInputs/RangeInputs.stories.js +0 -92
- package/dist/Atomic/FormElements/RangeList/RangeList.stories.js +0 -169
- package/dist/Atomic/FormElements/RangeSlider/RangeSlider.stories.js +0 -401
- package/dist/Atomic/FormElements/RangeSlider2/RangeSlider2.stories.js +0 -314
- package/dist/Atomic/FormElements/SwitchableRow/SwitchableRow.stories.js +0 -137
- package/dist/Atomic/FormElements/Switcher/Switcher.stories.js +0 -91
- package/dist/Atomic/FormElements/SwitcherCheckbox/SwitcherCheckbox.stories.js +0 -104
- package/dist/Atomic/FormElements/SwitcherHide/SwitcherHide.stories.js +0 -96
- package/dist/Atomic/FormElements/SwitcherRadio/SwitcherRadio.stories.js +0 -140
- package/dist/Atomic/FormElements/SwitcherRange/SwitcherRange.stories.js +0 -112
- package/dist/Atomic/FormElements/SwitcherRangeList/SwitcherRangeList.stories.js +0 -145
- package/dist/Atomic/FormElements/SwitcherTagsDropdown/SwitcherTagsDropdown.stories.js +0 -158
- package/dist/Atomic/FormElements/SwitcherTextarea/SwitcherTextarea.stories.js +0 -101
- package/dist/Atomic/FormElements/TagListToDropdown/TagListToDropdown.stories.js +0 -131
- package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.stories.js +0 -357
- package/dist/Atomic/FormElements/Text/Text.stories.js +0 -80
- package/dist/Atomic/FormElements/TextSwitcher/TextSwitcher.stories.js +0 -106
- package/dist/Atomic/FormElements/TextSwitcher/TextSwitcher.test.js +0 -93
- package/dist/Atomic/FormElements/Textarea/Textarea.stories.js +0 -103
- package/dist/Atomic/FormElements/TieredCheckboxes/TieredCheckboxes.stories.js +0 -174
- package/dist/Atomic/FormElements/TimeRange/TimeRange.interface.js +0 -4
- package/dist/Atomic/FormElements/TimeRange/TimeRange.stories.js +0 -40
- package/dist/Atomic/FormElements/TimeRange/TimeRange.test.js +0 -163
- package/dist/Atomic/FormElements/TimeRange/index.js +0 -17
- package/dist/Atomic/FormElements/UserContacts/UserContact.test.js +0 -381
- package/dist/Atomic/FormElements/UserContacts/UserContacts.interface.js +0 -4
- package/dist/Atomic/FormElements/UserContacts/UserContacts.stories.js +0 -74
- package/dist/Atomic/FormElements/UserContacts/index.js +0 -17
- package/dist/Atomic/FormElements/VariantsListRadio/VariantsListRadio.stories.js +0 -193
- package/dist/Atomic/FormElements/WidgetPseudoTable/WidgetPseudoTable.stories.js +0 -147
- package/dist/Atomic/FormElements/WidgetWithSwitchableRows/WidgetWithSwitchableRows.stories.js +0 -151
- package/dist/Atomic/Layout/Header/Header.stories.js +0 -71
- package/dist/Atomic/Layout/MainMenu/MainMenu.stories.js +0 -115
- package/dist/Atomic/Layout/Spinner/Spinner.interface.js +0 -4
- package/dist/Atomic/Layout/Spinner/Spinner.stories.js +0 -46
- package/dist/Atomic/Layout/Spinner/Spinner.test.js +0 -54
- package/dist/Atomic/Layout/Spinner/index.js +0 -17
- package/dist/Atomic/UI/Accordion/Accordion.interface.js +0 -4
- package/dist/Atomic/UI/Accordion/Accordion.stories.js +0 -168
- package/dist/Atomic/UI/Accordion/Accordion.test.js +0 -54
- package/dist/Atomic/UI/Accordion/AccordionItem.test.js +0 -50
- package/dist/Atomic/UI/Accordion/index.js +0 -17
- package/dist/Atomic/UI/AccordionTable/AccordionTable.stories.js +0 -268
- package/dist/Atomic/UI/AccordionText/AccordionText.stories.js +0 -125
- package/dist/Atomic/UI/AdvancedTag/AdvancedTags.stories.js +0 -115
- package/dist/Atomic/UI/Alert/Alert.stories.js +0 -81
- package/dist/Atomic/UI/Arrow/Arrow.stories.js +0 -62
- package/dist/Atomic/UI/Box/Box.stories.js +0 -114
- package/dist/Atomic/UI/Button/Button.stories.js +0 -105
- package/dist/Atomic/UI/Button/Button.test.js +0 -147
- package/dist/Atomic/UI/ButtonsBar/ButtonsBar.stories.js +0 -129
- package/dist/Atomic/UI/Chart/Chart.stories.js +0 -93
- package/dist/Atomic/UI/CircleProgressBar/CircleProgressBar.stories.js +0 -85
- package/dist/Atomic/UI/DateTime/DateTime.stories.js +0 -50
- package/dist/Atomic/UI/DoubleString/DoubleString.stories.js +0 -79
- package/dist/Atomic/UI/DynamicIcon/DynamicIcon.interface.js +0 -4
- package/dist/Atomic/UI/DynamicIcon/DynamicIcon.stories.js +0 -98
- package/dist/Atomic/UI/DynamicIcon/DynamicIcon.test.js +0 -51
- package/dist/Atomic/UI/DynamicIcon/index.js +0 -17
- package/dist/Atomic/UI/ExampleChartIntegration/ExampleChartIntegration.stories.js +0 -98
- package/dist/Atomic/UI/Hint/Hint.stories.js +0 -101
- package/dist/Atomic/UI/Hint/index.js +0 -16
- package/dist/Atomic/UI/Modal/Modal.interface.js +0 -4
- package/dist/Atomic/UI/Modal/Modal.stories.js +0 -370
- package/dist/Atomic/UI/Modal/ModalHOC.stories.js +0 -191
- package/dist/Atomic/UI/Modal/ModalHOC.test.js +0 -187
- package/dist/Atomic/UI/Modal/index.js +0 -26
- package/dist/Atomic/UI/Modal/partials/ModalFooter.test.js +0 -118
- package/dist/Atomic/UI/Modal/partials/ModalTitle.test.js +0 -126
- package/dist/Atomic/UI/Modal/partials/useMobileModal.test.js +0 -133
- package/dist/Atomic/UI/MonoAccordion/MonoAccordion.interface.js +0 -4
- package/dist/Atomic/UI/MonoAccordion/MonoAccordion.stories.js +0 -513
- package/dist/Atomic/UI/MonoAccordion/MonoAccordion.test.js +0 -84
- package/dist/Atomic/UI/MonoAccordion/index.js +0 -17
- package/dist/Atomic/UI/NavLine/NavLine.interface.js +0 -4
- package/dist/Atomic/UI/NavLine/NavLine.stories.js +0 -434
- package/dist/Atomic/UI/NavLine/NavLine.test.js +0 -311
- package/dist/Atomic/UI/NavLine/index.js +0 -17
- package/dist/Atomic/UI/PageTitle/PageTitle.interface.js +0 -4
- package/dist/Atomic/UI/PageTitle/PageTitle.stories.js +0 -62
- package/dist/Atomic/UI/PageTitle/PageTitle.test.js +0 -181
- package/dist/Atomic/UI/PageTitle/index.js +0 -17
- package/dist/Atomic/UI/PieChart/PieChar.interface.js +0 -4
- package/dist/Atomic/UI/PieChart/PieChart.stories.js +0 -82
- package/dist/Atomic/UI/PieChart/PieChart.test.js +0 -142
- package/dist/Atomic/UI/PieChart/index.js +0 -26
- package/dist/Atomic/UI/Price/Price.interface.js +0 -4
- package/dist/Atomic/UI/Price/Price.stories.js +0 -52
- package/dist/Atomic/UI/Price/Price.test.js +0 -83
- package/dist/Atomic/UI/Price/index.js +0 -17
- package/dist/Atomic/UI/PriceRange/PriceRange.interface.js +0 -4
- package/dist/Atomic/UI/PriceRange/PriceRange.stories.js +0 -51
- package/dist/Atomic/UI/PriceRange/PriceRange.test.js +0 -72
- package/dist/Atomic/UI/PriceRange/index.js +0 -17
- package/dist/Atomic/UI/ProgressLine/ProgressLine.interface.js +0 -4
- package/dist/Atomic/UI/ProgressLine/ProgressLine.stories.js +0 -163
- package/dist/Atomic/UI/ProgressLine/ProgressLine.test.js +0 -60
- package/dist/Atomic/UI/ProgressLine/index.js +0 -17
- package/dist/Atomic/UI/Status/Status.interface.js +0 -4
- package/dist/Atomic/UI/Status/Status.stories.js +0 -79
- package/dist/Atomic/UI/Status/Status.test.js +0 -103
- package/dist/Atomic/UI/Status/index.js +0 -17
- package/dist/Atomic/UI/Table/Table.stories.js +0 -250
- package/dist/Atomic/UI/Tag/Tag.interface.js +0 -4
- package/dist/Atomic/UI/Tag/Tag.stories.js +0 -108
- package/dist/Atomic/UI/Tag/Tag.test.js +0 -75
- package/dist/Atomic/UI/Tag/index.js +0 -17
- package/dist/Atomic/UI/TagList/TagList.stories.js +0 -169
- package/dist/Atomic/UI/UserBox/UserBox.interface.js +0 -4
- package/dist/Atomic/UI/UserBox/UserBox.stories.js +0 -57
- package/dist/Atomic/UI/UserBox/UserBox.test.js +0 -136
- package/dist/Atomic/UI/UserBox/index.js +0 -17
- package/dist/Atomic/UI/WizardStepper/WizardStepper.stories.js +0 -70
- package/dist/Functions/useIsMobile/index.js +0 -17
- package/dist/Functions/useIsMobile/useIsMobile.js +0 -33
- package/dist/Functions/useIsMobile/useIsMobile.test.js +0 -104
- package/dist/Functions/useKeyPress/useHandleKeyPress.test.js +0 -96
- package/dist/Functions/useKeyPress/useKeyPress.test.js +0 -87
- package/dist/Molecular/FormElement/FormElement.stories.js +0 -92
- package/dist/Molecular/FormWithDependOn/FormWithDependOn.stories.js +0 -301
- package/dist/Molecular/InputAddress/InputAddress.stories.js +0 -541
- package/dist/Molecular/InputPassword/InputPassword.stories.js +0 -86
- package/dist/types/base.interface.js +0 -4
- package/dist/types/base.types.js +0 -4
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
const _jsxruntime = require("react/jsx-runtime");
|
|
6
|
-
const _react = require("@testing-library/react");
|
|
7
|
-
require("@testing-library/jest-dom");
|
|
8
|
-
const _CheckboxInput = /*#__PURE__*/ _interop_require_default(require("./CheckboxInput"));
|
|
9
|
-
function _interop_require_default(obj) {
|
|
10
|
-
return obj && obj.__esModule ? obj : {
|
|
11
|
-
default: obj
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
describe('checkboxInput Component', ()=>{
|
|
15
|
-
const defaultProps = {
|
|
16
|
-
onChange: jest.fn(),
|
|
17
|
-
label: 'Test Label',
|
|
18
|
-
id: 'test-id'
|
|
19
|
-
};
|
|
20
|
-
beforeEach(()=>{
|
|
21
|
-
jest.clearAllMocks();
|
|
22
|
-
});
|
|
23
|
-
it('renders correctly with minimal props', ()=>{
|
|
24
|
-
(0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_CheckboxInput.default, {
|
|
25
|
-
...defaultProps
|
|
26
|
-
}));
|
|
27
|
-
expect(_react.screen.getByTestId('checkbox-input')).toBeInTheDocument();
|
|
28
|
-
});
|
|
29
|
-
it('renders with label', ()=>{
|
|
30
|
-
const label = 'Test Label';
|
|
31
|
-
(0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_CheckboxInput.default, {
|
|
32
|
-
...defaultProps,
|
|
33
|
-
label: label
|
|
34
|
-
}));
|
|
35
|
-
expect(_react.screen.getByText(label)).toBeInTheDocument();
|
|
36
|
-
});
|
|
37
|
-
it('handles onChange event', ()=>{
|
|
38
|
-
(0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_CheckboxInput.default, {
|
|
39
|
-
...defaultProps,
|
|
40
|
-
value: false
|
|
41
|
-
}));
|
|
42
|
-
const checkbox = _react.screen.getByTestId('checkbox-input-input');
|
|
43
|
-
_react.fireEvent.click(checkbox);
|
|
44
|
-
expect(defaultProps.onChange).toHaveBeenCalledWith(true, expect.any(Object));
|
|
45
|
-
});
|
|
46
|
-
it('applies disabled state correctly', ()=>{
|
|
47
|
-
(0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_CheckboxInput.default, {
|
|
48
|
-
...defaultProps,
|
|
49
|
-
disabled: true
|
|
50
|
-
}));
|
|
51
|
-
expect(_react.screen.getByTestId('checkbox-input')).toHaveClass('checkbox-input_disabled');
|
|
52
|
-
expect(_react.screen.getByTestId('checkbox-input-input')).toBeDisabled();
|
|
53
|
-
});
|
|
54
|
-
it('applies checked state correctly', ()=>{
|
|
55
|
-
(0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_CheckboxInput.default, {
|
|
56
|
-
...defaultProps,
|
|
57
|
-
value: true
|
|
58
|
-
}));
|
|
59
|
-
expect(_react.screen.getByTestId('checkbox-input-input')).toBeChecked();
|
|
60
|
-
expect(_react.screen.getByTestId('checkbox-input').querySelector('.checkbox-input__input')).toHaveClass('checkbox-input__input_checked');
|
|
61
|
-
});
|
|
62
|
-
it('applies indeterminate state correctly', ()=>{
|
|
63
|
-
(0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_CheckboxInput.default, {
|
|
64
|
-
...defaultProps,
|
|
65
|
-
isStark: true
|
|
66
|
-
}));
|
|
67
|
-
const input = _react.screen.getByTestId('checkbox-input-input');
|
|
68
|
-
expect(input.indeterminate).toBe(true);
|
|
69
|
-
expect(_react.screen.getByTestId('checkbox-input').querySelector('.checkbox-input__input')).toHaveClass('checkbox-input__input_indeterminate');
|
|
70
|
-
});
|
|
71
|
-
it('applies custom className', ()=>{
|
|
72
|
-
const customClass = 'custom-class';
|
|
73
|
-
(0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_CheckboxInput.default, {
|
|
74
|
-
...defaultProps,
|
|
75
|
-
className: customClass
|
|
76
|
-
}));
|
|
77
|
-
expect(_react.screen.getByTestId('checkbox-input')).toHaveClass(customClass);
|
|
78
|
-
});
|
|
79
|
-
it('applies custom testId', ()=>{
|
|
80
|
-
const testId = 'custom-test-id';
|
|
81
|
-
(0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_CheckboxInput.default, {
|
|
82
|
-
...defaultProps,
|
|
83
|
-
testId: testId
|
|
84
|
-
}));
|
|
85
|
-
expect(_react.screen.getByTestId(testId)).toBeInTheDocument();
|
|
86
|
-
expect(_react.screen.getByTestId(`${testId}-input`)).toBeInTheDocument();
|
|
87
|
-
});
|
|
88
|
-
it('applies id correctly', ()=>{
|
|
89
|
-
const id = 'test-id';
|
|
90
|
-
(0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_CheckboxInput.default, {
|
|
91
|
-
...defaultProps,
|
|
92
|
-
id: id
|
|
93
|
-
}));
|
|
94
|
-
const input = _react.screen.getByTestId('checkbox-input-input');
|
|
95
|
-
expect(input).toHaveAttribute('id', id);
|
|
96
|
-
expect(input).toHaveAttribute('data-id', id);
|
|
97
|
-
});
|
|
98
|
-
it('applies additional input attributes', ()=>{
|
|
99
|
-
const attributesOfNativeInput = {
|
|
100
|
-
'name': 'test-name',
|
|
101
|
-
'aria-label': 'test-aria-label'
|
|
102
|
-
};
|
|
103
|
-
(0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_CheckboxInput.default, {
|
|
104
|
-
...defaultProps,
|
|
105
|
-
attributesOfNativeInput: attributesOfNativeInput
|
|
106
|
-
}));
|
|
107
|
-
const input = _react.screen.getByTestId('checkbox-input-input');
|
|
108
|
-
expect(input).toHaveAttribute('name', attributesOfNativeInput.name);
|
|
109
|
-
expect(input).toHaveAttribute('aria-label', attributesOfNativeInput['aria-label']);
|
|
110
|
-
});
|
|
111
|
-
it('handles undefined value correctly', ()=>{
|
|
112
|
-
(0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_CheckboxInput.default, {
|
|
113
|
-
...defaultProps,
|
|
114
|
-
value: undefined
|
|
115
|
-
}));
|
|
116
|
-
expect(_react.screen.getByTestId('checkbox-input-input')).not.toBeChecked();
|
|
117
|
-
});
|
|
118
|
-
it('handles toggle from checked to unchecked', ()=>{
|
|
119
|
-
(0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_CheckboxInput.default, {
|
|
120
|
-
...defaultProps,
|
|
121
|
-
value: true
|
|
122
|
-
}));
|
|
123
|
-
const checkbox = _react.screen.getByTestId('checkbox-input-input');
|
|
124
|
-
_react.fireEvent.click(checkbox);
|
|
125
|
-
expect(defaultProps.onChange).toHaveBeenCalledWith(false, expect.any(Object));
|
|
126
|
-
});
|
|
127
|
-
it('prevents change event when disabled', ()=>{
|
|
128
|
-
(0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_CheckboxInput.default, {
|
|
129
|
-
...defaultProps,
|
|
130
|
-
disabled: true,
|
|
131
|
-
id: "test-id",
|
|
132
|
-
value: false
|
|
133
|
-
}));
|
|
134
|
-
const checkbox = _react.screen.getByTestId('checkbox-input-input');
|
|
135
|
-
_react.fireEvent.change(checkbox, {
|
|
136
|
-
target: {
|
|
137
|
-
checked: true
|
|
138
|
-
}
|
|
139
|
-
});
|
|
140
|
-
expect(defaultProps.onChange).not.toHaveBeenCalled();
|
|
141
|
-
expect(checkbox).toBeDisabled();
|
|
142
|
-
});
|
|
143
|
-
});
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "default", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return _default;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _CheckboxInput = /*#__PURE__*/ _interop_require_default(require("./CheckboxInput"));
|
|
12
|
-
function _interop_require_default(obj) {
|
|
13
|
-
return obj && obj.__esModule ? obj : {
|
|
14
|
-
default: obj
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
const _default = _CheckboxInput.default;
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
function _export(target, all) {
|
|
6
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: all[name]
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
_export(exports, {
|
|
12
|
-
TemplateCheckboxesLine: function() {
|
|
13
|
-
return TemplateCheckboxesLine;
|
|
14
|
-
},
|
|
15
|
-
default: function() {
|
|
16
|
-
return _default;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
const _jsxruntime = require("react/jsx-runtime");
|
|
20
|
-
const _react = require("react");
|
|
21
|
-
const _CheckboxesLine = /*#__PURE__*/ _interop_require_default(require("./CheckboxesLine"));
|
|
22
|
-
require("./partial/AnyOuterClass.scss");
|
|
23
|
-
require("../../../../../scss/main.scss");
|
|
24
|
-
function _interop_require_default(obj) {
|
|
25
|
-
return obj && obj.__esModule ? obj : {
|
|
26
|
-
default: obj
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
const _default = {
|
|
30
|
-
title: 'Form Elements/CheckboxesLine',
|
|
31
|
-
component: _CheckboxesLine.default,
|
|
32
|
-
argTypes: {
|
|
33
|
-
items: {
|
|
34
|
-
description: 'array. necessary'
|
|
35
|
-
},
|
|
36
|
-
value: {
|
|
37
|
-
description: 'array'
|
|
38
|
-
},
|
|
39
|
-
disabled: {
|
|
40
|
-
description: 'boolean'
|
|
41
|
-
},
|
|
42
|
-
isPositionColumn: {
|
|
43
|
-
description: 'display checkboxes as column. boolean. optional'
|
|
44
|
-
},
|
|
45
|
-
className: {
|
|
46
|
-
description: 'string. optional'
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
function Template(args) {
|
|
51
|
-
const { isIncludeOuterStyles, ...restArgs } = args;
|
|
52
|
-
const [value, setValue] = (0, _react.useState)(args.value);
|
|
53
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_CheckboxesLine.default, {
|
|
54
|
-
...restArgs,
|
|
55
|
-
className: isIncludeOuterStyles ? 'any-outer-class__checkboxes-line' : '',
|
|
56
|
-
value: value,
|
|
57
|
-
onChange: setValue
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
const TemplateCheckboxesLine = Template.bind({});
|
|
61
|
-
TemplateCheckboxesLine.args = {
|
|
62
|
-
isIncludeOuterStyles: false,
|
|
63
|
-
items: [
|
|
64
|
-
{
|
|
65
|
-
label: ' - 1',
|
|
66
|
-
id: '1'
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
label: ' - 2',
|
|
70
|
-
id: '2'
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
label: ' - 3',
|
|
74
|
-
id: '3'
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
label: ' - 4',
|
|
78
|
-
id: '4'
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
label: ' - 5',
|
|
82
|
-
id: '5'
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
label: ' - 6',
|
|
86
|
-
id: '6',
|
|
87
|
-
disabled: true
|
|
88
|
-
}
|
|
89
|
-
],
|
|
90
|
-
value: [],
|
|
91
|
-
disabled: false,
|
|
92
|
-
isPositionColumn: true,
|
|
93
|
-
className: ''
|
|
94
|
-
};
|
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
const _jsxruntime = require("react/jsx-runtime");
|
|
6
|
-
const _react = require("@testing-library/react");
|
|
7
|
-
const _moment = /*#__PURE__*/ _interop_require_default(require("moment"));
|
|
8
|
-
require("@testing-library/jest-dom");
|
|
9
|
-
const _CheckboxesLine = /*#__PURE__*/ _interop_require_default(require("./CheckboxesLine"));
|
|
10
|
-
function _interop_require_default(obj) {
|
|
11
|
-
return obj && obj.__esModule ? obj : {
|
|
12
|
-
default: obj
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
jest.mock('moment', ()=>{
|
|
16
|
-
const mockMoment = jest.requireActual('moment');
|
|
17
|
-
return (date)=>{
|
|
18
|
-
if (date) {
|
|
19
|
-
return mockMoment(date);
|
|
20
|
-
}
|
|
21
|
-
// Mock current date to ensure consistent testing
|
|
22
|
-
return mockMoment('2024-01-01');
|
|
23
|
-
};
|
|
24
|
-
});
|
|
25
|
-
describe('checkboxesLine Component', ()=>{
|
|
26
|
-
const mockItems = [
|
|
27
|
-
{
|
|
28
|
-
id: '1',
|
|
29
|
-
label: 'Option 1'
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
id: '2',
|
|
33
|
-
label: 'Option 2'
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
id: '3',
|
|
37
|
-
label: 'Option 3'
|
|
38
|
-
}
|
|
39
|
-
];
|
|
40
|
-
const defaultProps = {
|
|
41
|
-
date: (0, _moment.default)('2024-01-01').format('L'),
|
|
42
|
-
setDate: jest.fn(),
|
|
43
|
-
setIsOpened: jest.fn(),
|
|
44
|
-
params: {
|
|
45
|
-
minDate: undefined,
|
|
46
|
-
maxDate: undefined,
|
|
47
|
-
momentMinDate: undefined,
|
|
48
|
-
momentMaxDate: undefined,
|
|
49
|
-
isDontLimitFuture: false
|
|
50
|
-
},
|
|
51
|
-
testId: 'calendar'
|
|
52
|
-
};
|
|
53
|
-
const mockOnChange = jest.fn();
|
|
54
|
-
beforeEach(()=>{
|
|
55
|
-
mockOnChange.mockClear();
|
|
56
|
-
});
|
|
57
|
-
it('renders correctly with items', ()=>{
|
|
58
|
-
(0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_CheckboxesLine.default, {
|
|
59
|
-
...defaultProps,
|
|
60
|
-
items: mockItems,
|
|
61
|
-
onChange: mockOnChange
|
|
62
|
-
}));
|
|
63
|
-
mockItems.forEach((item)=>{
|
|
64
|
-
expect(_react.screen.getByText(item.label)).toBeInTheDocument();
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
it('renders with field prop correctly', ()=>{
|
|
68
|
-
(0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_CheckboxesLine.default, {
|
|
69
|
-
...defaultProps,
|
|
70
|
-
field: {
|
|
71
|
-
items: mockItems,
|
|
72
|
-
value: [
|
|
73
|
-
'1'
|
|
74
|
-
]
|
|
75
|
-
},
|
|
76
|
-
onChange: mockOnChange
|
|
77
|
-
}));
|
|
78
|
-
mockItems.forEach((item)=>{
|
|
79
|
-
expect(_react.screen.getByText(item.label)).toBeInTheDocument();
|
|
80
|
-
});
|
|
81
|
-
});
|
|
82
|
-
it('handles checkbox changes correctly', ()=>{
|
|
83
|
-
(0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_CheckboxesLine.default, {
|
|
84
|
-
...defaultProps,
|
|
85
|
-
items: mockItems,
|
|
86
|
-
value: [],
|
|
87
|
-
onChange: mockOnChange
|
|
88
|
-
}));
|
|
89
|
-
const firstCheckbox = _react.screen.getByText('Option 1');
|
|
90
|
-
_react.fireEvent.click(firstCheckbox);
|
|
91
|
-
expect(mockOnChange).toHaveBeenCalledWith([
|
|
92
|
-
'1'
|
|
93
|
-
]);
|
|
94
|
-
});
|
|
95
|
-
it('handles checkbox uncheck correctly', ()=>{
|
|
96
|
-
(0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_CheckboxesLine.default, {
|
|
97
|
-
...defaultProps,
|
|
98
|
-
items: mockItems,
|
|
99
|
-
value: [
|
|
100
|
-
'1'
|
|
101
|
-
],
|
|
102
|
-
onChange: mockOnChange
|
|
103
|
-
}));
|
|
104
|
-
const firstCheckbox = _react.screen.getByText('Option 1');
|
|
105
|
-
_react.fireEvent.click(firstCheckbox);
|
|
106
|
-
expect(mockOnChange).toHaveBeenCalledWith([]);
|
|
107
|
-
});
|
|
108
|
-
it('applies column class when isPositionColumn is true', ()=>{
|
|
109
|
-
const { container } = (0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_CheckboxesLine.default, {
|
|
110
|
-
...defaultProps,
|
|
111
|
-
items: mockItems,
|
|
112
|
-
isPositionColumn: true,
|
|
113
|
-
onChange: mockOnChange
|
|
114
|
-
}));
|
|
115
|
-
expect(container.firstChild).toHaveClass('checkboxes-line_column');
|
|
116
|
-
});
|
|
117
|
-
it('applies custom className', ()=>{
|
|
118
|
-
const customClass = 'custom-class';
|
|
119
|
-
const { container } = (0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_CheckboxesLine.default, {
|
|
120
|
-
...defaultProps,
|
|
121
|
-
items: mockItems,
|
|
122
|
-
className: customClass,
|
|
123
|
-
onChange: mockOnChange
|
|
124
|
-
}));
|
|
125
|
-
expect(container.firstChild).toHaveClass(customClass);
|
|
126
|
-
});
|
|
127
|
-
it('respects disabled state', ()=>{
|
|
128
|
-
(0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_CheckboxesLine.default, {
|
|
129
|
-
...defaultProps,
|
|
130
|
-
items: mockItems,
|
|
131
|
-
disabled: true,
|
|
132
|
-
onChange: mockOnChange
|
|
133
|
-
}));
|
|
134
|
-
const checkboxes = _react.screen.getAllByRole('checkbox');
|
|
135
|
-
checkboxes.forEach((checkbox)=>{
|
|
136
|
-
expect(checkbox).toBeDisabled();
|
|
137
|
-
});
|
|
138
|
-
});
|
|
139
|
-
it('respects individual item disabled state', ()=>{
|
|
140
|
-
const itemsWithDisabled = [
|
|
141
|
-
...mockItems,
|
|
142
|
-
{
|
|
143
|
-
id: '4',
|
|
144
|
-
label: 'Disabled Option',
|
|
145
|
-
disabled: true
|
|
146
|
-
}
|
|
147
|
-
];
|
|
148
|
-
(0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_CheckboxesLine.default, {
|
|
149
|
-
...defaultProps,
|
|
150
|
-
items: itemsWithDisabled,
|
|
151
|
-
onChange: mockOnChange
|
|
152
|
-
}));
|
|
153
|
-
const disabledCheckbox = _react.screen.getByLabelText('Disabled Option');
|
|
154
|
-
expect(disabledCheckbox).toBeDisabled();
|
|
155
|
-
});
|
|
156
|
-
it('handles testId prop correctly', ()=>{
|
|
157
|
-
const testId = 'test-checkbox-line';
|
|
158
|
-
(0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_CheckboxesLine.default, {
|
|
159
|
-
...defaultProps,
|
|
160
|
-
items: mockItems,
|
|
161
|
-
testId: testId,
|
|
162
|
-
onChange: mockOnChange
|
|
163
|
-
}));
|
|
164
|
-
mockItems.forEach(()=>{
|
|
165
|
-
const checkbox = _react.screen.getAllByTestId(testId);
|
|
166
|
-
expect(checkbox.length).toBe(mockItems.length);
|
|
167
|
-
});
|
|
168
|
-
});
|
|
169
|
-
it('handles empty items array', ()=>{
|
|
170
|
-
const { container } = (0, _react.render)(/*#__PURE__*/ (0, _jsxruntime.jsx)(_CheckboxesLine.default, {
|
|
171
|
-
...defaultProps,
|
|
172
|
-
items: [],
|
|
173
|
-
onChange: mockOnChange
|
|
174
|
-
}));
|
|
175
|
-
expect(container.firstChild).toBeEmptyDOMElement();
|
|
176
|
-
});
|
|
177
|
-
});
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "default", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return _default;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _CheckboxesLine = /*#__PURE__*/ _interop_require_default(require("./CheckboxesLine"));
|
|
12
|
-
function _interop_require_default(obj) {
|
|
13
|
-
return obj && obj.__esModule ? obj : {
|
|
14
|
-
default: obj
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
const _default = _CheckboxesLine.default;
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
function _export(target, all) {
|
|
6
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: all[name]
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
_export(exports, {
|
|
12
|
-
DatepickerTemplate: function() {
|
|
13
|
-
return DatepickerTemplate;
|
|
14
|
-
},
|
|
15
|
-
default: function() {
|
|
16
|
-
return _default;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
const _jsxruntime = require("react/jsx-runtime");
|
|
20
|
-
const _react = /*#__PURE__*/ _interop_require_default(require("react"));
|
|
21
|
-
const _Datepicker = /*#__PURE__*/ _interop_require_default(require("./Datepicker"));
|
|
22
|
-
require("../../../../../scss/main.scss");
|
|
23
|
-
function _interop_require_default(obj) {
|
|
24
|
-
return obj && obj.__esModule ? obj : {
|
|
25
|
-
default: obj
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
global.lng = 'en';
|
|
29
|
-
const _default = {
|
|
30
|
-
title: 'Form Elements/Datepicker',
|
|
31
|
-
component: _Datepicker.default
|
|
32
|
-
};
|
|
33
|
-
const Template = (args)=>{
|
|
34
|
-
const params = {
|
|
35
|
-
minDate: args === null || args === void 0 ? void 0 : args.minDate,
|
|
36
|
-
maxDate: args === null || args === void 0 ? void 0 : args.maxDate
|
|
37
|
-
};
|
|
38
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_Datepicker.default, {
|
|
39
|
-
data: args.date,
|
|
40
|
-
params: params
|
|
41
|
-
});
|
|
42
|
-
};
|
|
43
|
-
const DatepickerTemplate = Template.bind({});
|
|
44
|
-
DatepickerTemplate.args = {
|
|
45
|
-
date: '10/14/2021',
|
|
46
|
-
minDate: '10/11/2021',
|
|
47
|
-
maxDate: '10/25/2021',
|
|
48
|
-
values: {
|
|
49
|
-
compare: false
|
|
50
|
-
}
|
|
51
|
-
};
|