@zohodesk/components 1.6.31 → 1.6.34
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/CHANGELOG.md +13 -0
- package/assets/Appearance/light/mode/Component_LightMode.module.css +1 -1
- package/es/Accordion/__tests__/Accordion.spec.js +117 -3
- package/es/Accordion/__tests__/AccordionItem.spec.js +118 -6
- package/es/Accordion/__tests__/__snapshots__/Accordion.spec.js.snap +344 -2
- package/es/Accordion/__tests__/__snapshots__/AccordionItem.spec.js.snap +155 -3
- package/es/Animation/__tests__/Animation.spec.js +28 -4
- package/es/Animation/__tests__/__snapshots__/Animation.spec.js.snap +92 -2
- package/es/Button/css/Button.module.css +2 -3
- package/es/CheckBox/CheckBox.js +1 -1
- package/es/CheckBox/__tests__/__snapshots__/CheckBox.spec.js.snap +1 -1
- package/es/DateTime/DateTime.module.css +2 -2
- package/es/DateTime/__tests__/CalendarView.spec.js +70 -3
- package/es/DateTime/__tests__/DateTime.spec.js +89 -6
- package/es/DateTime/__tests__/DateTimePopupFooter.spec.js +20 -2
- package/es/DateTime/__tests__/DateTimePopupHeader.spec.js +29 -2
- package/es/DateTime/__tests__/DateWidget.spec.js +34 -2
- package/es/DateTime/__tests__/DaysRow.spec.js +19 -3
- package/es/DateTime/__tests__/Time.spec.js +50 -3
- package/es/DateTime/__tests__/YearView.spec.js +60 -3
- package/es/DateTime/__tests__/__snapshots__/CalendarView.spec.js.snap +2907 -170
- package/es/DateTime/__tests__/__snapshots__/DateTime.spec.js.snap +4392 -108
- package/es/DateTime/__tests__/__snapshots__/DateTimePopupFooter.spec.js.snap +67 -1
- package/es/DateTime/__tests__/__snapshots__/DateTimePopupHeader.spec.js.snap +187 -1
- package/es/DateTime/__tests__/__snapshots__/DateWidget.spec.js.snap +265 -1
- package/es/DateTime/__tests__/__snapshots__/DaysRow.spec.js.snap +155 -2
- package/es/DateTime/__tests__/__snapshots__/Time.spec.js.snap +522 -5
- package/es/DateTime/__tests__/__snapshots__/YearView.spec.js.snap +540 -0
- package/es/DropBox/DropBoxElement/css/DropBoxElement.module.css +1 -4
- package/es/Heading/Heading.module.css +1 -1
- package/es/Heading/__tests__/Heading.spec.js +57 -3
- package/es/Heading/__tests__/__snapshots__/Heading.spec.js.snap +87 -14
- package/es/ListItem/__tests__/ListContainer.spec.js +228 -1
- package/es/ListItem/__tests__/ListItem.spec.js +359 -1
- package/es/ListItem/__tests__/ListItemWithAvatar.spec.js +390 -1
- package/es/ListItem/__tests__/ListItemWithCheckBox.spec.js +214 -1
- package/es/ListItem/__tests__/ListItemWithIcon.spec.js +303 -1
- package/es/ListItem/__tests__/ListItemWithRadio.spec.js +230 -1
- package/es/ListItem/__tests__/__snapshots__/ListContainer.spec.js.snap +602 -0
- package/es/ListItem/__tests__/__snapshots__/ListItem.spec.js.snap +1807 -0
- package/es/ListItem/__tests__/__snapshots__/ListItemWithAvatar.spec.js.snap +2703 -0
- package/es/ListItem/__tests__/__snapshots__/ListItemWithCheckBox.spec.js.snap +2909 -0
- package/es/ListItem/__tests__/__snapshots__/ListItemWithIcon.spec.js.snap +2009 -0
- package/es/ListItem/__tests__/__snapshots__/ListItemWithRadio.spec.js.snap +3070 -0
- package/es/MultiSelect/MultiSelect.module.css +1 -2
- package/es/MultiSelect/__tests__/AdvancedGroupMultiSelect.spec.js +671 -1
- package/es/MultiSelect/__tests__/AdvancedMultiSelect.spec.js +730 -1
- package/es/MultiSelect/__tests__/EmptyState.spec.js +268 -1
- package/es/MultiSelect/__tests__/MultiSelect.spec.js +889 -2
- package/es/MultiSelect/__tests__/MultiSelectHeader.spec.js +50 -1
- package/es/MultiSelect/__tests__/MultiSelectWithAvatar.spec.js +487 -1
- package/es/MultiSelect/__tests__/SelectedOptions.spec.js +291 -1
- package/es/MultiSelect/__tests__/Suggestions.spec.js +370 -2
- package/es/MultiSelect/__tests__/__snapshots__/AdvancedGroupMultiSelect.spec.js.snap +11785 -0
- package/es/MultiSelect/__tests__/__snapshots__/AdvancedMultiSelect.spec.js.snap +12083 -0
- package/es/MultiSelect/__tests__/__snapshots__/EmptyState.spec.js.snap +253 -0
- package/es/MultiSelect/__tests__/__snapshots__/MultiSelect.spec.js.snap +14052 -0
- package/es/MultiSelect/__tests__/__snapshots__/MultiSelectHeader.spec.js.snap +136 -0
- package/es/MultiSelect/__tests__/__snapshots__/MultiSelectWithAvatar.spec.js.snap +11506 -0
- package/es/MultiSelect/__tests__/__snapshots__/SelectedOptions.spec.js.snap +1382 -0
- package/es/MultiSelect/__tests__/__snapshots__/Suggestions.spec.js.snap +3611 -0
- package/es/PopOver/__tests__/PopOver.spec.js +141 -2
- package/es/PopOver/__tests__/__snapshots__/PopOver.spec.js.snap +1260 -0
- package/es/ResponsiveDropBox/__tests__/ResponsiveDropBox.spec.js +212 -1
- package/es/ResponsiveDropBox/__tests__/__snapshots__/ResponsiveDropBox.spec.js.snap +1802 -0
- package/es/Tab/Tabs.module.css +1 -2
- package/es/Tab/__tests__/Tab.spec.js +249 -1
- package/es/Tab/__tests__/TabContent.spec.js +34 -1
- package/es/Tab/__tests__/TabContentWrapper.spec.js +72 -1
- package/es/Tab/__tests__/TabWrapper.spec.js +163 -1
- package/es/Tab/__tests__/Tabs.spec.js +681 -1
- package/es/Tab/__tests__/__snapshots__/Tab.spec.js.snap +1049 -0
- package/es/Tab/__tests__/__snapshots__/TabContent.spec.js.snap +99 -0
- package/es/Tab/__tests__/__snapshots__/TabContentWrapper.spec.js.snap +121 -0
- package/es/Tab/__tests__/__snapshots__/TabWrapper.spec.js.snap +2002 -0
- package/es/Tab/__tests__/__snapshots__/Tabs.spec.js.snap +11053 -0
- package/es/Textarea/Textarea.module.css +1 -1
- package/es/Tooltip/Tooltip.module.css +1 -2
- package/es/Tooltip/__tests__/Tooltip.spec.js +590 -0
- package/es/Tooltip/__tests__/__snapshots__/Tooltip.spec.js.snap +813 -0
- package/es/Typography/css/Typography.module.css +8 -7
- package/es/common/common.module.css +4 -4
- package/lib/Accordion/__tests__/Accordion.spec.js +122 -2
- package/lib/Accordion/__tests__/AccordionItem.spec.js +126 -4
- package/lib/Accordion/__tests__/__snapshots__/Accordion.spec.js.snap +344 -2
- package/lib/Accordion/__tests__/__snapshots__/AccordionItem.spec.js.snap +155 -3
- package/lib/Animation/__tests__/Animation.spec.js +31 -5
- package/lib/Animation/__tests__/__snapshots__/Animation.spec.js.snap +92 -2
- package/lib/Button/css/Button.module.css +2 -3
- package/lib/CheckBox/CheckBox.js +1 -1
- package/lib/CheckBox/__tests__/__snapshots__/CheckBox.spec.js.snap +1 -1
- package/lib/DateTime/DateTime.module.css +2 -2
- package/lib/DateTime/__tests__/CalendarView.spec.js +71 -2
- package/lib/DateTime/__tests__/DateTime.spec.js +92 -6
- package/lib/DateTime/__tests__/DateTimePopupFooter.spec.js +21 -1
- package/lib/DateTime/__tests__/DateTimePopupHeader.spec.js +30 -1
- package/lib/DateTime/__tests__/DateWidget.spec.js +35 -1
- package/lib/DateTime/__tests__/DaysRow.spec.js +20 -2
- package/lib/DateTime/__tests__/Time.spec.js +51 -2
- package/lib/DateTime/__tests__/YearView.spec.js +61 -2
- package/lib/DateTime/__tests__/__snapshots__/CalendarView.spec.js.snap +2907 -170
- package/lib/DateTime/__tests__/__snapshots__/DateTime.spec.js.snap +4392 -108
- package/lib/DateTime/__tests__/__snapshots__/DateTimePopupFooter.spec.js.snap +67 -1
- package/lib/DateTime/__tests__/__snapshots__/DateTimePopupHeader.spec.js.snap +187 -1
- package/lib/DateTime/__tests__/__snapshots__/DateWidget.spec.js.snap +265 -1
- package/lib/DateTime/__tests__/__snapshots__/DaysRow.spec.js.snap +155 -2
- package/lib/DateTime/__tests__/__snapshots__/Time.spec.js.snap +522 -5
- package/lib/DateTime/__tests__/__snapshots__/YearView.spec.js.snap +540 -0
- package/lib/DropBox/DropBoxElement/css/DropBoxElement.module.css +1 -4
- package/lib/Heading/Heading.module.css +1 -1
- package/lib/Heading/__tests__/Heading.spec.js +60 -4
- package/lib/Heading/__tests__/__snapshots__/Heading.spec.js.snap +87 -14
- package/lib/ListItem/__tests__/ListContainer.spec.js +229 -0
- package/lib/ListItem/__tests__/ListItem.spec.js +362 -0
- package/lib/ListItem/__tests__/ListItemWithAvatar.spec.js +391 -0
- package/lib/ListItem/__tests__/ListItemWithCheckBox.spec.js +215 -0
- package/lib/ListItem/__tests__/ListItemWithIcon.spec.js +304 -0
- package/lib/ListItem/__tests__/ListItemWithRadio.spec.js +231 -0
- package/lib/ListItem/__tests__/__snapshots__/ListContainer.spec.js.snap +602 -0
- package/lib/ListItem/__tests__/__snapshots__/ListItem.spec.js.snap +1807 -0
- package/lib/ListItem/__tests__/__snapshots__/ListItemWithAvatar.spec.js.snap +2703 -0
- package/lib/ListItem/__tests__/__snapshots__/ListItemWithCheckBox.spec.js.snap +2909 -0
- package/lib/ListItem/__tests__/__snapshots__/ListItemWithIcon.spec.js.snap +2009 -0
- package/lib/ListItem/__tests__/__snapshots__/ListItemWithRadio.spec.js.snap +3070 -0
- package/lib/MultiSelect/MultiSelect.module.css +1 -2
- package/lib/MultiSelect/__tests__/AdvancedGroupMultiSelect.spec.js +692 -0
- package/lib/MultiSelect/__tests__/AdvancedMultiSelect.spec.js +741 -0
- package/lib/MultiSelect/__tests__/EmptyState.spec.js +273 -0
- package/lib/MultiSelect/__tests__/MultiSelect.spec.js +910 -0
- package/lib/MultiSelect/__tests__/MultiSelectHeader.spec.js +51 -0
- package/lib/MultiSelect/__tests__/MultiSelectWithAvatar.spec.js +497 -0
- package/lib/MultiSelect/__tests__/SelectedOptions.spec.js +305 -0
- package/lib/MultiSelect/__tests__/Suggestions.spec.js +375 -0
- package/lib/MultiSelect/__tests__/__snapshots__/AdvancedGroupMultiSelect.spec.js.snap +11785 -0
- package/lib/MultiSelect/__tests__/__snapshots__/AdvancedMultiSelect.spec.js.snap +12083 -0
- package/lib/MultiSelect/__tests__/__snapshots__/EmptyState.spec.js.snap +253 -0
- package/lib/MultiSelect/__tests__/__snapshots__/MultiSelect.spec.js.snap +14052 -0
- package/lib/MultiSelect/__tests__/__snapshots__/MultiSelectHeader.spec.js.snap +136 -0
- package/lib/MultiSelect/__tests__/__snapshots__/MultiSelectWithAvatar.spec.js.snap +11506 -0
- package/lib/MultiSelect/__tests__/__snapshots__/SelectedOptions.spec.js.snap +1382 -0
- package/lib/MultiSelect/__tests__/__snapshots__/Suggestions.spec.js.snap +3611 -0
- package/lib/PopOver/__tests__/PopOver.spec.js +150 -1
- package/lib/PopOver/__tests__/__snapshots__/PopOver.spec.js.snap +1260 -0
- package/lib/ResponsiveDropBox/__tests__/ResponsiveDropBox.spec.js +213 -0
- package/lib/ResponsiveDropBox/__tests__/__snapshots__/ResponsiveDropBox.spec.js.snap +1802 -0
- package/lib/Tab/Tabs.module.css +1 -2
- package/lib/Tab/__tests__/Tab.spec.js +250 -0
- package/lib/Tab/__tests__/TabContent.spec.js +35 -0
- package/lib/Tab/__tests__/TabContentWrapper.spec.js +76 -0
- package/lib/Tab/__tests__/TabWrapper.spec.js +174 -0
- package/lib/Tab/__tests__/Tabs.spec.js +741 -0
- package/lib/Tab/__tests__/__snapshots__/Tab.spec.js.snap +1049 -0
- package/lib/Tab/__tests__/__snapshots__/TabContent.spec.js.snap +99 -0
- package/lib/Tab/__tests__/__snapshots__/TabContentWrapper.spec.js.snap +121 -0
- package/lib/Tab/__tests__/__snapshots__/TabWrapper.spec.js.snap +2002 -0
- package/lib/Tab/__tests__/__snapshots__/Tabs.spec.js.snap +11053 -0
- package/lib/Textarea/Textarea.module.css +1 -1
- package/lib/Tooltip/Tooltip.module.css +1 -2
- package/lib/Tooltip/__tests__/Tooltip.spec.js +629 -0
- package/lib/Tooltip/__tests__/__snapshots__/Tooltip.spec.js.snap +813 -0
- package/lib/Typography/css/Typography.module.css +8 -7
- package/lib/common/common.module.css +4 -4
- package/package.json +6 -5
|
@@ -1,22 +1,174 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
|
|
2
2
|
|
|
3
|
-
exports[`AccordionItem
|
|
3
|
+
exports[`AccordionItem Render with a11y role 1`] = `
|
|
4
4
|
<DocumentFragment>
|
|
5
5
|
<div
|
|
6
6
|
class=""
|
|
7
7
|
data-id="AccordionItem"
|
|
8
8
|
data-selector-id="accordionItem"
|
|
9
9
|
data-test-id="AccordionItem"
|
|
10
|
+
role="tab"
|
|
10
11
|
>
|
|
11
12
|
<div
|
|
12
13
|
class=""
|
|
13
14
|
>
|
|
14
15
|
<div>
|
|
15
|
-
|
|
16
|
+
Header
|
|
16
17
|
</div>
|
|
17
18
|
</div>
|
|
18
19
|
<div>
|
|
19
|
-
|
|
20
|
+
Content
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
</DocumentFragment>
|
|
24
|
+
`;
|
|
25
|
+
|
|
26
|
+
exports[`AccordionItem Render with className 1`] = `
|
|
27
|
+
<DocumentFragment>
|
|
28
|
+
<div
|
|
29
|
+
class="accordion-item-class"
|
|
30
|
+
data-id="AccordionItem"
|
|
31
|
+
data-selector-id="accordionItem"
|
|
32
|
+
data-test-id="AccordionItem"
|
|
33
|
+
>
|
|
34
|
+
<div
|
|
35
|
+
class=""
|
|
36
|
+
>
|
|
37
|
+
<div>
|
|
38
|
+
Header
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
<div>
|
|
42
|
+
Content
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
</DocumentFragment>
|
|
46
|
+
`;
|
|
47
|
+
|
|
48
|
+
exports[`AccordionItem Render with dataId and dataSelectorId 1`] = `
|
|
49
|
+
<DocumentFragment>
|
|
50
|
+
<div
|
|
51
|
+
class=""
|
|
52
|
+
data-id="accordion-item-custom-id"
|
|
53
|
+
data-selector-id="accordion-item-custom-selector-id"
|
|
54
|
+
data-test-id="accordion-item-custom-id"
|
|
55
|
+
>
|
|
56
|
+
<div
|
|
57
|
+
class=""
|
|
58
|
+
>
|
|
59
|
+
<div>
|
|
60
|
+
Header
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
<div>
|
|
64
|
+
Content
|
|
65
|
+
</div>
|
|
66
|
+
</div>
|
|
67
|
+
</DocumentFragment>
|
|
68
|
+
`;
|
|
69
|
+
|
|
70
|
+
exports[`AccordionItem Render with default props 1`] = `
|
|
71
|
+
<DocumentFragment>
|
|
72
|
+
<div
|
|
73
|
+
class=""
|
|
74
|
+
data-id="AccordionItem"
|
|
75
|
+
data-selector-id="accordionItem"
|
|
76
|
+
data-test-id="AccordionItem"
|
|
77
|
+
>
|
|
78
|
+
<div
|
|
79
|
+
class=""
|
|
80
|
+
>
|
|
81
|
+
<div>
|
|
82
|
+
Header
|
|
83
|
+
</div>
|
|
84
|
+
</div>
|
|
85
|
+
<div>
|
|
86
|
+
Content
|
|
87
|
+
</div>
|
|
88
|
+
</div>
|
|
89
|
+
</DocumentFragment>
|
|
90
|
+
`;
|
|
91
|
+
|
|
92
|
+
exports[`AccordionItem Render with equalityCheck override on mismatched selection 1`] = `
|
|
93
|
+
<DocumentFragment>
|
|
94
|
+
<div
|
|
95
|
+
class=""
|
|
96
|
+
data-id="AccordionItem"
|
|
97
|
+
data-selector-id="accordionItem"
|
|
98
|
+
data-test-id="AccordionItem"
|
|
99
|
+
>
|
|
100
|
+
<div
|
|
101
|
+
class=""
|
|
102
|
+
>
|
|
103
|
+
<div>
|
|
104
|
+
Header
|
|
105
|
+
</div>
|
|
106
|
+
</div>
|
|
107
|
+
<div>
|
|
108
|
+
Content
|
|
109
|
+
</div>
|
|
110
|
+
</div>
|
|
111
|
+
</DocumentFragment>
|
|
112
|
+
`;
|
|
113
|
+
|
|
114
|
+
exports[`AccordionItem Render with innerClass 1`] = `
|
|
115
|
+
<DocumentFragment>
|
|
116
|
+
<div
|
|
117
|
+
class=""
|
|
118
|
+
data-id="AccordionItem"
|
|
119
|
+
data-selector-id="accordionItem"
|
|
120
|
+
data-test-id="AccordionItem"
|
|
121
|
+
>
|
|
122
|
+
<div
|
|
123
|
+
class="accordion-item-inner-class"
|
|
124
|
+
>
|
|
125
|
+
<div>
|
|
126
|
+
Header
|
|
127
|
+
</div>
|
|
128
|
+
</div>
|
|
129
|
+
<div>
|
|
130
|
+
Content
|
|
131
|
+
</div>
|
|
132
|
+
</div>
|
|
133
|
+
</DocumentFragment>
|
|
134
|
+
`;
|
|
135
|
+
|
|
136
|
+
exports[`AccordionItem Render with unMountItem=false overriding unMount=true 1`] = `
|
|
137
|
+
<DocumentFragment>
|
|
138
|
+
<div
|
|
139
|
+
class=""
|
|
140
|
+
data-id="AccordionItem"
|
|
141
|
+
data-selector-id="accordionItem"
|
|
142
|
+
data-test-id="AccordionItem"
|
|
143
|
+
>
|
|
144
|
+
<div
|
|
145
|
+
class=""
|
|
146
|
+
>
|
|
147
|
+
<div>
|
|
148
|
+
Header
|
|
149
|
+
</div>
|
|
150
|
+
</div>
|
|
151
|
+
<div>
|
|
152
|
+
Content
|
|
153
|
+
</div>
|
|
154
|
+
</div>
|
|
155
|
+
</DocumentFragment>
|
|
156
|
+
`;
|
|
157
|
+
|
|
158
|
+
exports[`AccordionItem Render with unMountItem=true and mismatched selection 1`] = `
|
|
159
|
+
<DocumentFragment>
|
|
160
|
+
<div
|
|
161
|
+
class=""
|
|
162
|
+
data-id="AccordionItem"
|
|
163
|
+
data-selector-id="accordionItem"
|
|
164
|
+
data-test-id="AccordionItem"
|
|
165
|
+
>
|
|
166
|
+
<div
|
|
167
|
+
class=""
|
|
168
|
+
>
|
|
169
|
+
<div>
|
|
170
|
+
Header
|
|
171
|
+
</div>
|
|
20
172
|
</div>
|
|
21
173
|
</div>
|
|
22
174
|
</DocumentFragment>
|
|
@@ -1,14 +1,38 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { render } from '@testing-library/react';
|
|
2
|
+
import { render, cleanup } from '@testing-library/react';
|
|
3
3
|
import Animation from "../Animation";
|
|
4
4
|
describe('Animation', () => {
|
|
5
|
-
|
|
5
|
+
afterEach(() => cleanup());
|
|
6
|
+
test('Render with default props', () => {
|
|
7
|
+
const {
|
|
8
|
+
asFragment
|
|
9
|
+
} = render( /*#__PURE__*/React.createElement(Animation, null, /*#__PURE__*/React.createElement("div", null, "Animation Content")));
|
|
10
|
+
expect(asFragment()).toMatchSnapshot();
|
|
11
|
+
});
|
|
12
|
+
test('Render with isActive=true', () => {
|
|
13
|
+
const {
|
|
14
|
+
asFragment
|
|
15
|
+
} = render( /*#__PURE__*/React.createElement(Animation, {
|
|
16
|
+
isActive: true
|
|
17
|
+
}, /*#__PURE__*/React.createElement("div", null, "Animation Content")));
|
|
18
|
+
expect(asFragment()).toMatchSnapshot();
|
|
19
|
+
});
|
|
20
|
+
test('Render with unmountOnExit=false and isActive=false', () => {
|
|
21
|
+
const {
|
|
22
|
+
asFragment
|
|
23
|
+
} = render( /*#__PURE__*/React.createElement(Animation, {
|
|
24
|
+
unmountOnExit: false
|
|
25
|
+
}, /*#__PURE__*/React.createElement("div", null, "Animation Content")));
|
|
26
|
+
expect(asFragment()).toMatchSnapshot();
|
|
27
|
+
});
|
|
28
|
+
const names = ['zoomIn', 'scaleIn', 'fadeIn', 'slideLeft', 'slideDown', 'skewIn', 'default', 'none'];
|
|
29
|
+
test.each(names)('Render with name as %s', name => {
|
|
6
30
|
const {
|
|
7
31
|
asFragment
|
|
8
32
|
} = render( /*#__PURE__*/React.createElement(Animation, {
|
|
9
33
|
isActive: true,
|
|
10
|
-
name:
|
|
11
|
-
}, /*#__PURE__*/React.createElement("div", null, "
|
|
34
|
+
name: name
|
|
35
|
+
}, /*#__PURE__*/React.createElement("div", null, "Animation Content")));
|
|
12
36
|
expect(asFragment()).toMatchSnapshot();
|
|
13
37
|
});
|
|
14
38
|
});
|
|
@@ -1,11 +1,101 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
|
|
2
2
|
|
|
3
|
-
exports[`Animation
|
|
3
|
+
exports[`Animation Render with default props 1`] = `<DocumentFragment />`;
|
|
4
|
+
|
|
5
|
+
exports[`Animation Render with isActive=true 1`] = `
|
|
6
|
+
<DocumentFragment>
|
|
7
|
+
<div
|
|
8
|
+
class="fadeInEnter fadeInEnterActive"
|
|
9
|
+
>
|
|
10
|
+
Animation Content
|
|
11
|
+
</div>
|
|
12
|
+
</DocumentFragment>
|
|
13
|
+
`;
|
|
14
|
+
|
|
15
|
+
exports[`Animation Render with name as default 1`] = `
|
|
16
|
+
<DocumentFragment>
|
|
17
|
+
<div
|
|
18
|
+
class="defaultEnter defaultEnterActive"
|
|
19
|
+
>
|
|
20
|
+
Animation Content
|
|
21
|
+
</div>
|
|
22
|
+
</DocumentFragment>
|
|
23
|
+
`;
|
|
24
|
+
|
|
25
|
+
exports[`Animation Render with name as fadeIn 1`] = `
|
|
26
|
+
<DocumentFragment>
|
|
27
|
+
<div
|
|
28
|
+
class="fadeInEnter fadeInEnterActive"
|
|
29
|
+
>
|
|
30
|
+
Animation Content
|
|
31
|
+
</div>
|
|
32
|
+
</DocumentFragment>
|
|
33
|
+
`;
|
|
34
|
+
|
|
35
|
+
exports[`Animation Render with name as none 1`] = `
|
|
36
|
+
<DocumentFragment>
|
|
37
|
+
<div
|
|
38
|
+
class="noneEnter noneEnterActive"
|
|
39
|
+
>
|
|
40
|
+
Animation Content
|
|
41
|
+
</div>
|
|
42
|
+
</DocumentFragment>
|
|
43
|
+
`;
|
|
44
|
+
|
|
45
|
+
exports[`Animation Render with name as scaleIn 1`] = `
|
|
46
|
+
<DocumentFragment>
|
|
47
|
+
<div
|
|
48
|
+
class="scaleInEnter scaleInEnterActive"
|
|
49
|
+
>
|
|
50
|
+
Animation Content
|
|
51
|
+
</div>
|
|
52
|
+
</DocumentFragment>
|
|
53
|
+
`;
|
|
54
|
+
|
|
55
|
+
exports[`Animation Render with name as skewIn 1`] = `
|
|
56
|
+
<DocumentFragment>
|
|
57
|
+
<div
|
|
58
|
+
class="skewInEnter skewInEnterActive"
|
|
59
|
+
>
|
|
60
|
+
Animation Content
|
|
61
|
+
</div>
|
|
62
|
+
</DocumentFragment>
|
|
63
|
+
`;
|
|
64
|
+
|
|
65
|
+
exports[`Animation Render with name as slideDown 1`] = `
|
|
66
|
+
<DocumentFragment>
|
|
67
|
+
<div
|
|
68
|
+
class="slideDownEnter slideDownEnterActive"
|
|
69
|
+
>
|
|
70
|
+
Animation Content
|
|
71
|
+
</div>
|
|
72
|
+
</DocumentFragment>
|
|
73
|
+
`;
|
|
74
|
+
|
|
75
|
+
exports[`Animation Render with name as slideLeft 1`] = `
|
|
76
|
+
<DocumentFragment>
|
|
77
|
+
<div
|
|
78
|
+
class="slideLeftEnter slideLeftEnterActive"
|
|
79
|
+
>
|
|
80
|
+
Animation Content
|
|
81
|
+
</div>
|
|
82
|
+
</DocumentFragment>
|
|
83
|
+
`;
|
|
84
|
+
|
|
85
|
+
exports[`Animation Render with name as zoomIn 1`] = `
|
|
4
86
|
<DocumentFragment>
|
|
5
87
|
<div
|
|
6
88
|
class="zoomInEnter zoomInEnterActive"
|
|
7
89
|
>
|
|
8
|
-
|
|
90
|
+
Animation Content
|
|
91
|
+
</div>
|
|
92
|
+
</DocumentFragment>
|
|
93
|
+
`;
|
|
94
|
+
|
|
95
|
+
exports[`Animation Render with unmountOnExit=false and isActive=false 1`] = `
|
|
96
|
+
<DocumentFragment>
|
|
97
|
+
<div>
|
|
98
|
+
Animation Content
|
|
9
99
|
</div>
|
|
10
100
|
</DocumentFragment>
|
|
11
101
|
`;
|
|
@@ -544,7 +544,7 @@
|
|
|
544
544
|
}
|
|
545
545
|
}
|
|
546
546
|
.successstate {
|
|
547
|
-
|
|
547
|
+
composes: d-absolute from global;
|
|
548
548
|
top: 50% ;
|
|
549
549
|
left: 50% ;
|
|
550
550
|
transform: translate(-50%, -50%);
|
|
@@ -554,8 +554,8 @@
|
|
|
554
554
|
}
|
|
555
555
|
|
|
556
556
|
.tickElement {
|
|
557
|
+
composes: d-relative d-border-solid from global;
|
|
557
558
|
height: var(--zd_size15) ;
|
|
558
|
-
position: relative;
|
|
559
559
|
top: calc( var(--zd_size2) * -1 ) ;
|
|
560
560
|
width: var(--zd_size6) ;
|
|
561
561
|
transform: scaleX(-1) rotate(135deg);
|
|
@@ -563,7 +563,6 @@
|
|
|
563
563
|
-webkit-transform: scaleX(-1) rotate(135deg);
|
|
564
564
|
transform-origin: center;
|
|
565
565
|
border-width: 2px 2px 0 0;
|
|
566
|
-
border-style: solid;
|
|
567
566
|
border-color: var(--button_success_border_color);
|
|
568
567
|
animation: tick var(--zd_no_transition3) ease 0s forwards;
|
|
569
568
|
}
|
package/es/CheckBox/CheckBox.js
CHANGED
|
@@ -128,7 +128,7 @@ export default class CheckBox extends React.Component {
|
|
|
128
128
|
})), checked ? /*#__PURE__*/React.createElement("svg", {
|
|
129
129
|
xmlns: "http://www.w3.org/2000/svg",
|
|
130
130
|
viewBox: "0 0 44 44",
|
|
131
|
-
className: cn(`${style.tick} ${style[`${size}tick`]}
|
|
131
|
+
className: cn(`${disabled ? CssProvider('isDisabled') : ''} ${style.tick} ${style[`${size}tick`]} ${customTickSize}`)
|
|
132
132
|
}, /*#__PURE__*/React.createElement("polyline", {
|
|
133
133
|
points: "12.56 19 19.61 26.06 40.39 5.28",
|
|
134
134
|
className: cn(`${style.tickPath} ${style.checkedtickPath}`)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
.semibold {
|
|
2
|
-
|
|
2
|
+
composes: d-font-semibold from global;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
5
|
.boxPadding {
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
.datesStr {
|
|
26
|
-
|
|
26
|
+
composes: d-font-normal from global;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
.grid {
|
|
@@ -1,12 +1,79 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { render } from '@testing-library/react';
|
|
2
|
+
import { render, cleanup } from '@testing-library/react';
|
|
3
3
|
import CalendarView from "../CalendarView";
|
|
4
|
+
const dayNames = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
|
|
5
|
+
const dayNamesShort = ['S', 'M', 'T', 'W', 'T', 'F', 'S'];
|
|
4
6
|
describe('CalendarView', () => {
|
|
5
|
-
|
|
7
|
+
afterEach(() => cleanup()); // dayNames/dayNamesShort are read unconditionally in render; year/month given real values for a deterministic grid
|
|
8
|
+
|
|
9
|
+
test('Render with default props', () => {
|
|
6
10
|
const {
|
|
7
11
|
asFragment
|
|
8
12
|
} = render( /*#__PURE__*/React.createElement(CalendarView, {
|
|
9
|
-
dayNames:
|
|
13
|
+
dayNames: dayNames,
|
|
14
|
+
dayNamesShort: dayNamesShort,
|
|
15
|
+
year: 2024,
|
|
16
|
+
month: 0
|
|
17
|
+
}));
|
|
18
|
+
expect(asFragment()).toMatchSnapshot();
|
|
19
|
+
});
|
|
20
|
+
test('Render with needBorder=false', () => {
|
|
21
|
+
const {
|
|
22
|
+
asFragment
|
|
23
|
+
} = render( /*#__PURE__*/React.createElement(CalendarView, {
|
|
24
|
+
dayNames: dayNames,
|
|
25
|
+
dayNamesShort: dayNamesShort,
|
|
26
|
+
year: 2024,
|
|
27
|
+
month: 0,
|
|
28
|
+
needBorder: false
|
|
29
|
+
}));
|
|
30
|
+
expect(asFragment()).toMatchSnapshot();
|
|
31
|
+
});
|
|
32
|
+
test('Render with weekStartDay=1', () => {
|
|
33
|
+
const {
|
|
34
|
+
asFragment
|
|
35
|
+
} = render( /*#__PURE__*/React.createElement(CalendarView, {
|
|
36
|
+
dayNames: dayNames,
|
|
37
|
+
dayNamesShort: dayNamesShort,
|
|
38
|
+
year: 2024,
|
|
39
|
+
month: 0,
|
|
40
|
+
weekStartDay: 1
|
|
41
|
+
}));
|
|
42
|
+
expect(asFragment()).toMatchSnapshot();
|
|
43
|
+
});
|
|
44
|
+
test('Render with holidays', () => {
|
|
45
|
+
const {
|
|
46
|
+
asFragment
|
|
47
|
+
} = render( /*#__PURE__*/React.createElement(CalendarView, {
|
|
48
|
+
dayNames: dayNames,
|
|
49
|
+
dayNamesShort: dayNamesShort,
|
|
50
|
+
year: 2024,
|
|
51
|
+
month: 0,
|
|
52
|
+
holidays: [1, 5]
|
|
53
|
+
}));
|
|
54
|
+
expect(asFragment()).toMatchSnapshot();
|
|
55
|
+
});
|
|
56
|
+
test('Render with date selected', () => {
|
|
57
|
+
const {
|
|
58
|
+
asFragment
|
|
59
|
+
} = render( /*#__PURE__*/React.createElement(CalendarView, {
|
|
60
|
+
dayNames: dayNames,
|
|
61
|
+
dayNamesShort: dayNamesShort,
|
|
62
|
+
year: 2024,
|
|
63
|
+
month: 0,
|
|
64
|
+
date: 15
|
|
65
|
+
}));
|
|
66
|
+
expect(asFragment()).toMatchSnapshot();
|
|
67
|
+
});
|
|
68
|
+
test('Render with dataId', () => {
|
|
69
|
+
const {
|
|
70
|
+
asFragment
|
|
71
|
+
} = render( /*#__PURE__*/React.createElement(CalendarView, {
|
|
72
|
+
dayNames: dayNames,
|
|
73
|
+
dayNamesShort: dayNamesShort,
|
|
74
|
+
year: 2024,
|
|
75
|
+
month: 0,
|
|
76
|
+
dataId: "customCalendar"
|
|
10
77
|
}));
|
|
11
78
|
expect(asFragment()).toMatchSnapshot();
|
|
12
79
|
});
|
|
@@ -1,21 +1,104 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { render } from '@testing-library/react';
|
|
3
|
-
import DateTime from "../DateTime";
|
|
2
|
+
import { render, cleanup, fireEvent } from '@testing-library/react';
|
|
3
|
+
import DateTime from "../DateTime"; // the real Virtualizer measures DOM size (0 in jsdom) and the year range spans 1850-9999;
|
|
4
|
+
// mocked to render only the first few rows so the YearView branch stays small and deterministic
|
|
5
|
+
|
|
6
|
+
import { cn } from "@dot-system/css-utility";
|
|
7
|
+
jest.mock('@zohodesk/virtualizer', () => {
|
|
8
|
+
const React = require('react');
|
|
9
|
+
|
|
10
|
+
return {
|
|
11
|
+
Virtualizer: function MockVirtualizer({
|
|
12
|
+
elementRenderer,
|
|
13
|
+
elementsCount,
|
|
14
|
+
className,
|
|
15
|
+
dataId
|
|
16
|
+
}) {
|
|
17
|
+
const count = Math.min(elementsCount, 3);
|
|
18
|
+
const items = [];
|
|
19
|
+
|
|
20
|
+
for (let index = 0; index < count; index++) {
|
|
21
|
+
items.push( /*#__PURE__*/React.createElement(React.Fragment, {
|
|
22
|
+
key: index
|
|
23
|
+
}, elementRenderer({
|
|
24
|
+
index,
|
|
25
|
+
style: {},
|
|
26
|
+
ref: () => {}
|
|
27
|
+
})));
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
31
|
+
className: cn(className),
|
|
32
|
+
"data-id": dataId
|
|
33
|
+
}, items);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
});
|
|
4
37
|
describe('DateTime', () => {
|
|
5
|
-
|
|
38
|
+
afterEach(() => cleanup()); // isReady defaults to falsy and isDefaultPosition defaults to false, so DateTime renders nothing by default
|
|
39
|
+
|
|
40
|
+
test('Render with default props', () => {
|
|
6
41
|
const {
|
|
7
42
|
asFragment
|
|
8
43
|
} = render( /*#__PURE__*/React.createElement(DateTime, null));
|
|
9
44
|
expect(asFragment()).toMatchSnapshot();
|
|
45
|
+
}); // isDefaultPosition bypasses the ResponsiveDropBox/isReady gate and renders the calendar content directly
|
|
46
|
+
|
|
47
|
+
test('Render with isDefaultPosition', () => {
|
|
48
|
+
const {
|
|
49
|
+
asFragment
|
|
50
|
+
} = render( /*#__PURE__*/React.createElement(DateTime, {
|
|
51
|
+
isDefaultPosition: true
|
|
52
|
+
}));
|
|
53
|
+
expect(asFragment()).toMatchSnapshot();
|
|
54
|
+
});
|
|
55
|
+
test('Render with isDefaultPosition and value', () => {
|
|
56
|
+
const {
|
|
57
|
+
asFragment
|
|
58
|
+
} = render( /*#__PURE__*/React.createElement(DateTime, {
|
|
59
|
+
isDefaultPosition: true,
|
|
60
|
+
value: "2024-01-15T10:20:00.000"
|
|
61
|
+
}));
|
|
62
|
+
expect(asFragment()).toMatchSnapshot();
|
|
10
63
|
});
|
|
11
|
-
test('
|
|
64
|
+
test('Render with isDefaultPosition and is24Hour', () => {
|
|
65
|
+
const {
|
|
66
|
+
asFragment
|
|
67
|
+
} = render( /*#__PURE__*/React.createElement(DateTime, {
|
|
68
|
+
isDefaultPosition: true,
|
|
69
|
+
is24Hour: true
|
|
70
|
+
}));
|
|
71
|
+
expect(asFragment()).toMatchSnapshot();
|
|
72
|
+
}); // the footer renders only when needAction is truthy (default); needAction=false is the negative case
|
|
73
|
+
|
|
74
|
+
test('Render with isDefaultPosition and needAction=false', () => {
|
|
75
|
+
const {
|
|
76
|
+
asFragment
|
|
77
|
+
} = render( /*#__PURE__*/React.createElement(DateTime, {
|
|
78
|
+
isDefaultPosition: true,
|
|
79
|
+
needAction: false
|
|
80
|
+
}));
|
|
81
|
+
expect(asFragment()).toMatchSnapshot();
|
|
82
|
+
}); // the Time section renders only when isDateTimeField is truthy (default); isDateTimeField=false is the negative case
|
|
83
|
+
|
|
84
|
+
test('Render with isDefaultPosition and isDateTimeField=false', () => {
|
|
12
85
|
const {
|
|
13
86
|
asFragment
|
|
14
87
|
} = render( /*#__PURE__*/React.createElement(DateTime, {
|
|
15
|
-
isActive: true,
|
|
16
88
|
isDefaultPosition: true,
|
|
17
|
-
|
|
89
|
+
isDateTimeField: false
|
|
90
|
+
}));
|
|
91
|
+
expect(asFragment()).toMatchSnapshot();
|
|
92
|
+
}); // clicking the month/year heading toggles the internal isYearView state, revealing the YearView section
|
|
93
|
+
|
|
94
|
+
test('Render after opening the year view', () => {
|
|
95
|
+
const {
|
|
96
|
+
asFragment,
|
|
97
|
+
container
|
|
98
|
+
} = render( /*#__PURE__*/React.createElement(DateTime, {
|
|
99
|
+
isDefaultPosition: true
|
|
18
100
|
}));
|
|
101
|
+
fireEvent.click(container.querySelector('[data-id="selectYear"]'));
|
|
19
102
|
expect(asFragment()).toMatchSnapshot();
|
|
20
103
|
});
|
|
21
104
|
});
|
|
@@ -1,11 +1,29 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { render } from '@testing-library/react';
|
|
2
|
+
import { render, cleanup } from '@testing-library/react';
|
|
3
3
|
import DateTimePopupFooter from "../DateTimePopupFooter";
|
|
4
4
|
describe('DateTimePopupFooter', () => {
|
|
5
|
-
|
|
5
|
+
afterEach(() => cleanup());
|
|
6
|
+
test('Render with default props', () => {
|
|
6
7
|
const {
|
|
7
8
|
asFragment
|
|
8
9
|
} = render( /*#__PURE__*/React.createElement(DateTimePopupFooter, null));
|
|
9
10
|
expect(asFragment()).toMatchSnapshot();
|
|
10
11
|
});
|
|
12
|
+
test('Render with submitText and cancelText', () => {
|
|
13
|
+
const {
|
|
14
|
+
asFragment
|
|
15
|
+
} = render( /*#__PURE__*/React.createElement(DateTimePopupFooter, {
|
|
16
|
+
submitText: "Save",
|
|
17
|
+
cancelText: "Cancel"
|
|
18
|
+
}));
|
|
19
|
+
expect(asFragment()).toMatchSnapshot();
|
|
20
|
+
});
|
|
21
|
+
test('Render with dataId', () => {
|
|
22
|
+
const {
|
|
23
|
+
asFragment
|
|
24
|
+
} = render( /*#__PURE__*/React.createElement(DateTimePopupFooter, {
|
|
25
|
+
dataId: "customFooter"
|
|
26
|
+
}));
|
|
27
|
+
expect(asFragment()).toMatchSnapshot();
|
|
28
|
+
});
|
|
11
29
|
});
|
|
@@ -1,11 +1,38 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { render } from '@testing-library/react';
|
|
2
|
+
import { render, cleanup } from '@testing-library/react';
|
|
3
3
|
import DateTimePopupHeader from "../DateTimePopupHeader";
|
|
4
4
|
describe('DateTimePopupHeader', () => {
|
|
5
|
-
|
|
5
|
+
afterEach(() => cleanup());
|
|
6
|
+
test('Render with default props', () => {
|
|
6
7
|
const {
|
|
7
8
|
asFragment
|
|
8
9
|
} = render( /*#__PURE__*/React.createElement(DateTimePopupHeader, null));
|
|
9
10
|
expect(asFragment()).toMatchSnapshot();
|
|
10
11
|
});
|
|
12
|
+
test('Render with showMonthTxt', () => {
|
|
13
|
+
const {
|
|
14
|
+
asFragment
|
|
15
|
+
} = render( /*#__PURE__*/React.createElement(DateTimePopupHeader, {
|
|
16
|
+
showMonthTxt: "January 2024"
|
|
17
|
+
}));
|
|
18
|
+
expect(asFragment()).toMatchSnapshot();
|
|
19
|
+
}); // nav arrows render only when isYearView is falsy; isYearView=true is the negative case
|
|
20
|
+
|
|
21
|
+
test('Render with isYearView=true', () => {
|
|
22
|
+
const {
|
|
23
|
+
asFragment
|
|
24
|
+
} = render( /*#__PURE__*/React.createElement(DateTimePopupHeader, {
|
|
25
|
+
isYearView: true
|
|
26
|
+
}));
|
|
27
|
+
expect(asFragment()).toMatchSnapshot();
|
|
28
|
+
});
|
|
29
|
+
test('Render with prevMonthTitleText and nextMonthTitleText', () => {
|
|
30
|
+
const {
|
|
31
|
+
asFragment
|
|
32
|
+
} = render( /*#__PURE__*/React.createElement(DateTimePopupHeader, {
|
|
33
|
+
prevMonthTitleText: "Previous Month",
|
|
34
|
+
nextMonthTitleText: "Next Month"
|
|
35
|
+
}));
|
|
36
|
+
expect(asFragment()).toMatchSnapshot();
|
|
37
|
+
});
|
|
11
38
|
});
|