@zohodesk/components 1.0.0-temp-195 → 1.0.0-temp-196
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/.cli/propValidation_report.html +1 -1
- package/README.md +23 -0
- package/es/Accordion/Accordion.js +2 -2
- package/es/Accordion/AccordionItem.js +4 -4
- package/es/Accordion/index.js +2 -2
- package/es/Animation/Animation.js +3 -3
- package/es/Animation/utils.js +1 -1
- package/es/AppContainer/AppContainer.js +9 -9
- package/es/AppContainer/__tests__/AppContainer.spec.js +82 -0
- package/es/AppContainer/__tests__/__snapshots__/AppContainer.spec.js.snap +201 -0
- package/es/Avatar/Avatar.js +5 -5
- package/es/Avatar/__tests__/Avatar.spec.js +1 -1
- package/es/AvatarTeam/AvatarTeam.js +4 -4
- package/es/AvatarTeam/__tests__/AvatarTeam.spec.js +1 -1
- package/es/Button/Button.js +4 -4
- package/es/Button/__tests__/Button.spec.js +9 -22
- package/es/Button/__tests__/__snapshots__/Button.spec.js.snap +0 -28
- package/es/Button/index.js +2 -2
- package/es/Button/props/defaultProps.js +1 -1
- package/es/Buttongroup/Buttongroup.js +3 -3
- package/es/Buttongroup/__tests__/Buttongroup.spec.js +1 -1
- package/es/Card/Card.js +5 -5
- package/es/Card/index.js +4 -4
- package/es/CheckBox/CheckBox.js +6 -6
- package/es/CheckBox/__tests__/CheckBox.spec.js +240 -0
- package/es/CheckBox/__tests__/__snapshots__/CheckBox.spec.js.snap +1878 -0
- package/es/DateTime/CalendarView.js +6 -6
- package/es/DateTime/DateTime.js +22 -17
- package/es/DateTime/DateTimePopupFooter.js +5 -5
- package/es/DateTime/DateTimePopupHeader.js +4 -4
- package/es/DateTime/DateWidget.js +44 -22
- package/es/DateTime/DaysRow.js +3 -3
- package/es/DateTime/Time.js +30 -15
- package/es/DateTime/YearView.js +6 -6
- package/es/DateTime/dateFormatUtils/dateFormat.js +4 -4
- package/es/DateTime/dateFormatUtils/dayChange.js +2 -2
- package/es/DateTime/dateFormatUtils/index.js +3 -3
- package/es/DateTime/dateFormatUtils/monthChange.js +2 -2
- package/es/DateTime/dateFormatUtils/timeChange.js +2 -2
- package/es/DateTime/dateFormatUtils/yearChange.js +2 -2
- package/es/DateTime/index.js +1 -1
- package/es/DateTime/props/defaultProps.js +4 -2
- package/es/DateTime/props/propTypes.js +8 -4
- package/es/DateTime/validator.js +2 -2
- package/es/DropBox/DropBox.js +9 -9
- package/es/DropBox/DropBoxElement/DropBoxElement.js +6 -6
- package/es/DropBox/DropBoxElement/css/cssJSLogic.js +1 -1
- package/es/DropBox/DropBoxElement/useDropboxPosCalc.js +1 -1
- package/es/DropBox/css/cssJSLogic.js +1 -1
- package/es/DropBox/props/defaultProps.js +1 -1
- package/es/DropBox/props/propTypes.js +1 -1
- package/es/DropBox/utils/isMobilePopover.js +1 -1
- package/es/DropDown/DropDown.js +4 -4
- package/es/DropDown/DropDownHeading.js +3 -3
- package/es/DropDown/DropDownItem.js +3 -3
- package/es/DropDown/DropDownSearch.js +4 -4
- package/es/DropDown/DropDownSeparator.js +2 -2
- package/es/DropDown/index.js +7 -7
- package/es/DropDown/props/propTypes.js +1 -1
- package/es/Heading/Heading.js +3 -3
- package/es/Label/Label.js +4 -4
- package/es/Label/__tests__/Label.spec.js +1 -1
- package/es/Layout/Box.js +4 -4
- package/es/Layout/Container.js +4 -4
- package/es/Layout/index.js +2 -2
- package/es/ListItem/ListContainer.js +6 -6
- package/es/ListItem/ListItem.js +5 -5
- package/es/ListItem/ListItemWithAvatar.js +7 -7
- package/es/ListItem/ListItemWithCheckBox.js +6 -6
- package/es/ListItem/ListItemWithIcon.js +5 -5
- package/es/ListItem/ListItemWithRadio.js +6 -6
- package/es/ListItem/index.js +6 -6
- package/es/Modal/Modal.js +3 -3
- package/es/MultiSelect/AdvancedGroupMultiSelect.js +17 -17
- package/es/MultiSelect/AdvancedMultiSelect.js +17 -17
- package/es/MultiSelect/EmptyState.js +3 -3
- package/es/MultiSelect/MobileHeader/MobileHeader.js +5 -5
- package/es/MultiSelect/MultiSelect.js +20 -20
- package/es/MultiSelect/MultiSelectHeader.js +4 -4
- package/es/MultiSelect/MultiSelectWithAvatar.js +16 -16
- package/es/MultiSelect/SelectedOptions.js +5 -5
- package/es/MultiSelect/Suggestions.js +6 -6
- package/es/MultiSelect/index.js +4 -4
- package/es/MultiSelect/props/defaultProps.js +1 -1
- package/es/PopOver/PopOver.js +6 -6
- package/es/PopOver/index.js +3 -3
- package/es/Popup/Popup.js +3 -3
- package/es/Provider/AvatarSize.js +1 -1
- package/es/Provider/CssProvider.js +1 -1
- package/es/Provider/IdProvider.js +2 -2
- package/es/Provider/LibraryContext.js +17 -5
- package/es/Provider/ZindexProvider.js +2 -2
- package/es/Provider/index.js +4 -4
- package/es/Radio/Radio.js +5 -5
- package/es/Radio/__tests__/Radio.spec.js +7 -10
- package/es/Radio/__tests__/__snapshots__/Radio.spec.js.snap +128 -49
- package/es/Responsive/CustomResponsive.js +7 -7
- package/es/Responsive/ResizeComponent.js +2 -2
- package/es/Responsive/Responsive.js +6 -6
- package/es/Responsive/index.js +3 -3
- package/es/Responsive/utils/index.js +1 -1
- package/es/Responsive/windowResizeObserver.js +1 -1
- package/es/ResponsiveDropBox/ResponsiveDropBox.js +6 -6
- package/es/ResponsiveDropBox/props/propTypes.js +1 -1
- package/es/Ribbon/Ribbon.js +3 -3
- package/es/Ribbon/__tests__/Ribbon.spec.js +1 -1
- package/es/RippleEffect/RippleEffect.js +4 -4
- package/es/RippleEffect/__tests__/RippleEffect.spec.js +2 -2
- package/es/RippleEffect/__tests__/__snapshots__/RippleEffect.spec.js.snap +0 -10
- package/es/Select/GroupSelect.js +28 -23
- package/es/Select/Select.js +15 -16
- package/es/Select/SelectWithAvatar.js +17 -17
- package/es/Select/SelectWithIcon.js +13 -13
- package/es/Select/index.js +4 -4
- package/es/Select/props/defaultProps.js +2 -1
- package/es/Stencils/Stencils.js +3 -3
- package/es/Stencils/__tests__/Stencils.spec.js +1 -1
- package/es/Switch/Switch.js +5 -5
- package/es/Switch/__tests__/Switch.spec.js +1 -1
- package/es/Tab/Tab.js +5 -5
- package/es/Tab/TabContent.js +4 -4
- package/es/Tab/TabContentWrapper.js +3 -3
- package/es/Tab/TabWrapper.js +3 -3
- package/es/Tab/Tabs.js +12 -12
- package/es/Tab/index.js +5 -5
- package/es/Tag/Tag.js +10 -8
- package/es/Tag/__tests__/Tag.spec.js +235 -0
- package/es/Tag/__tests__/__snapshots__/Tag.spec.js.snap +3054 -0
- package/es/Tag/props/defaultProps.js +1 -0
- package/es/Tag/props/propTypes.js +1 -0
- package/es/TextBox/TextBox.js +3 -3
- package/es/TextBox/__tests__/TextBox.spec.js +327 -0
- package/es/TextBox/__tests__/__snapshots__/TextBox.spec.js.snap +615 -0
- package/es/TextBox/props/propTypes.js +0 -3
- package/es/TextBoxIcon/TextBoxIcon.js +6 -6
- package/es/TextBoxIcon/__tests__/TextBoxIcon.spec.js +268 -0
- package/es/TextBoxIcon/__tests__/__snapshots__/TextBoxIcon.spec.js.snap +1784 -0
- package/es/TextBoxIcon/props/propTypes.js +2 -2
- package/es/Textarea/Textarea.js +3 -3
- package/es/Textarea/__tests__/Textarea.spec.js +228 -0
- package/es/Textarea/__tests__/__snapshots__/Textarea.spec.js.snap +476 -0
- package/es/Tooltip/Tooltip.js +5 -5
- package/es/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +3 -3
- package/es/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +3 -3
- package/es/VelocityAnimation/index.js +2 -2
- package/es/css.js +37 -37
- package/es/deprecated/PortalLayer/PortalLayer.js +3 -3
- package/es/index.js +39 -39
- package/es/semantic/Button/Button.js +3 -3
- package/es/semantic/index.js +1 -1
- package/es/utils/Common.js +1 -1
- package/es/utils/ContextOptimizer.js +1 -1
- package/es/utils/datetime/common.js +1 -1
- package/es/utils/dropDownUtils.js +5 -2
- package/es/utils/index.js +1 -1
- package/es/v1/Accordion/Accordion.js +2 -2
- package/es/v1/Accordion/AccordionItem.js +4 -4
- package/es/v1/Accordion/index.js +2 -2
- package/es/v1/Animation/Animation.js +3 -3
- package/es/v1/Animation/utils.js +1 -1
- package/es/v1/AppContainer/AppContainer.js +9 -9
- package/es/v1/Avatar/Avatar.js +5 -5
- package/es/v1/AvatarTeam/AvatarTeam.js +4 -4
- package/es/v1/Button/Button.js +4 -4
- package/es/v1/Button/props/defaultProps.js +1 -1
- package/es/v1/Buttongroup/Buttongroup.js +3 -3
- package/es/v1/Card/Card.js +5 -5
- package/es/v1/Card/index.js +4 -4
- package/es/v1/CheckBox/CheckBox.js +6 -6
- package/es/v1/DateTime/CalendarView.js +7 -7
- package/es/v1/DateTime/DateTime.js +22 -17
- package/es/v1/DateTime/DateTimePopupFooter.js +5 -5
- package/es/v1/DateTime/DateTimePopupHeader.js +4 -4
- package/es/v1/DateTime/DateWidget.js +44 -22
- package/es/v1/DateTime/DaysRow.js +3 -3
- package/es/v1/DateTime/Time.js +30 -15
- package/es/v1/DateTime/YearView.js +6 -6
- package/es/v1/DateTime/index.js +1 -1
- package/es/v1/DateTime/props/propTypes.js +8 -4
- package/es/v1/DropBox/DropBox.js +9 -9
- package/es/v1/DropBox/DropBoxElement/DropBoxElement.js +6 -6
- package/es/v1/DropBox/props/defaultProps.js +1 -1
- package/es/v1/DropBox/props/propTypes.js +1 -1
- package/es/v1/DropBox/utils/isMobilePopover.js +1 -1
- package/es/v1/DropDown/DropDown.js +4 -4
- package/es/v1/DropDown/DropDownHeading.js +3 -3
- package/es/v1/DropDown/DropDownItem.js +3 -3
- package/es/v1/DropDown/DropDownSearch.js +4 -4
- package/es/v1/DropDown/DropDownSeparator.js +2 -2
- package/es/v1/DropDown/props/propTypes.js +1 -1
- package/es/v1/Heading/Heading.js +3 -3
- package/es/v1/Label/Label.js +4 -4
- package/es/v1/Layout/Box.js +4 -4
- package/es/v1/Layout/Container.js +4 -4
- package/es/v1/Layout/index.js +2 -2
- package/es/v1/ListItem/ListContainer.js +6 -6
- package/es/v1/ListItem/ListItem.js +5 -5
- package/es/v1/ListItem/ListItemWithAvatar.js +7 -7
- package/es/v1/ListItem/ListItemWithCheckBox.js +6 -6
- package/es/v1/ListItem/ListItemWithIcon.js +5 -5
- package/es/v1/ListItem/ListItemWithRadio.js +6 -6
- package/es/v1/ListItem/index.js +6 -6
- package/es/v1/Modal/Modal.js +3 -3
- package/es/v1/MultiSelect/AdvancedGroupMultiSelect.js +17 -17
- package/es/v1/MultiSelect/AdvancedMultiSelect.js +23 -19
- package/es/v1/MultiSelect/EmptyState.js +3 -3
- package/es/v1/MultiSelect/MobileHeader/MobileHeader.js +5 -5
- package/es/v1/MultiSelect/MultiSelect.js +19 -19
- package/es/v1/MultiSelect/MultiSelectHeader.js +4 -4
- package/es/v1/MultiSelect/MultiSelectWithAvatar.js +16 -16
- package/es/v1/MultiSelect/SelectedOptions.js +5 -5
- package/es/v1/MultiSelect/Suggestions.js +6 -6
- package/es/v1/MultiSelect/index.js +4 -4
- package/es/v1/MultiSelect/props/defaultProps.js +3 -2
- package/es/v1/MultiSelect/props/propTypes.js +2 -1
- package/es/v1/PopOver/PopOver.js +6 -6
- package/es/v1/Popup/Popup.js +3 -3
- package/es/v1/Radio/Radio.js +5 -5
- package/es/v1/ResponsiveDropBox/ResponsiveDropBox.js +6 -6
- package/es/v1/ResponsiveDropBox/props/propTypes.js +1 -1
- package/es/v1/Ribbon/Ribbon.js +3 -3
- package/es/v1/RippleEffect/RippleEffect.js +4 -4
- package/es/v1/Select/GroupSelect.js +28 -23
- package/es/v1/Select/Select.js +15 -16
- package/es/v1/Select/SelectWithAvatar.js +17 -17
- package/es/v1/Select/SelectWithIcon.js +13 -13
- package/es/v1/Select/index.js +4 -4
- package/es/v1/Select/props/defaultProps.js +2 -1
- package/es/v1/Stencils/Stencils.js +3 -3
- package/es/v1/Switch/Switch.js +5 -5
- package/es/v1/Tab/Tab.js +5 -5
- package/es/v1/Tab/TabContent.js +4 -4
- package/es/v1/Tab/TabContentWrapper.js +3 -3
- package/es/v1/Tab/TabWrapper.js +3 -3
- package/es/v1/Tab/Tabs.js +12 -12
- package/es/v1/Tab/index.js +5 -5
- package/es/v1/Tag/Tag.js +10 -8
- package/es/v1/Tag/props/defaultProps.js +1 -0
- package/es/v1/Tag/props/propTypes.js +1 -0
- package/es/v1/TextBox/TextBox.js +3 -3
- package/es/v1/TextBoxIcon/TextBoxIcon.js +6 -6
- package/es/v1/TextBoxIcon/props/propTypes.js +1 -1
- package/es/v1/Textarea/Textarea.js +3 -3
- package/es/v1/Tooltip/Tooltip.js +5 -5
- package/es/v1/Typography/Typography.js +4 -4
- package/es/v1/Typography/css/cssJSLogic.js +1 -1
- package/es/v1/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +3 -3
- package/es/v1/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +3 -3
- package/es/v1/semantic/Button/Button.js +3 -3
- package/es/v1/semantic/index.js +1 -1
- package/lib/AppContainer/__tests__/AppContainer.spec.js +90 -0
- package/lib/AppContainer/__tests__/__snapshots__/AppContainer.spec.js.snap +201 -0
- package/lib/Button/__tests__/Button.spec.js +8 -21
- package/lib/Button/__tests__/__snapshots__/Button.spec.js.snap +0 -28
- package/lib/CheckBox/__tests__/CheckBox.spec.js +248 -0
- package/lib/CheckBox/__tests__/__snapshots__/CheckBox.spec.js.snap +1878 -0
- package/lib/DateTime/DateTime.js +7 -2
- package/lib/DateTime/DateWidget.js +127 -103
- package/lib/DateTime/Time.js +29 -13
- package/lib/DateTime/props/defaultProps.js +4 -2
- package/lib/DateTime/props/propTypes.js +7 -3
- package/lib/Provider/LibraryContext.js +15 -5
- package/lib/Radio/__tests__/Radio.spec.js +9 -13
- package/lib/Radio/__tests__/__snapshots__/Radio.spec.js.snap +128 -49
- package/lib/RippleEffect/__tests__/RippleEffect.spec.js +1 -1
- package/lib/RippleEffect/__tests__/__snapshots__/RippleEffect.spec.js.snap +0 -10
- package/lib/Select/GroupSelect.js +23 -18
- package/lib/Select/Select.js +0 -2
- package/lib/Select/props/defaultProps.js +1 -0
- package/lib/Tag/Tag.js +5 -2
- package/lib/Tag/__tests__/Tag.spec.js +252 -0
- package/lib/Tag/__tests__/__snapshots__/Tag.spec.js.snap +3054 -0
- package/lib/Tag/props/defaultProps.js +1 -0
- package/lib/Tag/props/propTypes.js +1 -0
- package/lib/TextBox/__tests__/TextBox.spec.js +334 -0
- package/lib/TextBox/__tests__/__snapshots__/TextBox.spec.js.snap +615 -0
- package/lib/TextBox/props/propTypes.js +53 -51
- package/lib/TextBoxIcon/__tests__/TextBoxIcon.spec.js +279 -0
- package/lib/TextBoxIcon/__tests__/__snapshots__/TextBoxIcon.spec.js.snap +1784 -0
- package/lib/TextBoxIcon/props/propTypes.js +1 -1
- package/lib/Textarea/__tests__/Textarea.spec.js +235 -0
- package/lib/Textarea/__tests__/__snapshots__/Textarea.spec.js.snap +476 -0
- package/lib/utils/dropDownUtils.js +14 -2
- package/lib/v1/DateTime/DateTime.js +7 -2
- package/lib/v1/DateTime/DateWidget.js +129 -105
- package/lib/v1/DateTime/Time.js +29 -13
- package/lib/v1/DateTime/props/propTypes.js +7 -3
- package/lib/v1/MultiSelect/AdvancedMultiSelect.js +5 -2
- package/lib/v1/MultiSelect/props/defaultProps.js +2 -1
- package/lib/v1/MultiSelect/props/propTypes.js +2 -1
- package/lib/v1/Select/GroupSelect.js +23 -18
- package/lib/v1/Select/Select.js +0 -2
- package/lib/v1/Select/props/defaultProps.js +1 -0
- package/lib/v1/Tag/Tag.js +5 -2
- package/lib/v1/Tag/props/defaultProps.js +1 -0
- package/lib/v1/Tag/props/propTypes.js +1 -0
- package/package.json +3 -3
- package/result.json +1 -1
package/es/TextBox/TextBox.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { defaultProps } from
|
|
3
|
-
import { propTypes } from
|
|
2
|
+
import { defaultProps } from './props/defaultProps';
|
|
3
|
+
import { propTypes } from './props/propTypes';
|
|
4
4
|
/* eslint css-modules/no-unused-class: [2, { markAsUsed: ['xmedium', 'medium', 'small', 'default', 'primary', 'secondary'] }] */
|
|
5
5
|
|
|
6
|
-
import style from
|
|
6
|
+
import style from './TextBox.module.css';
|
|
7
7
|
export default class TextBox extends React.PureComponent {
|
|
8
8
|
constructor(props) {
|
|
9
9
|
super(props);
|
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Textbox from '../Textbox';
|
|
3
|
+
import { render } from "@testing-library/react";
|
|
4
|
+
describe('Textbox component', () => {
|
|
5
|
+
const type = ['text', 'password', 'number'];
|
|
6
|
+
const size = ['small', 'xsmall', 'medium', 'xmedium'];
|
|
7
|
+
const variant = ['primary', 'secondary', 'default', 'light'];
|
|
8
|
+
const borderColor = ['transparent', 'default'];
|
|
9
|
+
test('Should be render with the basic set of default props', () => {
|
|
10
|
+
const {
|
|
11
|
+
asFragment
|
|
12
|
+
} = render( /*#__PURE__*/React.createElement(Textbox, null));
|
|
13
|
+
expect(asFragment()).toMatchSnapshot();
|
|
14
|
+
});
|
|
15
|
+
test.each(type)('Should render type - %s', type => {
|
|
16
|
+
const {
|
|
17
|
+
asFragment
|
|
18
|
+
} = render( /*#__PURE__*/React.createElement(Textbox, {
|
|
19
|
+
type: type
|
|
20
|
+
}));
|
|
21
|
+
expect(asFragment()).toMatchSnapshot();
|
|
22
|
+
});
|
|
23
|
+
test('Should be render name', () => {
|
|
24
|
+
const {
|
|
25
|
+
asFragment
|
|
26
|
+
} = render( /*#__PURE__*/React.createElement(Textbox, {
|
|
27
|
+
name: "TextboxName"
|
|
28
|
+
}));
|
|
29
|
+
expect(asFragment()).toMatchSnapshot();
|
|
30
|
+
});
|
|
31
|
+
test('Should be render id', () => {
|
|
32
|
+
const {
|
|
33
|
+
asFragment
|
|
34
|
+
} = render( /*#__PURE__*/React.createElement(Textbox, {
|
|
35
|
+
id: "TextboxId"
|
|
36
|
+
}));
|
|
37
|
+
expect(asFragment()).toMatchSnapshot();
|
|
38
|
+
});
|
|
39
|
+
test('Should be render maxLength in number', () => {
|
|
40
|
+
const {
|
|
41
|
+
asFragment
|
|
42
|
+
} = render( /*#__PURE__*/React.createElement(Textbox, {
|
|
43
|
+
maxLength: "11"
|
|
44
|
+
}));
|
|
45
|
+
expect(asFragment()).toMatchSnapshot();
|
|
46
|
+
});
|
|
47
|
+
test('Should be render maxLength in string', () => {
|
|
48
|
+
const {
|
|
49
|
+
asFragment
|
|
50
|
+
} = render( /*#__PURE__*/React.createElement(Textbox, {
|
|
51
|
+
maxLength: "Ten"
|
|
52
|
+
}));
|
|
53
|
+
expect(asFragment()).toMatchSnapshot();
|
|
54
|
+
});
|
|
55
|
+
test('Should be render placeholder', () => {
|
|
56
|
+
const {
|
|
57
|
+
asFragment
|
|
58
|
+
} = render( /*#__PURE__*/React.createElement(Textbox, {
|
|
59
|
+
placeHolder: "TextBoxPlaceHolder"
|
|
60
|
+
}));
|
|
61
|
+
expect(asFragment()).toMatchSnapshot();
|
|
62
|
+
});
|
|
63
|
+
test.each(size)('Should render size - %s', size => {
|
|
64
|
+
const {
|
|
65
|
+
asFragment
|
|
66
|
+
} = render( /*#__PURE__*/React.createElement(Textbox, {
|
|
67
|
+
size: size
|
|
68
|
+
}));
|
|
69
|
+
expect(asFragment()).toMatchSnapshot();
|
|
70
|
+
});
|
|
71
|
+
test('Should be render isReadOnly is true and needEffect is true', () => {
|
|
72
|
+
const {
|
|
73
|
+
asFragment
|
|
74
|
+
} = render( /*#__PURE__*/React.createElement(Textbox, {
|
|
75
|
+
isReadOnly: true,
|
|
76
|
+
needEffect: true
|
|
77
|
+
}));
|
|
78
|
+
expect(asFragment()).toMatchSnapshot();
|
|
79
|
+
});
|
|
80
|
+
test('Should be render isReadOnly is true and needEffect is false', () => {
|
|
81
|
+
const {
|
|
82
|
+
asFragment
|
|
83
|
+
} = render( /*#__PURE__*/React.createElement(Textbox, {
|
|
84
|
+
isReadOnly: true,
|
|
85
|
+
needEffect: false
|
|
86
|
+
}));
|
|
87
|
+
expect(asFragment()).toMatchSnapshot();
|
|
88
|
+
});
|
|
89
|
+
test('Should be render isReadOnly is false and needEffect is false', () => {
|
|
90
|
+
const {
|
|
91
|
+
asFragment
|
|
92
|
+
} = render( /*#__PURE__*/React.createElement(Textbox, {
|
|
93
|
+
isReadOnly: false,
|
|
94
|
+
needEffect: false
|
|
95
|
+
}));
|
|
96
|
+
expect(asFragment()).toMatchSnapshot();
|
|
97
|
+
});
|
|
98
|
+
test('Should be render isDisabled is true and needEffect is true', () => {
|
|
99
|
+
const {
|
|
100
|
+
asFragment
|
|
101
|
+
} = render( /*#__PURE__*/React.createElement(Textbox, {
|
|
102
|
+
isDisabled: true,
|
|
103
|
+
needEffect: true
|
|
104
|
+
}));
|
|
105
|
+
expect(asFragment()).toMatchSnapshot();
|
|
106
|
+
});
|
|
107
|
+
test('Should be render isDisabled is true and needEffect is false', () => {
|
|
108
|
+
const {
|
|
109
|
+
asFragment
|
|
110
|
+
} = render( /*#__PURE__*/React.createElement(Textbox, {
|
|
111
|
+
isDisabled: true,
|
|
112
|
+
needEffect: false
|
|
113
|
+
}));
|
|
114
|
+
expect(asFragment()).toMatchSnapshot();
|
|
115
|
+
});
|
|
116
|
+
test('Should be render isDisabled is false and needEffect is false', () => {
|
|
117
|
+
const {
|
|
118
|
+
asFragment
|
|
119
|
+
} = render( /*#__PURE__*/React.createElement(Textbox, {
|
|
120
|
+
isDisabled: false,
|
|
121
|
+
needEffect: false
|
|
122
|
+
}));
|
|
123
|
+
expect(asFragment()).toMatchSnapshot();
|
|
124
|
+
});
|
|
125
|
+
test.each(variant)('Should render Varient - %s', variant => {
|
|
126
|
+
const {
|
|
127
|
+
asFragment
|
|
128
|
+
} = render( /*#__PURE__*/React.createElement(Textbox, {
|
|
129
|
+
variant: variant
|
|
130
|
+
}));
|
|
131
|
+
expect(asFragment()).toMatchSnapshot();
|
|
132
|
+
});
|
|
133
|
+
test('Should be render needBorder is false ', () => {
|
|
134
|
+
const {
|
|
135
|
+
asFragment
|
|
136
|
+
} = render( /*#__PURE__*/React.createElement(Textbox, {
|
|
137
|
+
needBorder: false
|
|
138
|
+
}));
|
|
139
|
+
expect(asFragment()).toMatchSnapshot();
|
|
140
|
+
});
|
|
141
|
+
test('Should be render value in number', () => {
|
|
142
|
+
const {
|
|
143
|
+
asFragment
|
|
144
|
+
} = render( /*#__PURE__*/React.createElement(Textbox, {
|
|
145
|
+
value: 20
|
|
146
|
+
}));
|
|
147
|
+
expect(asFragment()).toMatchSnapshot();
|
|
148
|
+
});
|
|
149
|
+
test('Should be render value in string', () => {
|
|
150
|
+
const {
|
|
151
|
+
asFragment
|
|
152
|
+
} = render( /*#__PURE__*/React.createElement(Textbox, {
|
|
153
|
+
value: "Tewnty"
|
|
154
|
+
}));
|
|
155
|
+
expect(asFragment()).toMatchSnapshot();
|
|
156
|
+
});
|
|
157
|
+
test('Should be render needReadOnlyStyle is false and isReadOnly true ', () => {
|
|
158
|
+
const {
|
|
159
|
+
asFragment
|
|
160
|
+
} = render( /*#__PURE__*/React.createElement(Textbox, {
|
|
161
|
+
needReadOnlyStyle: false,
|
|
162
|
+
isReadOnly: true
|
|
163
|
+
}));
|
|
164
|
+
expect(asFragment()).toMatchSnapshot();
|
|
165
|
+
});
|
|
166
|
+
test('Should be render needReadOnlyStyle is false ', () => {
|
|
167
|
+
const {
|
|
168
|
+
asFragment
|
|
169
|
+
} = render( /*#__PURE__*/React.createElement(Textbox, {
|
|
170
|
+
needReadOnlyStyle: false
|
|
171
|
+
}));
|
|
172
|
+
expect(asFragment()).toMatchSnapshot();
|
|
173
|
+
});
|
|
174
|
+
test('Should be render needReadOnlyStyle is true and isReadOnly true ', () => {
|
|
175
|
+
const {
|
|
176
|
+
asFragment
|
|
177
|
+
} = render( /*#__PURE__*/React.createElement(Textbox, {
|
|
178
|
+
needReadOnlyStyle: true,
|
|
179
|
+
isReadOnly: true
|
|
180
|
+
}));
|
|
181
|
+
expect(asFragment()).toMatchSnapshot();
|
|
182
|
+
});
|
|
183
|
+
test('Should be render needAppearance is false ', () => {
|
|
184
|
+
const {
|
|
185
|
+
asFragment
|
|
186
|
+
} = render( /*#__PURE__*/React.createElement(Textbox, {
|
|
187
|
+
needAppearance: false
|
|
188
|
+
}));
|
|
189
|
+
expect(asFragment()).toMatchSnapshot();
|
|
190
|
+
});
|
|
191
|
+
test('Should be render isClickable is ture ', () => {
|
|
192
|
+
const {
|
|
193
|
+
asFragment
|
|
194
|
+
} = render( /*#__PURE__*/React.createElement(Textbox, {
|
|
195
|
+
isClickable: true
|
|
196
|
+
}));
|
|
197
|
+
expect(asFragment()).toMatchSnapshot();
|
|
198
|
+
});
|
|
199
|
+
test('Should be render autofocus false ', () => {
|
|
200
|
+
const {
|
|
201
|
+
asFragment
|
|
202
|
+
} = render( /*#__PURE__*/React.createElement(Textbox, {
|
|
203
|
+
autofocus: false
|
|
204
|
+
}));
|
|
205
|
+
expect(asFragment()).toMatchSnapshot();
|
|
206
|
+
});
|
|
207
|
+
test('Should be render autofocus true ', () => {
|
|
208
|
+
const {
|
|
209
|
+
asFragment
|
|
210
|
+
} = render( /*#__PURE__*/React.createElement(Textbox, {
|
|
211
|
+
autofocus: true
|
|
212
|
+
}));
|
|
213
|
+
expect(asFragment()).toMatchSnapshot();
|
|
214
|
+
});
|
|
215
|
+
test('Should be render autoComplete true ', () => {
|
|
216
|
+
const {
|
|
217
|
+
asFragment
|
|
218
|
+
} = render( /*#__PURE__*/React.createElement(Textbox, {
|
|
219
|
+
autoComplete: true
|
|
220
|
+
}));
|
|
221
|
+
expect(asFragment()).toMatchSnapshot();
|
|
222
|
+
});
|
|
223
|
+
test('Should be render autoComplete false ', () => {
|
|
224
|
+
const {
|
|
225
|
+
asFragment
|
|
226
|
+
} = render( /*#__PURE__*/React.createElement(Textbox, {
|
|
227
|
+
autoComplete: false
|
|
228
|
+
}));
|
|
229
|
+
expect(asFragment()).toMatchSnapshot();
|
|
230
|
+
});
|
|
231
|
+
test.each(borderColor)('Should render borderColor - %s', borderColor => {
|
|
232
|
+
const {
|
|
233
|
+
asFragment
|
|
234
|
+
} = render( /*#__PURE__*/React.createElement(Textbox, {
|
|
235
|
+
borderColor: borderColor
|
|
236
|
+
}));
|
|
237
|
+
expect(asFragment()).toMatchSnapshot();
|
|
238
|
+
});
|
|
239
|
+
test('Should be render htmlId ', () => {
|
|
240
|
+
const {
|
|
241
|
+
asFragment
|
|
242
|
+
} = render( /*#__PURE__*/React.createElement(Textbox, {
|
|
243
|
+
htmlId: "textBoxhtmlId"
|
|
244
|
+
}));
|
|
245
|
+
expect(asFragment()).toMatchSnapshot();
|
|
246
|
+
});
|
|
247
|
+
test('Should be render isFocus is true ', () => {
|
|
248
|
+
const {
|
|
249
|
+
asFragment
|
|
250
|
+
} = render( /*#__PURE__*/React.createElement(Textbox, {
|
|
251
|
+
isFocus: true
|
|
252
|
+
}));
|
|
253
|
+
expect(asFragment()).toMatchSnapshot();
|
|
254
|
+
});
|
|
255
|
+
test('Should be render isScrollPrevent is true ', () => {
|
|
256
|
+
const {
|
|
257
|
+
asFragment
|
|
258
|
+
} = render( /*#__PURE__*/React.createElement(Textbox, {
|
|
259
|
+
isScrollPrevent: true
|
|
260
|
+
}));
|
|
261
|
+
expect(asFragment()).toMatchSnapshot();
|
|
262
|
+
});
|
|
263
|
+
test('rendering ally ariaExpanded,ariaHaspopup,ariaRequired,ariaLabelledby,ariaReadonly,ariaMultiselectable is true', () => {
|
|
264
|
+
const {
|
|
265
|
+
asFragment
|
|
266
|
+
} = render( /*#__PURE__*/React.createElement(Textbox, {
|
|
267
|
+
a11y: {
|
|
268
|
+
ariaLabel: 'textboxAriaLabel',
|
|
269
|
+
ariaAutocomplete: 'textboxAriaAutocomplete',
|
|
270
|
+
ariaControls: 'textboxAriaControls',
|
|
271
|
+
ariaExpanded: true,
|
|
272
|
+
role: 'TextboxRole',
|
|
273
|
+
ariaDescribedby: 'textboxAriaDescribedby',
|
|
274
|
+
ariaHaspopup: true,
|
|
275
|
+
ariaRequired: true,
|
|
276
|
+
ariaLabelledby: 'textboxAriaLabelledby',
|
|
277
|
+
ariaInvalid: true,
|
|
278
|
+
ariaOwns: 'textboxAriaOwns',
|
|
279
|
+
ariaActivedescendant: 'textBoxAriaActivedescendant',
|
|
280
|
+
ariaReadonly: true,
|
|
281
|
+
ariaMultiselectable: true
|
|
282
|
+
}
|
|
283
|
+
}));
|
|
284
|
+
expect(asFragment()).toMatchSnapshot();
|
|
285
|
+
});
|
|
286
|
+
test('rendering ally ariaExpanded,ariaHaspopup,ariaRequired,ariaLabelledby,ariaReadonly,ariaMultiselectable is false', () => {
|
|
287
|
+
const {
|
|
288
|
+
asFragment
|
|
289
|
+
} = render( /*#__PURE__*/React.createElement(Textbox, {
|
|
290
|
+
a11y: {
|
|
291
|
+
ariaLabel: 'textboxAriaLabel',
|
|
292
|
+
ariaAutocomplete: 'textboxAriaAutocomplete',
|
|
293
|
+
ariaControls: 'textboxAriaControls',
|
|
294
|
+
ariaExpanded: false,
|
|
295
|
+
role: 'TextboxRole',
|
|
296
|
+
ariaDescribedby: 'textboxAriaDescribedby',
|
|
297
|
+
ariaHaspopup: false,
|
|
298
|
+
ariaRequired: false,
|
|
299
|
+
ariaLabelledby: 'textboxAriaLabelledby',
|
|
300
|
+
ariaInvalid: false,
|
|
301
|
+
ariaOwns: 'textboxAriaOwns',
|
|
302
|
+
ariaActivedescendant: 'textBoxAriaActivedescendant',
|
|
303
|
+
ariaReadonly: false,
|
|
304
|
+
ariaMultiselectable: false
|
|
305
|
+
}
|
|
306
|
+
}));
|
|
307
|
+
expect(asFragment()).toMatchSnapshot();
|
|
308
|
+
});
|
|
309
|
+
test('Should be render customClass ', () => {
|
|
310
|
+
const {
|
|
311
|
+
asFragment
|
|
312
|
+
} = render( /*#__PURE__*/React.createElement(Textbox, {
|
|
313
|
+
customClass: "TextBoxCustomClass"
|
|
314
|
+
}));
|
|
315
|
+
expect(asFragment()).toMatchSnapshot();
|
|
316
|
+
});
|
|
317
|
+
test('rendering the Custom Props', () => {
|
|
318
|
+
const {
|
|
319
|
+
asFragment
|
|
320
|
+
} = render( /*#__PURE__*/React.createElement(Textbox, {
|
|
321
|
+
customProps: {
|
|
322
|
+
'textbox-props': "true"
|
|
323
|
+
}
|
|
324
|
+
}));
|
|
325
|
+
expect(asFragment()).toMatchSnapshot();
|
|
326
|
+
});
|
|
327
|
+
});
|