@zohodesk/dot 1.0.0-temp-210.1 → 1.0.0-temp-211

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.
Files changed (55) hide show
  1. package/.cli/propValidation_report.html +1 -1
  2. package/README.md +5 -0
  3. package/es/ActionButton/__tests__/ActionButton.spec.js +353 -2
  4. package/es/ActionButton/__tests__/__snapshots__/ActionButton.spec.js.snap +2633 -1
  5. package/es/Drawer/Drawer.js +2 -10
  6. package/es/Drawer/__tests__/Content.spec.js +24 -0
  7. package/es/Drawer/__tests__/Drawer.spec.js +130 -4
  8. package/es/Drawer/__tests__/Footer.spec.js +34 -0
  9. package/es/Drawer/__tests__/Header.spec.js +173 -0
  10. package/es/Drawer/__tests__/__snapshots__/Content.spec.js.snap +127 -0
  11. package/es/Drawer/__tests__/__snapshots__/Drawer.spec.js.snap +535 -2
  12. package/es/Drawer/__tests__/__snapshots__/Footer.spec.js.snap +1233 -0
  13. package/es/Drawer/__tests__/__snapshots__/Header.spec.js.snap +782 -0
  14. package/es/Drawer/props/defaultProps.js +1 -5
  15. package/es/Drawer/props/propTypes.js +1 -5
  16. package/es/FlipCard/__tests__/FlipCard.spec.js +606 -2
  17. package/es/FlipCard/__tests__/__snapshots__/FlipCard.spec.js.snap +6626 -1
  18. package/es/FreezeLayer/FreezeLayer.js +3 -11
  19. package/es/FreezeLayer/props/defaultProps.js +1 -5
  20. package/es/FreezeLayer/props/propTypes.js +1 -5
  21. package/es/Link/__tests__/Link.spec.js +123 -3
  22. package/es/Link/__tests__/__snapshots__/Link.spec.js.snap +142 -2
  23. package/es/dropdown/ToggleDropDown/ToggleDropDown.js +8 -2
  24. package/es/list/ListStencils/ListStencils.js +7 -2
  25. package/es/list/ListStencils/__tests__/ListStencils.spec.js +9 -0
  26. package/es/list/ListStencils/__tests__/__snapshots__/ListStencils.spec.js.snap +46 -0
  27. package/es/list/ListStencils/props/propTypes.js +3 -1
  28. package/lib/ActionButton/__tests__/ActionButton.spec.js +354 -1
  29. package/lib/ActionButton/__tests__/__snapshots__/ActionButton.spec.js.snap +2633 -1
  30. package/lib/Drawer/Drawer.js +2 -10
  31. package/lib/Drawer/__tests__/Content.spec.js +35 -0
  32. package/lib/Drawer/__tests__/Drawer.spec.js +132 -5
  33. package/lib/Drawer/__tests__/Footer.spec.js +41 -0
  34. package/lib/Drawer/__tests__/Header.spec.js +192 -0
  35. package/lib/Drawer/__tests__/__snapshots__/Content.spec.js.snap +127 -0
  36. package/lib/Drawer/__tests__/__snapshots__/Drawer.spec.js.snap +535 -2
  37. package/lib/Drawer/__tests__/__snapshots__/Footer.spec.js.snap +1233 -0
  38. package/lib/Drawer/__tests__/__snapshots__/Header.spec.js.snap +782 -0
  39. package/lib/Drawer/props/defaultProps.js +1 -5
  40. package/lib/Drawer/props/propTypes.js +1 -5
  41. package/lib/FlipCard/__tests__/FlipCard.spec.js +613 -1
  42. package/lib/FlipCard/__tests__/__snapshots__/FlipCard.spec.js.snap +6626 -1
  43. package/lib/FreezeLayer/FreezeLayer.js +3 -11
  44. package/lib/FreezeLayer/props/defaultProps.js +1 -5
  45. package/lib/FreezeLayer/props/propTypes.js +1 -5
  46. package/lib/Link/__tests__/Link.spec.js +130 -4
  47. package/lib/Link/__tests__/__snapshots__/Link.spec.js.snap +142 -2
  48. package/lib/dropdown/ToggleDropDown/ToggleDropDown.js +12 -6
  49. package/lib/list/ListStencils/ListStencils.js +8 -2
  50. package/lib/list/ListStencils/__tests__/ListStencils.spec.js +9 -0
  51. package/lib/list/ListStencils/__tests__/__snapshots__/ListStencils.spec.js.snap +46 -0
  52. package/lib/list/ListStencils/props/propTypes.js +3 -1
  53. package/package.json +6 -6
  54. package/result.json +1 -0
  55. package/unittest/index.html +45 -0
