@zohodesk/components 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -1
- package/assets/Appearance/dark/themes/blue/blue_ComponentTheme_DarkTheme.module.css +24 -24
- package/assets/Appearance/dark/themes/green/green_ComponentTheme_DarkTheme.module.css +24 -24
- package/assets/Appearance/dark/themes/orange/orange_ComponentTheme_DarkTheme.module.css +24 -24
- package/assets/Appearance/dark/themes/red/red_ComponentTheme_DarkTheme.module.css +24 -24
- package/assets/Appearance/dark/themes/yellow/yellow_ComponentTheme_DarkTheme.module.css +24 -24
- package/assets/Appearance/light/themes/blue/blue_ComponentTheme_LightTheme.module.css +24 -24
- package/assets/Appearance/light/themes/green/green_ComponentTheme_LightTheme.module.css +24 -24
- package/assets/Appearance/light/themes/orange/orange_ComponentTheme_LightTheme.module.css +24 -24
- package/assets/Appearance/light/themes/red/red_ComponentTheme_LightTheme.module.css +24 -24
- package/assets/Appearance/light/themes/yellow/yellow_ComponentTheme_LightTheme.module.css +24 -24
- package/assets/Appearance/pureDark/themes/blue/blue_ComponentTheme_PureDarkTheme.module.css +24 -24
- package/assets/Appearance/pureDark/themes/green/green_ComponentTheme_PureDarkTheme.module.css +24 -24
- package/assets/Appearance/pureDark/themes/orange/orange_ComponentTheme_PureDarkTheme.module.css +24 -24
- package/assets/Appearance/pureDark/themes/red/red_ComponentTheme_PureDarkTheme.module.css +24 -24
- package/assets/Appearance/pureDark/themes/yellow/yellow_ComponentTheme_PureDarkTheme.module.css +24 -24
- package/es/Button/__tests__/Button.spec.js +61 -0
- package/es/Button/__tests__/__snapshots__/Button.spec.js.snap +440 -0
- package/lib/Button/__tests__/Button.spec.js +62 -0
- package/lib/Button/__tests__/__snapshots__/Button.spec.js.snap +440 -0
- package/package.json +12 -7
- package/result.json +1 -0
- package/es/Accordion/__tests__/Accordion.spec.js +0 -79
- package/es/Animation/__tests__/Animation.spec.js +0 -17
- package/es/Avatar/__tests__/Avatar.spec.js +0 -161
- package/es/Avatar/__tests__/__snapshots__/Avatar.spec.js.snap +0 -288
- package/es/AvatarTeam/__tests__/AvatarTeam.spec.js +0 -76
- package/es/AvatarTeam/__tests__/__snapshots__/AvatarTeam.spec.js.snap +0 -226
- package/es/Buttongroup/__test__/Buttongroup.spec.js +0 -73
- package/es/Buttongroup/__test__/__snapshots__/Buttongroup.spec.js.snap +0 -146
- package/es/Card/__tests__/Card.spec.js +0 -36
- package/es/CheckBox/__tests__/CheckBox.spec.js +0 -12
- package/es/DateTime/__tests__/CalendarView.spec.js +0 -33
- package/es/DateTime/__tests__/DateTime.spec.js +0 -115
- package/es/DateTime/__tests__/DateWidget.spec.js +0 -75
- package/es/DropBox/__tests__/DropBox.spec.js +0 -81
- package/es/DropDown/__tests__/DropDown.spec.js +0 -44
- package/es/DropDown/__tests__/DropDownItem.spec.js +0 -45
- package/es/DropDown/__tests__/DropDownSearch.spec.js +0 -11
- package/es/Label/__tests__/Label.spec.js +0 -120
- package/es/Label/__tests__/__snapshots__/Label.spec.js.snap +0 -101
- package/es/Layout/__tests__/Box.spec.js +0 -114
- package/es/Layout/__tests__/Container.spec.js +0 -120
- package/es/MultiSelect/__tests__/MultiSelect.spec.js +0 -160
- package/es/PopOver/__tests__/PopOver.spec.js +0 -14
- package/es/Popup/__tests__/Popup.spec.js +0 -134
- package/es/Radio/__tests__/Radiospec.js +0 -23
- package/es/Ribbon/__tests__/Ribbon.spec.js +0 -168
- package/es/Ribbon/__tests__/__snapshots__/Ribbon.spec.js.snap +0 -163
- package/es/Select/__tests__/Select.spec.js +0 -345
- package/es/Stencils/__tests__/Stencils.spec.js +0 -69
- package/es/Stencils/__tests__/__snapshots__/Stencils.spec.js.snap +0 -49
- package/es/Tab/__tests__/Tab.spec.js +0 -117
- package/es/Tab/__tests__/TabContent.spec.js +0 -16
- package/es/Tab/__tests__/TabContentWrapper.spec.js +0 -50
- package/es/Tab/__tests__/TabWrapper.spec.js +0 -86
- package/es/Tab/__tests__/Tabs.spec.js +0 -115
- package/es/Tag/__tests__/Tag.spec.js +0 -28
- package/es/TextBox/__tests__/TextBox.spec.js +0 -189
- package/es/TextBox/__tests__/__snapshots__/TextBox.spec.js.snap +0 -127
- package/es/TextBoxIcon/__tests__/TextBoxIcon.spec.js +0 -212
- package/es/TextBoxIcon/__tests__/__snapshots__/TextBoxIcon.spec.js.snap +0 -334
- package/es/Textarea/__tests__/Textarea.spec.js +0 -171
- package/es/Textarea/__tests__/__snapshots__/Textarea.spec.js.snap +0 -97
- package/es/Tooltip/__tests__/Tooltip.spec.js +0 -52
- package/es/utils/__tests__/constructFullName.spec.js +0 -9
- package/es/utils/__tests__/debounce.spec.js +0 -37
- package/es/utils/__tests__/getInitial.spec.js +0 -23
- package/lib/Accordion/__tests__/Accordion.spec.js +0 -85
- package/lib/Animation/__tests__/Animation.spec.js +0 -23
- package/lib/Avatar/__tests__/Avatar.spec.js +0 -208
- package/lib/Avatar/__tests__/__snapshots__/Avatar.spec.js.snap +0 -288
- package/lib/AvatarTeam/__tests__/AvatarTeam.spec.js +0 -92
- package/lib/AvatarTeam/__tests__/__snapshots__/AvatarTeam.spec.js.snap +0 -226
- package/lib/Buttongroup/__test__/Buttongroup.spec.js +0 -86
- package/lib/Buttongroup/__test__/__snapshots__/Buttongroup.spec.js.snap +0 -146
- package/lib/Card/__tests__/Card.spec.js +0 -56
- package/lib/CheckBox/__tests__/CheckBox.spec.js +0 -18
- package/lib/DateTime/__tests__/CalendarView.spec.js +0 -45
- package/lib/DateTime/__tests__/DateTime.spec.js +0 -127
- package/lib/DateTime/__tests__/DateWidget.spec.js +0 -81
- package/lib/DropBox/__tests__/DropBox.spec.js +0 -87
- package/lib/DropDown/__tests__/DropDown.spec.js +0 -50
- package/lib/DropDown/__tests__/DropDownItem.spec.js +0 -51
- package/lib/DropDown/__tests__/DropDownSearch.spec.js +0 -17
- package/lib/Label/__tests__/Label.spec.js +0 -137
- package/lib/Label/__tests__/__snapshots__/Label.spec.js.snap +0 -101
- package/lib/Layout/__tests__/Box.spec.js +0 -121
- package/lib/Layout/__tests__/Container.spec.js +0 -127
- package/lib/MultiSelect/__tests__/MultiSelect.spec.js +0 -170
- package/lib/PopOver/__tests__/PopOver.spec.js +0 -20
- package/lib/Popup/__tests__/Popup.spec.js +0 -192
- package/lib/Radio/__tests__/Radiospec.js +0 -29
- package/lib/Ribbon/__tests__/Ribbon.spec.js +0 -193
- package/lib/Ribbon/__tests__/__snapshots__/Ribbon.spec.js.snap +0 -163
- package/lib/Select/__tests__/Select.spec.js +0 -383
- package/lib/Stencils/__tests__/Stencils.spec.js +0 -84
- package/lib/Stencils/__tests__/__snapshots__/Stencils.spec.js.snap +0 -49
- package/lib/Tab/__tests__/Tab.spec.js +0 -123
- package/lib/Tab/__tests__/TabContent.spec.js +0 -22
- package/lib/Tab/__tests__/TabContentWrapper.spec.js +0 -59
- package/lib/Tab/__tests__/TabWrapper.spec.js +0 -100
- package/lib/Tab/__tests__/Tabs.spec.js +0 -123
- package/lib/Tag/__tests__/Tag.spec.js +0 -35
- package/lib/TextBox/__tests__/TextBox.spec.js +0 -205
- package/lib/TextBox/__tests__/__snapshots__/TextBox.spec.js.snap +0 -127
- package/lib/TextBoxIcon/__tests__/TextBoxIcon.spec.js +0 -228
- package/lib/TextBoxIcon/__tests__/__snapshots__/TextBoxIcon.spec.js.snap +0 -334
- package/lib/Textarea/__tests__/Textarea.spec.js +0 -186
- package/lib/Textarea/__tests__/__snapshots__/Textarea.spec.js.snap +0 -97
- package/lib/Tooltip/__tests__/Tooltip.spec.js +0 -98
- package/lib/utils/__tests__/constructFullName.spec.js +0 -12
- package/lib/utils/__tests__/debounce.spec.js +0 -40
- package/lib/utils/__tests__/getInitial.spec.js +0 -26
|
@@ -1,226 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`AvatarTeam component should display initial 1`] = `
|
|
4
|
-
<span
|
|
5
|
-
className="container medium primary"
|
|
6
|
-
data-id="avatarTeamComp"
|
|
7
|
-
>
|
|
8
|
-
<div
|
|
9
|
-
className="avatar medium medium circle primary text_black
|
|
10
|
-
border"
|
|
11
|
-
data-id="Avatar"
|
|
12
|
-
data-title="vimalesan a"
|
|
13
|
-
onClick={[Function]}
|
|
14
|
-
>
|
|
15
|
-
<span
|
|
16
|
-
className="initial initialTxt"
|
|
17
|
-
data-id="Avatar_AvatarInitial"
|
|
18
|
-
>
|
|
19
|
-
VA
|
|
20
|
-
</span>
|
|
21
|
-
</div>
|
|
22
|
-
<span
|
|
23
|
-
className="team nofill"
|
|
24
|
-
/>
|
|
25
|
-
</span>
|
|
26
|
-
`;
|
|
27
|
-
|
|
28
|
-
exports[`AvatarTeam component should is filled 1`] = `
|
|
29
|
-
<span
|
|
30
|
-
className="container medium primary"
|
|
31
|
-
data-id="avatarTeamComp"
|
|
32
|
-
>
|
|
33
|
-
<div
|
|
34
|
-
className="avatar medium medium circle primary text_black
|
|
35
|
-
border"
|
|
36
|
-
data-id="Avatar"
|
|
37
|
-
data-title="vimalesan a"
|
|
38
|
-
onClick={[Function]}
|
|
39
|
-
>
|
|
40
|
-
<span
|
|
41
|
-
className="initial initialTxt"
|
|
42
|
-
data-id="Avatar_AvatarInitial"
|
|
43
|
-
>
|
|
44
|
-
VA
|
|
45
|
-
</span>
|
|
46
|
-
</div>
|
|
47
|
-
<span
|
|
48
|
-
className="team filled"
|
|
49
|
-
/>
|
|
50
|
-
</span>
|
|
51
|
-
`;
|
|
52
|
-
|
|
53
|
-
exports[`AvatarTeam component should the palette is info 1`] = `
|
|
54
|
-
<span
|
|
55
|
-
className="container medium info"
|
|
56
|
-
data-id="avatarTeamComp"
|
|
57
|
-
>
|
|
58
|
-
<div
|
|
59
|
-
className="avatar medium medium circle info text_black
|
|
60
|
-
border"
|
|
61
|
-
data-id="Avatar"
|
|
62
|
-
data-title="vimalesan a"
|
|
63
|
-
onClick={[Function]}
|
|
64
|
-
>
|
|
65
|
-
<span
|
|
66
|
-
className="initial initialTxt"
|
|
67
|
-
data-id="Avatar_AvatarInitial"
|
|
68
|
-
>
|
|
69
|
-
VA
|
|
70
|
-
</span>
|
|
71
|
-
</div>
|
|
72
|
-
<span
|
|
73
|
-
className="team nofill"
|
|
74
|
-
/>
|
|
75
|
-
</span>
|
|
76
|
-
`;
|
|
77
|
-
|
|
78
|
-
exports[`AvatarTeam component should the palette is secondary 1`] = `
|
|
79
|
-
<span
|
|
80
|
-
className="container medium secondary"
|
|
81
|
-
data-id="avatarTeamComp"
|
|
82
|
-
>
|
|
83
|
-
<div
|
|
84
|
-
className="avatar medium medium circle secondary text_white
|
|
85
|
-
border"
|
|
86
|
-
data-id="Avatar"
|
|
87
|
-
data-title="vimalesan a"
|
|
88
|
-
onClick={[Function]}
|
|
89
|
-
>
|
|
90
|
-
<span
|
|
91
|
-
className="initial initialTxt"
|
|
92
|
-
data-id="Avatar_AvatarInitial"
|
|
93
|
-
>
|
|
94
|
-
VA
|
|
95
|
-
</span>
|
|
96
|
-
</div>
|
|
97
|
-
<span
|
|
98
|
-
className="team nofill"
|
|
99
|
-
/>
|
|
100
|
-
</span>
|
|
101
|
-
`;
|
|
102
|
-
|
|
103
|
-
exports[`AvatarTeam component should the size is large 1`] = `
|
|
104
|
-
<span
|
|
105
|
-
className="container large primary"
|
|
106
|
-
data-id="avatarTeamComp"
|
|
107
|
-
>
|
|
108
|
-
<div
|
|
109
|
-
className="avatar large large circle primary text_black
|
|
110
|
-
border"
|
|
111
|
-
data-id="Avatar"
|
|
112
|
-
data-title="vimalesan a"
|
|
113
|
-
onClick={[Function]}
|
|
114
|
-
>
|
|
115
|
-
<span
|
|
116
|
-
className="initial initialTxt"
|
|
117
|
-
data-id="Avatar_AvatarInitial"
|
|
118
|
-
>
|
|
119
|
-
VA
|
|
120
|
-
</span>
|
|
121
|
-
</div>
|
|
122
|
-
<span
|
|
123
|
-
className="team nofill"
|
|
124
|
-
/>
|
|
125
|
-
</span>
|
|
126
|
-
`;
|
|
127
|
-
|
|
128
|
-
exports[`AvatarTeam component should the size is small 1`] = `
|
|
129
|
-
<span
|
|
130
|
-
className="container small primary"
|
|
131
|
-
data-id="avatarTeamComp"
|
|
132
|
-
>
|
|
133
|
-
<div
|
|
134
|
-
className="avatar small small circle primary text_black
|
|
135
|
-
border"
|
|
136
|
-
data-id="Avatar"
|
|
137
|
-
data-title="vimalesan a"
|
|
138
|
-
onClick={[Function]}
|
|
139
|
-
>
|
|
140
|
-
<span
|
|
141
|
-
className="initial initialTxt"
|
|
142
|
-
data-id="Avatar_AvatarInitial"
|
|
143
|
-
>
|
|
144
|
-
VA
|
|
145
|
-
</span>
|
|
146
|
-
</div>
|
|
147
|
-
<span
|
|
148
|
-
className="team nofill"
|
|
149
|
-
/>
|
|
150
|
-
</span>
|
|
151
|
-
`;
|
|
152
|
-
|
|
153
|
-
exports[`AvatarTeam component should the size is xlarge 1`] = `
|
|
154
|
-
<span
|
|
155
|
-
className="container xlarge primary"
|
|
156
|
-
data-id="avatarTeamComp"
|
|
157
|
-
>
|
|
158
|
-
<div
|
|
159
|
-
className="avatar xlarge xlarge circle primary text_black
|
|
160
|
-
border"
|
|
161
|
-
data-id="Avatar"
|
|
162
|
-
data-title="vimalesan a"
|
|
163
|
-
onClick={[Function]}
|
|
164
|
-
>
|
|
165
|
-
<span
|
|
166
|
-
className="initial initialTxt"
|
|
167
|
-
data-id="Avatar_AvatarInitial"
|
|
168
|
-
>
|
|
169
|
-
VA
|
|
170
|
-
</span>
|
|
171
|
-
</div>
|
|
172
|
-
<span
|
|
173
|
-
className="team nofill"
|
|
174
|
-
/>
|
|
175
|
-
</span>
|
|
176
|
-
`;
|
|
177
|
-
|
|
178
|
-
exports[`AvatarTeam component should the size is xmedium 1`] = `
|
|
179
|
-
<span
|
|
180
|
-
className="container xmedium primary"
|
|
181
|
-
data-id="avatarTeamComp"
|
|
182
|
-
>
|
|
183
|
-
<div
|
|
184
|
-
className="avatar xmedium xmedium circle primary text_black
|
|
185
|
-
border"
|
|
186
|
-
data-id="Avatar"
|
|
187
|
-
data-title="vimalesan a"
|
|
188
|
-
onClick={[Function]}
|
|
189
|
-
>
|
|
190
|
-
<span
|
|
191
|
-
className="initial initialTxt"
|
|
192
|
-
data-id="Avatar_AvatarInitial"
|
|
193
|
-
>
|
|
194
|
-
VA
|
|
195
|
-
</span>
|
|
196
|
-
</div>
|
|
197
|
-
<span
|
|
198
|
-
className="team nofill"
|
|
199
|
-
/>
|
|
200
|
-
</span>
|
|
201
|
-
`;
|
|
202
|
-
|
|
203
|
-
exports[`AvatarTeam component should the size is xsmall 1`] = `
|
|
204
|
-
<span
|
|
205
|
-
className="container xsmall primary"
|
|
206
|
-
data-id="avatarTeamComp"
|
|
207
|
-
>
|
|
208
|
-
<div
|
|
209
|
-
className="avatar xsmall xsmall circle primary text_black
|
|
210
|
-
border"
|
|
211
|
-
data-id="Avatar"
|
|
212
|
-
data-title="vimalesan a"
|
|
213
|
-
onClick={[Function]}
|
|
214
|
-
>
|
|
215
|
-
<span
|
|
216
|
-
className="initial initialTxt"
|
|
217
|
-
data-id="Avatar_AvatarInitial"
|
|
218
|
-
>
|
|
219
|
-
VA
|
|
220
|
-
</span>
|
|
221
|
-
</div>
|
|
222
|
-
<span
|
|
223
|
-
className="team nofill"
|
|
224
|
-
/>
|
|
225
|
-
</span>
|
|
226
|
-
`;
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import Buttongroup from '../Buttongroup';
|
|
3
|
-
import Button from '../../Button/Button';
|
|
4
|
-
import renderer from 'react-test-renderer';
|
|
5
|
-
describe('Button component', () => {
|
|
6
|
-
it('should the type is footer', () => {
|
|
7
|
-
let ele = renderer.create( /*#__PURE__*/React.createElement(Buttongroup, {
|
|
8
|
-
type: "footer"
|
|
9
|
-
}, /*#__PURE__*/React.createElement(Button, {
|
|
10
|
-
text: "Submit",
|
|
11
|
-
palette: "primaryFilled"
|
|
12
|
-
}), /*#__PURE__*/React.createElement(Button, {
|
|
13
|
-
text: "Cancel",
|
|
14
|
-
palette: "secondary"
|
|
15
|
-
})));
|
|
16
|
-
let tree = ele.toJSON();
|
|
17
|
-
expect(tree).toMatchSnapshot();
|
|
18
|
-
});
|
|
19
|
-
it('should the type is header', () => {
|
|
20
|
-
let ele = renderer.create( /*#__PURE__*/React.createElement(Buttongroup, {
|
|
21
|
-
type: "header"
|
|
22
|
-
}, /*#__PURE__*/React.createElement(Button, {
|
|
23
|
-
text: "Submit",
|
|
24
|
-
palette: "primaryFilled"
|
|
25
|
-
}), /*#__PURE__*/React.createElement(Button, {
|
|
26
|
-
text: "Cancel",
|
|
27
|
-
palette: "secondary"
|
|
28
|
-
})));
|
|
29
|
-
let tree = ele.toJSON();
|
|
30
|
-
expect(tree).toMatchSnapshot();
|
|
31
|
-
});
|
|
32
|
-
it('should the button position is left', () => {
|
|
33
|
-
let ele = renderer.create( /*#__PURE__*/React.createElement(Buttongroup, {
|
|
34
|
-
type: "footer"
|
|
35
|
-
}, /*#__PURE__*/React.createElement(Button, {
|
|
36
|
-
text: "Submit",
|
|
37
|
-
palette: "primaryFilled"
|
|
38
|
-
}), /*#__PURE__*/React.createElement(Button, {
|
|
39
|
-
text: "Cancel",
|
|
40
|
-
palette: "secondary"
|
|
41
|
-
})));
|
|
42
|
-
let tree = ele.toJSON();
|
|
43
|
-
expect(tree).toMatchSnapshot();
|
|
44
|
-
});
|
|
45
|
-
it('should the button position is right', () => {
|
|
46
|
-
let ele = renderer.create( /*#__PURE__*/React.createElement(Buttongroup, {
|
|
47
|
-
type: "footer",
|
|
48
|
-
buttonPosition: "right"
|
|
49
|
-
}, /*#__PURE__*/React.createElement(Button, {
|
|
50
|
-
text: "Submit",
|
|
51
|
-
palette: "primaryFilled"
|
|
52
|
-
}), /*#__PURE__*/React.createElement(Button, {
|
|
53
|
-
text: "Cancel",
|
|
54
|
-
palette: "secondary"
|
|
55
|
-
})));
|
|
56
|
-
let tree = ele.toJSON();
|
|
57
|
-
expect(tree).toMatchSnapshot();
|
|
58
|
-
});
|
|
59
|
-
it('should the button position is center', () => {
|
|
60
|
-
let ele = renderer.create( /*#__PURE__*/React.createElement(Buttongroup, {
|
|
61
|
-
type: "footer",
|
|
62
|
-
buttonPosition: "center"
|
|
63
|
-
}, /*#__PURE__*/React.createElement(Button, {
|
|
64
|
-
text: "Submit",
|
|
65
|
-
palette: "primaryFilled"
|
|
66
|
-
}), /*#__PURE__*/React.createElement(Button, {
|
|
67
|
-
text: "Cancel",
|
|
68
|
-
palette: "secondary"
|
|
69
|
-
})));
|
|
70
|
-
let tree = ele.toJSON();
|
|
71
|
-
expect(tree).toMatchSnapshot();
|
|
72
|
-
});
|
|
73
|
-
});
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`Button component should the button position is center 1`] = `
|
|
4
|
-
<div
|
|
5
|
-
className="buttonGroup footer"
|
|
6
|
-
>
|
|
7
|
-
<div
|
|
8
|
-
className="aligncenter"
|
|
9
|
-
>
|
|
10
|
-
<button
|
|
11
|
-
className=" primaryfilled medium bold "
|
|
12
|
-
data-id="buttonComp"
|
|
13
|
-
disabled={false}
|
|
14
|
-
onClick={[Function]}
|
|
15
|
-
type="button"
|
|
16
|
-
>
|
|
17
|
-
Submit
|
|
18
|
-
</button>
|
|
19
|
-
<button
|
|
20
|
-
className=" secondary medium bold "
|
|
21
|
-
data-id="buttonComp"
|
|
22
|
-
disabled={false}
|
|
23
|
-
onClick={[Function]}
|
|
24
|
-
type="button"
|
|
25
|
-
>
|
|
26
|
-
Cancel
|
|
27
|
-
</button>
|
|
28
|
-
</div>
|
|
29
|
-
</div>
|
|
30
|
-
`;
|
|
31
|
-
|
|
32
|
-
exports[`Button component should the button position is left 1`] = `
|
|
33
|
-
<div
|
|
34
|
-
className="buttonGroup footer"
|
|
35
|
-
>
|
|
36
|
-
<div
|
|
37
|
-
className="alignleft"
|
|
38
|
-
>
|
|
39
|
-
<button
|
|
40
|
-
className=" primaryfilled medium bold "
|
|
41
|
-
data-id="buttonComp"
|
|
42
|
-
disabled={false}
|
|
43
|
-
onClick={[Function]}
|
|
44
|
-
type="button"
|
|
45
|
-
>
|
|
46
|
-
Submit
|
|
47
|
-
</button>
|
|
48
|
-
<button
|
|
49
|
-
className=" secondary medium bold "
|
|
50
|
-
data-id="buttonComp"
|
|
51
|
-
disabled={false}
|
|
52
|
-
onClick={[Function]}
|
|
53
|
-
type="button"
|
|
54
|
-
>
|
|
55
|
-
Cancel
|
|
56
|
-
</button>
|
|
57
|
-
</div>
|
|
58
|
-
</div>
|
|
59
|
-
`;
|
|
60
|
-
|
|
61
|
-
exports[`Button component should the button position is right 1`] = `
|
|
62
|
-
<div
|
|
63
|
-
className="buttonGroup footer"
|
|
64
|
-
>
|
|
65
|
-
<div
|
|
66
|
-
className="alignright"
|
|
67
|
-
>
|
|
68
|
-
<button
|
|
69
|
-
className=" primaryfilled medium bold "
|
|
70
|
-
data-id="buttonComp"
|
|
71
|
-
disabled={false}
|
|
72
|
-
onClick={[Function]}
|
|
73
|
-
type="button"
|
|
74
|
-
>
|
|
75
|
-
Submit
|
|
76
|
-
</button>
|
|
77
|
-
<button
|
|
78
|
-
className=" secondary medium bold "
|
|
79
|
-
data-id="buttonComp"
|
|
80
|
-
disabled={false}
|
|
81
|
-
onClick={[Function]}
|
|
82
|
-
type="button"
|
|
83
|
-
>
|
|
84
|
-
Cancel
|
|
85
|
-
</button>
|
|
86
|
-
</div>
|
|
87
|
-
</div>
|
|
88
|
-
`;
|
|
89
|
-
|
|
90
|
-
exports[`Button component should the type is footer 1`] = `
|
|
91
|
-
<div
|
|
92
|
-
className="buttonGroup footer"
|
|
93
|
-
>
|
|
94
|
-
<div
|
|
95
|
-
className="alignleft"
|
|
96
|
-
>
|
|
97
|
-
<button
|
|
98
|
-
className=" primaryfilled medium bold "
|
|
99
|
-
data-id="buttonComp"
|
|
100
|
-
disabled={false}
|
|
101
|
-
onClick={[Function]}
|
|
102
|
-
type="button"
|
|
103
|
-
>
|
|
104
|
-
Submit
|
|
105
|
-
</button>
|
|
106
|
-
<button
|
|
107
|
-
className=" secondary medium bold "
|
|
108
|
-
data-id="buttonComp"
|
|
109
|
-
disabled={false}
|
|
110
|
-
onClick={[Function]}
|
|
111
|
-
type="button"
|
|
112
|
-
>
|
|
113
|
-
Cancel
|
|
114
|
-
</button>
|
|
115
|
-
</div>
|
|
116
|
-
</div>
|
|
117
|
-
`;
|
|
118
|
-
|
|
119
|
-
exports[`Button component should the type is header 1`] = `
|
|
120
|
-
<div
|
|
121
|
-
className="buttonGroup header"
|
|
122
|
-
>
|
|
123
|
-
<div
|
|
124
|
-
className="alignleft"
|
|
125
|
-
>
|
|
126
|
-
<button
|
|
127
|
-
className=" primaryfilled medium bold "
|
|
128
|
-
data-id="buttonComp"
|
|
129
|
-
disabled={false}
|
|
130
|
-
onClick={[Function]}
|
|
131
|
-
type="button"
|
|
132
|
-
>
|
|
133
|
-
Submit
|
|
134
|
-
</button>
|
|
135
|
-
<button
|
|
136
|
-
className=" secondary medium bold "
|
|
137
|
-
data-id="buttonComp"
|
|
138
|
-
disabled={false}
|
|
139
|
-
onClick={[Function]}
|
|
140
|
-
type="button"
|
|
141
|
-
>
|
|
142
|
-
Cancel
|
|
143
|
-
</button>
|
|
144
|
-
</div>
|
|
145
|
-
</div>
|
|
146
|
-
`;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
//https://github.com/facebook/react/issues/4971
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import ReactDOM from 'react-dom';
|
|
4
|
-
import Card, { CardHeader, CardFooter, CardContent } from '../Card';
|
|
5
|
-
let data = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29];
|
|
6
|
-
describe('Button component', () => {
|
|
7
|
-
it('should display text', () => {
|
|
8
|
-
let div = document.createElement('div');
|
|
9
|
-
document.body.appendChild(div);
|
|
10
|
-
let scrollElement;
|
|
11
|
-
ReactDOM.render( /*#__PURE__*/React.createElement("div", {
|
|
12
|
-
style: {
|
|
13
|
-
height: '400px'
|
|
14
|
-
}
|
|
15
|
-
}, /*#__PURE__*/React.createElement(Card, {
|
|
16
|
-
from: 0,
|
|
17
|
-
limit: 10,
|
|
18
|
-
fetchData: () => Promise.resolve()
|
|
19
|
-
}, /*#__PURE__*/React.createElement(CardHeader, null, /*#__PURE__*/React.createElement("div", null, "Header")), /*#__PURE__*/React.createElement(CardContent, {
|
|
20
|
-
eleRef: ref => {
|
|
21
|
-
scrollElement = ref;
|
|
22
|
-
}
|
|
23
|
-
}, data.map(val => /*#__PURE__*/React.createElement("div", {
|
|
24
|
-
key: val,
|
|
25
|
-
style: {
|
|
26
|
-
padding: '10px 0px',
|
|
27
|
-
borderBottom: '1px solid #ddd'
|
|
28
|
-
}
|
|
29
|
-
}, val))), /*#__PURE__*/React.createElement(CardFooter, null, /*#__PURE__*/React.createElement("div", null, "Footer")))), div);
|
|
30
|
-
scrollElement.scrollTop = 310;
|
|
31
|
-
TestUtils.Simulate.scroll(scrollElement, {
|
|
32
|
-
deltaY: 310
|
|
33
|
-
});
|
|
34
|
-
ReactDOM.unmountComponentAtNode(div);
|
|
35
|
-
});
|
|
36
|
-
});
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import CheckBox from '../CheckBox';
|
|
3
|
-
describe('CheckBox component', () => {
|
|
4
|
-
it('should display', () => {
|
|
5
|
-
let renderedDOM = TestUtils.renderIntoDocument( /*#__PURE__*/React.createElement(CheckBox, {
|
|
6
|
-
id: "c1",
|
|
7
|
-
name: "vimalesan",
|
|
8
|
-
text: "primary"
|
|
9
|
-
}));
|
|
10
|
-
expect(TestUtils.findRenderedComponentsWithTestid(renderedDOM, 'label').textContent.contains('primary')).toBe(true);
|
|
11
|
-
});
|
|
12
|
-
});
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-undef */
|
|
2
|
-
|
|
3
|
-
/*eslint-disable no-unused-vars*/
|
|
4
|
-
import CalendarView, { Span } from '../CalendarView';
|
|
5
|
-
import React from 'react';
|
|
6
|
-
const defaultProps = {
|
|
7
|
-
onSelect: jest.fn(),
|
|
8
|
-
handleSelect: jest.fn(),
|
|
9
|
-
incremday: 27,
|
|
10
|
-
userSeeYear: 2018,
|
|
11
|
-
userSeeMonth: 12,
|
|
12
|
-
i: 1
|
|
13
|
-
};
|
|
14
|
-
describe('CalendarView testing', () => {
|
|
15
|
-
it('Should set date onSelecting date', () => {
|
|
16
|
-
const {
|
|
17
|
-
props,
|
|
18
|
-
renderedDOM
|
|
19
|
-
} = setup(Span, defaultProps);
|
|
20
|
-
let component = TestUtils.findRenderedComponentsWithTestid(renderedDOM, 'calendar-view');
|
|
21
|
-
TestUtils.Simulate.click(component);
|
|
22
|
-
expect(props.handleSelect).toHaveBeenCalled();
|
|
23
|
-
});
|
|
24
|
-
it('Should call handleSelect with specified arguments', () => {
|
|
25
|
-
const {
|
|
26
|
-
props,
|
|
27
|
-
renderedDOM
|
|
28
|
-
} = setup(Span, defaultProps);
|
|
29
|
-
let component = TestUtils.findRenderedComponentsWithTestid(renderedDOM, 'calendar-view');
|
|
30
|
-
TestUtils.Simulate.click(component);
|
|
31
|
-
expect(props.handleSelect).toHaveBeenLastCalledWith(props.incremday, props.userSeeMonth, props.userSeeYear);
|
|
32
|
-
});
|
|
33
|
-
});
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-undef */
|
|
2
|
-
|
|
3
|
-
/*eslint-disable no-unused-vars*/
|
|
4
|
-
import DateTime, { Span } from '../DateTime';
|
|
5
|
-
import React from 'react';
|
|
6
|
-
const defaultProps = {
|
|
7
|
-
value: '2018-12-27T12:02:07.000Z',
|
|
8
|
-
isDateTimeField: false,
|
|
9
|
-
onSelect: jest.fn(),
|
|
10
|
-
timeZone: '',
|
|
11
|
-
min: '',
|
|
12
|
-
max: '',
|
|
13
|
-
maxErrorText: '',
|
|
14
|
-
minErrorText: '',
|
|
15
|
-
position: 'bottomLeft',
|
|
16
|
-
isActive: true,
|
|
17
|
-
onError: jest.fn(),
|
|
18
|
-
isReady: true
|
|
19
|
-
};
|
|
20
|
-
describe('DateTime testing', () => {
|
|
21
|
-
it('Should call handleSelect onSetting date', () => {
|
|
22
|
-
const {
|
|
23
|
-
props,
|
|
24
|
-
renderedDOM
|
|
25
|
-
} = setup(DateTime, defaultProps);
|
|
26
|
-
let component = TestUtils.scryRenderedComponentsWithTestid(renderedDOM, 'dateTime_saveBtn')[0];
|
|
27
|
-
TestUtils.Simulate.click(component);
|
|
28
|
-
expect(props.onSelect).toHaveBeenCalled();
|
|
29
|
-
});
|
|
30
|
-
it('Should call handleSelect onClearing date', () => {
|
|
31
|
-
const {
|
|
32
|
-
props,
|
|
33
|
-
renderedDOM
|
|
34
|
-
} = setup(DateTime, defaultProps);
|
|
35
|
-
let component = TestUtils.scryRenderedComponentsWithTestid(renderedDOM, 'dateTime_clearBtn')[0];
|
|
36
|
-
TestUtils.Simulate.click(component);
|
|
37
|
-
expect(props.onSelect).toHaveBeenCalled();
|
|
38
|
-
});
|
|
39
|
-
it('Should display Time field if isDateTimeField is true', () => {
|
|
40
|
-
const {
|
|
41
|
-
props,
|
|
42
|
-
renderedDOM
|
|
43
|
-
} = setup(DateTime, Object.assign({}, defaultProps, {
|
|
44
|
-
isDateTimeField: true
|
|
45
|
-
}));
|
|
46
|
-
let selectComponents = TestUtils.scryRenderedComponentsWithTestid(renderedDOM, 'dateTime_timeContainer');
|
|
47
|
-
expect(selectComponents.length).toBe(1);
|
|
48
|
-
});
|
|
49
|
-
it('Should not display Time field if isDateTimeField is false', () => {
|
|
50
|
-
const {
|
|
51
|
-
props,
|
|
52
|
-
renderedDOM
|
|
53
|
-
} = setup(DateTime, Object.assign({}, defaultProps, {
|
|
54
|
-
isDateTimeField: false
|
|
55
|
-
}));
|
|
56
|
-
let selectComponents = TestUtils.scryRenderedComponentsWithTestid(renderedDOM, 'dateTime_timeContainer');
|
|
57
|
-
expect(selectComponents.length).toBe(0);
|
|
58
|
-
});
|
|
59
|
-
it('Should navigate to prevYear onClicking prevYear(<<)', () => {
|
|
60
|
-
const {
|
|
61
|
-
props,
|
|
62
|
-
renderedDOM
|
|
63
|
-
} = setup(Span, Object.assign({}, defaultProps, {
|
|
64
|
-
dataId: 'prevYear',
|
|
65
|
-
type: 'll',
|
|
66
|
-
modifyCalendar: jest.fn()
|
|
67
|
-
}));
|
|
68
|
-
let prevYearComponents = TestUtils.findRenderedComponentsWithTestid(renderedDOM, 'prevYear');
|
|
69
|
-
TestUtils.Simulate.click(prevYearComponents);
|
|
70
|
-
expect(props.modifyCalendar).toHaveBeenCalled();
|
|
71
|
-
expect(props.modifyCalendar).toHaveBeenLastCalledWith(props.type);
|
|
72
|
-
});
|
|
73
|
-
it('Should navigate to prevMonth onClicking prevMonth(<)', () => {
|
|
74
|
-
const {
|
|
75
|
-
props,
|
|
76
|
-
renderedDOM
|
|
77
|
-
} = setup(Span, Object.assign({}, defaultProps, {
|
|
78
|
-
dataId: 'prevMonth',
|
|
79
|
-
type: 'l',
|
|
80
|
-
modifyCalendar: jest.fn()
|
|
81
|
-
}));
|
|
82
|
-
let prevMonthComponents = TestUtils.findRenderedComponentsWithTestid(renderedDOM, 'prevMonth');
|
|
83
|
-
TestUtils.Simulate.click(prevMonthComponents);
|
|
84
|
-
expect(props.modifyCalendar).toHaveBeenCalled();
|
|
85
|
-
expect(props.modifyCalendar).toHaveBeenLastCalledWith(props.type);
|
|
86
|
-
});
|
|
87
|
-
it('Should navigate to nextMonth onClicking nextMonth(>)', () => {
|
|
88
|
-
const {
|
|
89
|
-
props,
|
|
90
|
-
renderedDOM
|
|
91
|
-
} = setup(Span, Object.assign({}, defaultProps, {
|
|
92
|
-
dataId: 'nextMonth',
|
|
93
|
-
type: 'g',
|
|
94
|
-
modifyCalendar: jest.fn()
|
|
95
|
-
}));
|
|
96
|
-
let nextMonthComponents = TestUtils.findRenderedComponentsWithTestid(renderedDOM, 'nextMonth');
|
|
97
|
-
TestUtils.Simulate.click(nextMonthComponents);
|
|
98
|
-
expect(props.modifyCalendar).toHaveBeenCalled();
|
|
99
|
-
expect(props.modifyCalendar).toHaveBeenLastCalledWith(props.type);
|
|
100
|
-
});
|
|
101
|
-
it('Should navigate to nextYear onClicking nextYear(>>)', () => {
|
|
102
|
-
const {
|
|
103
|
-
props,
|
|
104
|
-
renderedDOM
|
|
105
|
-
} = setup(Span, Object.assign({}, defaultProps, {
|
|
106
|
-
dataId: 'nextyear',
|
|
107
|
-
type: 'gg',
|
|
108
|
-
modifyCalendar: jest.fn()
|
|
109
|
-
}));
|
|
110
|
-
let nextyearComponents = TestUtils.findRenderedComponentsWithTestid(renderedDOM, 'nextyear');
|
|
111
|
-
TestUtils.Simulate.click(nextyearComponents);
|
|
112
|
-
expect(props.modifyCalendar).toHaveBeenCalled();
|
|
113
|
-
expect(props.modifyCalendar).toHaveBeenLastCalledWith(props.type);
|
|
114
|
-
});
|
|
115
|
-
});
|