package/README.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  In this Library, we Provide Some Basic Components to Build Your Application
4
4
 
5
+ # 1.7.11
6
+
7
+ - **ListStencils**
8
+ - `customId, testId` prop has beed added
9
+
5
10
  # 1.7.10
6
11
 
7
12
  - **Onboarding**
@@ -1,11 +1,362 @@
1
1
  import React from 'react';
2
- import { render } from '@testing-library/react';
2
+ import { render, fireEvent } from '@testing-library/react';
3
+ import '@testing-library/jest-dom';
3
4
  import ActionButton from "../ActionButton";
4
5
  describe('ActionButton', () => {
5
- test('rendering the defult props', () => {
6
+ const palettes = ['primaryFilled', 'primary'];
7
+ const sizes = ['small', 'medium', 'large'];
8
+ const iconProps = [{
9
+ iconName: 'ZD-replyall',
10
+ iconSize: '9'
11
+ }];
12
+ test('renders with default props', () => {
6
13
  const {
7
14
  asFragment
8
15
  } = render( /*#__PURE__*/React.createElement(ActionButton, null));
9
16
  expect(asFragment()).toMatchSnapshot();
10
17
  });
18
+ test('renders with isLoading set to true', () => {
19
+ const {
20
+ asFragment
21
+ } = render( /*#__PURE__*/React.createElement(ActionButton, {
22
+ isLoading: true,
23
+ text: "Loading..."
24
+ }));
25
+ expect(asFragment()).toMatchSnapshot();
26
+ });
27
+ test('renders with text', () => {
28
+ const {
29
+ asFragment
30
+ } = render( /*#__PURE__*/React.createElement(ActionButton, {
31
+ text: "Not Loading - Main Text"
32
+ }));
33
+ expect(asFragment()).toMatchSnapshot();
34
+ });
35
+ test('renders with subText', () => {
36
+ const {
37
+ asFragment
38
+ } = render( /*#__PURE__*/React.createElement(ActionButton, {
39
+ isLoading: false,
40
+ subText: "Not Loading - Sub Text"
41
+ }));
42
+ expect(asFragment()).toMatchSnapshot();
43
+ });
44
+ test.each(iconProps)('renders with iconName: %s and iconSize: %s', _ref => {
45
+ let {
46
+ iconName,
47
+ iconSize
48
+ } = _ref;
49
+ const {
50
+ asFragment
51
+ } = render( /*#__PURE__*/React.createElement(ActionButton, {
52
+ isLoading: false,
53
+ iconName: iconName,
54
+ iconSize: iconSize,
55
+ text: "Not Loading - Main Text",
56
+ subText: "Not Loading - Sub Text"
57
+ }));
58
+ expect(asFragment()).toMatchSnapshot();
59
+ });
60
+ test('renders with onClick prop and validates class', () => {
61
+ const mockOnClick = jest.fn();
62
+ const {
63
+ asFragment
64
+ } = render( /*#__PURE__*/React.createElement(ActionButton, {
65
+ isLoading: false,
66
+ iconName: "ZD-replyall",
67
+ iconSize: "9",
68
+ text: "Not Loading - Main Text onClick",
69
+ subText: "Not Loading - Sub Text onClick",
70
+ onClick: mockOnClick
71
+ }));
72
+ expect(asFragment()).toMatchSnapshot();
73
+ });
74
+ test.each(sizes)('renders with size - %s', size => {
75
+ const {
76
+ asFragment
77
+ } = render( /*#__PURE__*/React.createElement(ActionButton, {
78
+ size: size
79
+ }));
80
+ expect(asFragment()).toMatchSnapshot();
81
+ });
82
+ test('renders with dataId prop', () => {
83
+ const {
84
+ asFragment
85
+ } = render( /*#__PURE__*/React.createElement(ActionButton, {
86
+ dataId: "testDataId"
87
+ }));
88
+ expect(asFragment()).toMatchSnapshot();
89
+ });
90
+ test('renders dataId prop with isLoading set to true', () => {
91
+ const {
92
+ asFragment
93
+ } = render( /*#__PURE__*/React.createElement(ActionButton, {
94
+ isLoading: true,
95
+ dataId: "testDataId"
96
+ }));
97
+ expect(asFragment()).toMatchSnapshot();
98
+ });
99
+ test('renders with disabled state true', () => {
100
+ const {
101
+ asFragment
102
+ } = render( /*#__PURE__*/React.createElement(ActionButton, {
103
+ isDisabled: true
104
+ }));
105
+ expect(asFragment()).toMatchSnapshot();
106
+ });
107
+ test('renders with dropBoxClassProps - case 1', () => {
108
+ const {
109
+ asFragment
110
+ } = render( /*#__PURE__*/React.createElement(ActionButton, {
111
+ isPopupOpen: true,
112
+ dropBoxClass: "custom-dropbox-class",
113
+ isBoxPaddingNeed: true
114
+ }, /*#__PURE__*/React.createElement("div", null, "Child Content")));
115
+ expect(asFragment()).toMatchSnapshot();
116
+ });
117
+ test('renders with dropBoxClassProps - case 2', () => {
118
+ const {
119
+ asFragment
120
+ } = render( /*#__PURE__*/React.createElement(ActionButton, {
121
+ isPopupOpen: false,
122
+ dropBoxClass: "",
123
+ isBoxPaddingNeed: false
124
+ }, /*#__PURE__*/React.createElement("div", null, "Child Content")));
125
+ expect(asFragment()).toMatchSnapshot();
126
+ });
127
+ test('renders with dropBoxClassProps - case 3', () => {
128
+ const {
129
+ asFragment
130
+ } = render( /*#__PURE__*/React.createElement(ActionButton, {
131
+ isPopupOpen: true,
132
+ dropBoxClass: "custom-dropbox-class",
133
+ isBoxPaddingNeed: false
134
+ }, /*#__PURE__*/React.createElement("div", null, "Child Content")));
135
+ expect(asFragment()).toMatchSnapshot();
136
+ });
137
+ test('renders with dropBoxClassProps - case 4', () => {
138
+ const {
139
+ asFragment
140
+ } = render( /*#__PURE__*/React.createElement(ActionButton, {
141
+ isPopupOpen: true,
142
+ dropBoxClass: "",
143
+ isBoxPaddingNeed: true
144
+ }, /*#__PURE__*/React.createElement("div", null, "Child Content")));
145
+ expect(asFragment()).toMatchSnapshot();
146
+ });
147
+ test('renders with dataSelectorId and children props', () => {
148
+ const {
149
+ asFragment
150
+ } = render( /*#__PURE__*/React.createElement(ActionButton, {
151
+ dataSelectorId: "testSelectorId"
152
+ }, /*#__PURE__*/React.createElement("div", null, "Child Content")));
153
+ expect(asFragment()).toMatchSnapshot();
154
+ });
155
+ test('renders with custom className', () => {
156
+ const {
157
+ asFragment
158
+ } = render( /*#__PURE__*/React.createElement(ActionButton, {
159
+ className: "custom-class"
160
+ }));
161
+ expect(asFragment()).toMatchSnapshot();
162
+ });
163
+ test('renders with dataTitle', () => {
164
+ const {
165
+ asFragment
166
+ } = render( /*#__PURE__*/React.createElement(ActionButton, {
167
+ dataTitle: "Test Data Title"
168
+ }));
169
+ expect(asFragment()).toMatchSnapshot();
170
+ });
171
+ test('renders with innerClassName set to custom-class', () => {
172
+ const {
173
+ asFragment
174
+ } = render( /*#__PURE__*/React.createElement(ActionButton, {
175
+ innerClassName: "custom-class"
176
+ }));
177
+ expect(asFragment()).toMatchSnapshot();
178
+ });
179
+ test('renders with innerClassName set to empty string', () => {
180
+ const {
181
+ asFragment
182
+ } = render( /*#__PURE__*/React.createElement(ActionButton, {
183
+ innerClassName: ""
184
+ }));
185
+ expect(asFragment()).toMatchSnapshot();
186
+ });
187
+ test('renders with innerClassName set to undefined', () => {
188
+ const {
189
+ asFragment
190
+ } = render( /*#__PURE__*/React.createElement(ActionButton, {
191
+ innerClassName: undefined
192
+ }));
193
+ expect(asFragment()).toMatchSnapshot();
194
+ });
195
+ test('renders with arrowBoxSize small and isPopupOpen true', () => {
196
+ const {
197
+ asFragment
198
+ } = render( /*#__PURE__*/React.createElement(ActionButton, {
199
+ arrowBoxSize: "small",
200
+ isPopupOpen: true
201
+ }));
202
+ expect(asFragment()).toMatchSnapshot();
203
+ });
204
+ test('renders with arrowBoxSize medium and isPopupOpen false', () => {
205
+ const {
206
+ asFragment
207
+ } = render( /*#__PURE__*/React.createElement(ActionButton, {
208
+ arrowBoxSize: "medium",
209
+ isPopupOpen: false
210
+ }));
211
+ expect(asFragment()).toMatchSnapshot();
212
+ });
213
+ test.each(palettes)('renders with palette - %s', palette => {
214
+ const {
215
+ asFragment
216
+ } = render( /*#__PURE__*/React.createElement(ActionButton, {
217
+ palette: palette
218
+ }));
219
+ expect(asFragment()).toMatchSnapshot();
220
+ });
221
+ test('renders with children prop', () => {
222
+ const {
223
+ asFragment
224
+ } = render( /*#__PURE__*/React.createElement(ActionButton, null, /*#__PURE__*/React.createElement("div", null, "Child Content")));
225
+ expect(asFragment()).toMatchSnapshot();
226
+ });
227
+ test('renders with dataId, children, and popup open', () => {
228
+ const {
229
+ asFragment
230
+ } = render( /*#__PURE__*/React.createElement(ActionButton, {
231
+ dataId: "testDataId",
232
+ isPopupOpen: true
233
+ }, /*#__PURE__*/React.createElement("div", null, "Child Content")));
234
+ expect(asFragment()).toMatchSnapshot();
235
+ });
236
+ test('renders with isArrow true and popup open', () => {
237
+ const {
238
+ asFragment
239
+ } = render( /*#__PURE__*/React.createElement(ActionButton, {
240
+ isArrow: true,
241
+ isPopupOpen: true
242
+ }, /*#__PURE__*/React.createElement("div", null, "Child Content")));
243
+ expect(asFragment()).toMatchSnapshot();
244
+ });
245
+ test('renders with isArrow false and popup open', () => {
246
+ const {
247
+ asFragment
248
+ } = render( /*#__PURE__*/React.createElement(ActionButton, {
249
+ isArrow: false,
250
+ isPopupOpen: true
251
+ }, /*#__PURE__*/React.createElement("div", null, "Child Content")));
252
+ expect(asFragment()).toMatchSnapshot();
253
+ });
254
+ test('renders with children and tooltip enabled', () => {
255
+ const {
256
+ asFragment
257
+ } = render( /*#__PURE__*/React.createElement(ActionButton, {
258
+ removeChildrenTooltip: true
259
+ }, /*#__PURE__*/React.createElement("div", null, "Child Content")));
260
+ expect(asFragment()).toMatchSnapshot();
261
+ });
262
+ test('renders with children and tooltip disabled', () => {
263
+ const {
264
+ asFragment
265
+ } = render( /*#__PURE__*/React.createElement(ActionButton, {
266
+ removeChildrenTooltip: null
267
+ }, /*#__PURE__*/React.createElement("div", null, "Child Content")));
268
+ expect(asFragment()).toMatchSnapshot();
269
+ });
270
+ test('renders with arrowBoxSize small and children', () => {
271
+ const {
272
+ asFragment
273
+ } = render( /*#__PURE__*/React.createElement(ActionButton, {
274
+ arrowBoxSize: "small"
275
+ }, /*#__PURE__*/React.createElement("div", null, "Child Content")));
276
+ expect(asFragment()).toMatchSnapshot();
277
+ });
278
+ test('renders with arrowBoxSize medium and children', () => {
279
+ const {
280
+ asFragment
281
+ } = render( /*#__PURE__*/React.createElement(ActionButton, {
282
+ arrowBoxSize: "medium"
283
+ }, /*#__PURE__*/React.createElement("div", null, "Child Content")));
284
+ expect(asFragment()).toMatchSnapshot();
285
+ });
286
+ test.each(palettes)('renders with palette - %s and loading', palette => {
287
+ const {
288
+ asFragment
289
+ } = render( /*#__PURE__*/React.createElement(ActionButton, {
290
+ palette: palette,
291
+ isLoading: true
292
+ }, /*#__PURE__*/React.createElement("div", null, "Child Content")));
293
+ expect(asFragment()).toMatchSnapshot();
294
+ });
295
+ test.each(palettes)('renders with palette - %s and children', palette => {
296
+ const {
297
+ asFragment
298
+ } = render( /*#__PURE__*/React.createElement(ActionButton, {
299
+ palette: palette
300
+ }, /*#__PURE__*/React.createElement("div", null, "Child Content")));
301
+ expect(asFragment()).toMatchSnapshot();
302
+ });
303
+ test('renders with isPopupOpen true and children', () => {
304
+ const {
305
+ asFragment
306
+ } = render( /*#__PURE__*/React.createElement(ActionButton, {
307
+ isPopupOpen: true
308
+ }, /*#__PURE__*/React.createElement("div", null, "Child Content")));
309
+ expect(asFragment()).toMatchSnapshot();
310
+ });
311
+ test('renders with isPopupOpen false and children', () => {
312
+ const {
313
+ asFragment
314
+ } = render( /*#__PURE__*/React.createElement(ActionButton, {
315
+ isPopupOpen: false
316
+ }, /*#__PURE__*/React.createElement("div", null, "Child Content")));
317
+ expect(asFragment()).toMatchSnapshot();
318
+ });
319
+ test('renders with removeClose set to a function', () => {
320
+ const mockRemoveClose = jest.fn();
321
+ const {
322
+ asFragment
323
+ } = render( /*#__PURE__*/React.createElement(ActionButton, {
324
+ removeClose: mockRemoveClose
325
+ }));
326
+ expect(asFragment()).toMatchSnapshot();
327
+ });
328
+ test('renders with isAbsolutePositioningNeeded set to true', () => {
329
+ const {
330
+ asFragment
331
+ } = render( /*#__PURE__*/React.createElement(ActionButton, {
332
+ isAbsolutePositioningNeeded: true
333
+ }));
334
+ expect(asFragment()).toMatchSnapshot();
335
+ });
336
+ test('renders with isRestrictScroll set to true', () => {
337
+ const {
338
+ asFragment
339
+ } = render( /*#__PURE__*/React.createElement(ActionButton, {
340
+ isRestrictScroll: true
341
+ }));
342
+ expect(asFragment()).toMatchSnapshot();
343
+ });
344
+ test('renders with isAbsolutePositioningNeeded set to true and isPopupOpen true', () => {
345
+ const {
346
+ asFragment
347
+ } = render( /*#__PURE__*/React.createElement(ActionButton, {
348
+ isAbsolutePositioningNeeded: true,
349
+ isPopupOpen: true
350
+ }, /*#__PURE__*/React.createElement("div", null, "Child Content")));
351
+ expect(asFragment()).toMatchSnapshot();
352
+ });
353
+ test('renders with isRestrictScroll set to true and isPopupOpen true', () => {
354
+ const {
355
+ asFragment
356
+ } = render( /*#__PURE__*/React.createElement(ActionButton, {
357
+ isRestrictScroll: true,
358
+ isPopupOpen: true
359
+ }, /*#__PURE__*/React.createElement("div", null, "Child Content")));
360
+ expect(asFragment()).toMatchSnapshot();
361
+ });
11
362
  });