@zohodesk/components 1.0.0-temp-260 → 1.0.0-temp-259.4
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 +4 -0
- package/assets/Appearance/dark/mode/Component_v1_DarkMode.module.css +5 -20
- package/assets/Appearance/light/mode/Component_v1_LightMode.module.css +5 -20
- package/assets/Appearance/pureDark/mode/Component_v1_PureDarkMode.module.css +5 -20
- package/es/ColorSelect/__tests__/__snapshots__/ColorMultiSelect.spec.js.snap +3 -3
- package/es/ColorSelect/__tests__/__snapshots__/ColorSingleSelect.spec.js.snap +6 -6
- package/es/DateTime/__tests__/__snapshots__/DateTime.spec.js.snap +6 -6
- package/es/DateTime/__tests__/__snapshots__/DateTimePopupHeader.spec.js.snap +3 -3
- package/es/DateTime/__tests__/__snapshots__/DateWidget.spec.js.snap +1 -1
- package/es/DateTime/__tests__/__snapshots__/Time.spec.js.snap +3 -3
- package/es/MultiSelect/__tests__/__snapshots__/MultiSelect.spec.js.snap +4 -4
- package/es/MultiSelect/__tests__/__snapshots__/MultiSelectHeader.spec.js.snap +1 -1
- package/es/Select/__tests__/__snapshots__/GroupSelect.spec.js.snap +1 -1
- package/es/Select/__tests__/__snapshots__/Select.spec.js.snap +75 -75
- package/es/Select/__tests__/__snapshots__/SelectWithIcon.spec.js.snap +1 -1
- package/es/Tab/__tests__/__snapshots__/TabLayout.spec.js.snap +4 -4
- package/es/Tag/__tests__/__snapshots__/Tag.spec.js.snap +48 -48
- package/es/TextBoxIcon/__tests__/__snapshots__/TextBoxIcon.spec.js.snap +3 -3
- package/es/shared/ArrowIcon/__tests__/__snapshots__/ArrowIcon.spec.js.snap +10 -10
- package/es/v1/Button/Button.js +197 -113
- package/es/v1/Button/README.md +110 -44
- package/es/v1/Button/__tests__/Button.spec.js +139 -48
- package/es/v1/Button/__tests__/__snapshots__/Button.spec.js.snap +1214 -318
- package/es/v1/Button/constants/index.js +29 -23
- package/es/v1/Button/constants/presets.js +160 -0
- package/es/v1/Button/css/Button_v1.module.css +33 -16
- package/es/v1/Button/css/cssJSLogic.js +56 -29
- package/es/v1/Button/props/defaultProps.js +5 -6
- package/es/v1/Button/props/propTypes.js +26 -8
- package/es/v1/helpers/colorHelpers/__tests__/colorHelper.spec.js +357 -0
- package/es/v1/helpers/colorHelpers/background/backgroundColor.module.css +38 -534
- package/es/v1/helpers/colorHelpers/border/borderColor.module.css +28 -412
- package/es/v1/helpers/colorHelpers/colorHelper.js +120 -139
- package/es/v1/helpers/colorHelpers/constants/index.js +45 -4
- package/es/v1/helpers/colorHelpers/index.js +0 -1
- package/es/v1/helpers/colorHelpers/paletteUtilities.README.md +141 -336
- package/es/v1/helpers/colorHelpers/text/textColor.module.css +79 -295
- package/lib/ColorSelect/__tests__/__snapshots__/ColorMultiSelect.spec.js.snap +3 -3
- package/lib/ColorSelect/__tests__/__snapshots__/ColorSingleSelect.spec.js.snap +6 -6
- package/lib/DateTime/__tests__/__snapshots__/DateTime.spec.js.snap +6 -6
- package/lib/DateTime/__tests__/__snapshots__/DateTimePopupHeader.spec.js.snap +3 -3
- package/lib/DateTime/__tests__/__snapshots__/DateWidget.spec.js.snap +1 -1
- package/lib/DateTime/__tests__/__snapshots__/Time.spec.js.snap +3 -3
- package/lib/MultiSelect/__tests__/__snapshots__/MultiSelect.spec.js.snap +4 -4
- package/lib/MultiSelect/__tests__/__snapshots__/MultiSelectHeader.spec.js.snap +1 -1
- package/lib/Select/__tests__/__snapshots__/GroupSelect.spec.js.snap +1 -1
- package/lib/Select/__tests__/__snapshots__/Select.spec.js.snap +75 -75
- package/lib/Select/__tests__/__snapshots__/SelectWithIcon.spec.js.snap +1 -1
- package/lib/Tab/__tests__/__snapshots__/TabLayout.spec.js.snap +4 -4
- package/lib/Tag/__tests__/__snapshots__/Tag.spec.js.snap +48 -48
- package/lib/TextBoxIcon/__tests__/__snapshots__/TextBoxIcon.spec.js.snap +3 -3
- package/lib/shared/ArrowIcon/__tests__/__snapshots__/ArrowIcon.spec.js.snap +10 -10
- package/lib/v1/Button/Button.js +207 -123
- package/lib/v1/Button/README.md +110 -44
- package/lib/v1/Button/__tests__/Button.spec.js +195 -88
- package/lib/v1/Button/__tests__/__snapshots__/Button.spec.js.snap +1214 -318
- package/lib/v1/Button/constants/index.js +34 -31
- package/lib/v1/Button/constants/presets.js +179 -0
- package/lib/v1/Button/css/Button_v1.module.css +33 -16
- package/lib/v1/Button/css/cssJSLogic.js +45 -25
- package/lib/v1/Button/props/defaultProps.js +4 -5
- package/lib/v1/Button/props/propTypes.js +41 -7
- package/lib/v1/helpers/colorHelpers/__tests__/colorHelper.spec.js +363 -0
- package/lib/v1/helpers/colorHelpers/background/backgroundColor.module.css +38 -534
- package/lib/v1/helpers/colorHelpers/border/borderColor.module.css +28 -412
- package/lib/v1/helpers/colorHelpers/colorHelper.js +130 -153
- package/lib/v1/helpers/colorHelpers/constants/index.js +45 -4
- package/lib/v1/helpers/colorHelpers/index.js +2 -24
- package/lib/v1/helpers/colorHelpers/paletteUtilities.README.md +141 -336
- package/lib/v1/helpers/colorHelpers/text/textColor.module.css +79 -295
- package/package.json +9 -9
- package/es/AdvancedPopup/AdvancedPopup.js +0 -105
- package/lib/AdvancedPopup/AdvancedPopup.js +0 -122
|
@@ -1,12 +1,16 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
|
|
1
3
|
import React from 'react';
|
|
2
|
-
import { cleanup, render
|
|
4
|
+
import { cleanup, render } from '@testing-library/react';
|
|
3
5
|
import userEvent from '@testing-library/user-event';
|
|
4
|
-
import Button from "../
|
|
6
|
+
import Button from "../index";
|
|
5
7
|
import '@testing-library/jest-dom';
|
|
8
|
+
import { PALETTE, VARIANT, SIZE, STATUS, LOADER_PLACEMENT, SHAPE, DISABLED_APPEARANCE, BUTTON_TYPE } from "../constants";
|
|
9
|
+
import { BRAND_GHOST, BRAND_TEXT_ONLY, BRAND_TINTED_OUTLINE, SUCCESS_GHOST, SUCCESS_TEXT_ONLY, SUCCESS_TINTED_OUTLINE, SECONDARY_GHOST_BRAND_TINTED_ONSELECT, SECONDARY_GHOST_CANCEL, BLACK_TEXT_BRAND_ONHOVER, BRAND_BG_ONSELECT, BRAND_TEXT_TINTED_HOVER, BRAND_TEXT_TINTED_DANGER_HOVER } from "../constants/presets";
|
|
6
10
|
afterEach(() => {
|
|
7
11
|
cleanup();
|
|
8
12
|
});
|
|
9
|
-
describe('Button
|
|
13
|
+
describe('Button', () => {
|
|
10
14
|
test('Should render with the basic set of default props', () => {
|
|
11
15
|
const {
|
|
12
16
|
asFragment
|
|
@@ -19,8 +23,7 @@ describe('Button - Component', () => {
|
|
|
19
23
|
} = render( /*#__PURE__*/React.createElement(Button, null, "Click Me"));
|
|
20
24
|
expect(asFragment()).toMatchSnapshot();
|
|
21
25
|
});
|
|
22
|
-
|
|
23
|
-
test.each(palette)('Should render palette of buttons - %s', palette => {
|
|
26
|
+
test.each(Object.values(PALETTE))('Should render palette of buttons - %s', palette => {
|
|
24
27
|
const {
|
|
25
28
|
asFragment
|
|
26
29
|
} = render( /*#__PURE__*/React.createElement(Button, {
|
|
@@ -28,26 +31,46 @@ describe('Button - Component', () => {
|
|
|
28
31
|
}));
|
|
29
32
|
expect(asFragment()).toMatchSnapshot();
|
|
30
33
|
});
|
|
31
|
-
const
|
|
32
|
-
|
|
34
|
+
const appearanceCombos = [{
|
|
35
|
+
bg: true,
|
|
36
|
+
text: 'black'
|
|
37
|
+
}, {
|
|
38
|
+
border: true
|
|
39
|
+
}, {
|
|
40
|
+
text: true
|
|
41
|
+
}, {
|
|
42
|
+
bg: false,
|
|
43
|
+
border: true
|
|
44
|
+
}, {}];
|
|
45
|
+
test.each(appearanceCombos.map(combo => [combo]))('Should render appearance of buttons - %o', appearance => {
|
|
33
46
|
const {
|
|
34
47
|
asFragment
|
|
35
48
|
} = render( /*#__PURE__*/React.createElement(Button, {
|
|
36
|
-
|
|
49
|
+
palette: PALETTE.BRAND,
|
|
50
|
+
appearance: appearance
|
|
37
51
|
}));
|
|
38
52
|
expect(asFragment()).toMatchSnapshot();
|
|
39
53
|
});
|
|
40
|
-
|
|
41
|
-
test.each(borderAppearance)('Should render borderAppearance of buttons - %s', border => {
|
|
54
|
+
test.each(appearanceCombos.map(combo => [combo]))('Should render hoverAppearance of buttons - %o', appearance => {
|
|
42
55
|
const {
|
|
43
56
|
asFragment
|
|
44
57
|
} = render( /*#__PURE__*/React.createElement(Button, {
|
|
45
|
-
|
|
58
|
+
palette: PALETTE.BRAND,
|
|
59
|
+
hoverAppearance: appearance
|
|
46
60
|
}));
|
|
47
61
|
expect(asFragment()).toMatchSnapshot();
|
|
48
62
|
});
|
|
49
|
-
|
|
50
|
-
|
|
63
|
+
test.each(appearanceCombos.map(combo => [combo]))('Should render selectedAppearance of buttons - %o', appearance => {
|
|
64
|
+
const {
|
|
65
|
+
asFragment
|
|
66
|
+
} = render( /*#__PURE__*/React.createElement(Button, {
|
|
67
|
+
palette: PALETTE.BRAND,
|
|
68
|
+
isSelected: true,
|
|
69
|
+
selectedAppearance: appearance
|
|
70
|
+
}));
|
|
71
|
+
expect(asFragment()).toMatchSnapshot();
|
|
72
|
+
});
|
|
73
|
+
test.each(Object.values(VARIANT))('Should render variant of buttons - %s', variant => {
|
|
51
74
|
const {
|
|
52
75
|
asFragment
|
|
53
76
|
} = render( /*#__PURE__*/React.createElement(Button, {
|
|
@@ -55,8 +78,7 @@ describe('Button - Component', () => {
|
|
|
55
78
|
}));
|
|
56
79
|
expect(asFragment()).toMatchSnapshot();
|
|
57
80
|
});
|
|
58
|
-
|
|
59
|
-
test.each(size)('Should render Sizes of buttons - %s', size => {
|
|
81
|
+
test.each(Object.values(SIZE))('Should render Sizes of buttons - %s', size => {
|
|
60
82
|
const {
|
|
61
83
|
asFragment
|
|
62
84
|
} = render( /*#__PURE__*/React.createElement(Button, {
|
|
@@ -64,8 +86,7 @@ describe('Button - Component', () => {
|
|
|
64
86
|
}));
|
|
65
87
|
expect(asFragment()).toMatchSnapshot();
|
|
66
88
|
});
|
|
67
|
-
|
|
68
|
-
test.each(status)('Should render Status of buttons - %s', status => {
|
|
89
|
+
test.each(Object.values(STATUS))('Should render Status of buttons - %s', status => {
|
|
69
90
|
const {
|
|
70
91
|
asFragment
|
|
71
92
|
} = render( /*#__PURE__*/React.createElement(Button, {
|
|
@@ -73,8 +94,7 @@ describe('Button - Component', () => {
|
|
|
73
94
|
}));
|
|
74
95
|
expect(asFragment()).toMatchSnapshot();
|
|
75
96
|
});
|
|
76
|
-
|
|
77
|
-
test.each(loaderPlacement)('Should render loaderPlacement of buttons - %s', loaderPlacement => {
|
|
97
|
+
test.each(Object.values(LOADER_PLACEMENT))('Should render loaderPlacement of buttons - %s', loaderPlacement => {
|
|
78
98
|
const {
|
|
79
99
|
asFragment
|
|
80
100
|
} = render( /*#__PURE__*/React.createElement(Button, {
|
|
@@ -83,7 +103,7 @@ describe('Button - Component', () => {
|
|
|
83
103
|
}));
|
|
84
104
|
expect(asFragment()).toMatchSnapshot();
|
|
85
105
|
});
|
|
86
|
-
test('Should render with iconName and iconSize
|
|
106
|
+
test('Should render with iconName and iconSize', () => {
|
|
87
107
|
const {
|
|
88
108
|
asFragment
|
|
89
109
|
} = render( /*#__PURE__*/React.createElement(Button, {
|
|
@@ -93,13 +113,13 @@ describe('Button - Component', () => {
|
|
|
93
113
|
}));
|
|
94
114
|
expect(asFragment()).toMatchSnapshot();
|
|
95
115
|
});
|
|
96
|
-
test('Should render with iconPlacement
|
|
116
|
+
test('Should render with iconPlacement', () => {
|
|
97
117
|
const {
|
|
98
118
|
asFragment
|
|
99
119
|
} = render( /*#__PURE__*/React.createElement(Button, {
|
|
100
120
|
variant: "iconWithText",
|
|
101
121
|
iconName: "ZD-plus",
|
|
102
|
-
iconPlacement: "
|
|
122
|
+
iconPlacement: "end"
|
|
103
123
|
}, "Button"));
|
|
104
124
|
expect(asFragment()).toMatchSnapshot();
|
|
105
125
|
});
|
|
@@ -139,8 +159,7 @@ describe('Button - Component', () => {
|
|
|
139
159
|
}));
|
|
140
160
|
expect(asFragment()).toMatchSnapshot();
|
|
141
161
|
});
|
|
142
|
-
|
|
143
|
-
test.each(type)('Should render type of buttons - %s', type => {
|
|
162
|
+
test.each(Object.values(BUTTON_TYPE))('Should render type of buttons - %s', type => {
|
|
144
163
|
const {
|
|
145
164
|
asFragment
|
|
146
165
|
} = render( /*#__PURE__*/React.createElement(Button, {
|
|
@@ -166,14 +185,6 @@ describe('Button - Component', () => {
|
|
|
166
185
|
}));
|
|
167
186
|
expect(asFragment()).toMatchSnapshot();
|
|
168
187
|
});
|
|
169
|
-
test('Should render with readOnly style when isReadOnly prop is true', () => {
|
|
170
|
-
const {
|
|
171
|
-
asFragment
|
|
172
|
-
} = render( /*#__PURE__*/React.createElement(Button, {
|
|
173
|
-
isReadOnly: true
|
|
174
|
-
}));
|
|
175
|
-
expect(asFragment()).toMatchSnapshot();
|
|
176
|
-
});
|
|
177
188
|
test('Should render with selected style when isSelected prop is true', () => {
|
|
178
189
|
const {
|
|
179
190
|
asFragment
|
|
@@ -182,8 +193,7 @@ describe('Button - Component', () => {
|
|
|
182
193
|
}));
|
|
183
194
|
expect(asFragment()).toMatchSnapshot();
|
|
184
195
|
});
|
|
185
|
-
|
|
186
|
-
test.each(shape)('Should render shape of buttons - %s', shape => {
|
|
196
|
+
test.each(Object.values(SHAPE))('Should render shape of buttons - %s', shape => {
|
|
187
197
|
const {
|
|
188
198
|
asFragment
|
|
189
199
|
} = render( /*#__PURE__*/React.createElement(Button, {
|
|
@@ -191,17 +201,7 @@ describe('Button - Component', () => {
|
|
|
191
201
|
}));
|
|
192
202
|
expect(asFragment()).toMatchSnapshot();
|
|
193
203
|
});
|
|
194
|
-
|
|
195
|
-
test.each(paletteShade)('Should render paletteShade of buttons - %s', shade => {
|
|
196
|
-
const {
|
|
197
|
-
asFragment
|
|
198
|
-
} = render( /*#__PURE__*/React.createElement(Button, {
|
|
199
|
-
paletteShade: shade
|
|
200
|
-
}));
|
|
201
|
-
expect(asFragment()).toMatchSnapshot();
|
|
202
|
-
});
|
|
203
|
-
const disabledAppearance = ['none', 'dull', 'strike'];
|
|
204
|
-
test.each(disabledAppearance)('Should render disabledAppearance of buttons - %s', style => {
|
|
204
|
+
test.each(Object.values(DISABLED_APPEARANCE))('Should render disabledAppearance of buttons - %s', style => {
|
|
205
205
|
const {
|
|
206
206
|
asFragment
|
|
207
207
|
} = render( /*#__PURE__*/React.createElement(Button, {
|
|
@@ -239,9 +239,6 @@ describe('Button - Component', () => {
|
|
|
239
239
|
variant: "iconWithText",
|
|
240
240
|
iconName: "check",
|
|
241
241
|
customProps: {
|
|
242
|
-
wrapper: {
|
|
243
|
-
'data-wrapper': 'wrapperProps'
|
|
244
|
-
},
|
|
245
242
|
text: {
|
|
246
243
|
'data-text': 'textProps'
|
|
247
244
|
},
|
|
@@ -252,6 +249,21 @@ describe('Button - Component', () => {
|
|
|
252
249
|
}, "Button"));
|
|
253
250
|
expect(asFragment()).toMatchSnapshot();
|
|
254
251
|
});
|
|
252
|
+
test('Should apply customAttributes to button elements', () => {
|
|
253
|
+
const {
|
|
254
|
+
asFragment
|
|
255
|
+
} = render( /*#__PURE__*/React.createElement(Button, {
|
|
256
|
+
customAttributes: {
|
|
257
|
+
button: {
|
|
258
|
+
'data-wrapper': 'wrapperAttr'
|
|
259
|
+
},
|
|
260
|
+
text: {
|
|
261
|
+
'data-text': 'textAttr'
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
}, "Button"));
|
|
265
|
+
expect(asFragment()).toMatchSnapshot();
|
|
266
|
+
});
|
|
255
267
|
test('Should render with customId and testId', () => {
|
|
256
268
|
const {
|
|
257
269
|
asFragment
|
|
@@ -272,4 +284,83 @@ describe('Button - Component', () => {
|
|
|
272
284
|
}, "Button"));
|
|
273
285
|
expect(asFragment()).toMatchSnapshot();
|
|
274
286
|
});
|
|
287
|
+
test('Should render renderBefore slot content in DOM', () => {
|
|
288
|
+
const {
|
|
289
|
+
getByText
|
|
290
|
+
} = render( /*#__PURE__*/React.createElement(Button, {
|
|
291
|
+
renderBefore: () => /*#__PURE__*/React.createElement("span", null, "BeforeSlot")
|
|
292
|
+
}, "Button"));
|
|
293
|
+
expect(getByText('BeforeSlot')).toBeInTheDocument();
|
|
294
|
+
});
|
|
295
|
+
test('Should render renderAfter slot content in DOM', () => {
|
|
296
|
+
const {
|
|
297
|
+
getByText
|
|
298
|
+
} = render( /*#__PURE__*/React.createElement(Button, {
|
|
299
|
+
renderAfter: () => /*#__PURE__*/React.createElement("span", null, "AfterSlot")
|
|
300
|
+
}, "Button"));
|
|
301
|
+
expect(getByText('AfterSlot')).toBeInTheDocument();
|
|
302
|
+
});
|
|
303
|
+
test('Should render renderIcon slot content in DOM', () => {
|
|
304
|
+
const {
|
|
305
|
+
getByText
|
|
306
|
+
} = render( /*#__PURE__*/React.createElement(Button, {
|
|
307
|
+
variant: "icon",
|
|
308
|
+
renderIcon: () => /*#__PURE__*/React.createElement("span", null, "IconSlot")
|
|
309
|
+
}));
|
|
310
|
+
expect(getByText('IconSlot')).toBeInTheDocument();
|
|
311
|
+
});
|
|
312
|
+
test('Should not call onClick when button is disabled', () => {
|
|
313
|
+
const onClick = jest.fn();
|
|
314
|
+
const {
|
|
315
|
+
getByRole
|
|
316
|
+
} = render( /*#__PURE__*/React.createElement(Button, {
|
|
317
|
+
isDisabled: true,
|
|
318
|
+
onClick: onClick
|
|
319
|
+
}));
|
|
320
|
+
userEvent.click(getByRole('button'));
|
|
321
|
+
expect(onClick).not.toHaveBeenCalled();
|
|
322
|
+
});
|
|
323
|
+
test('Should render loader overlay when status is loading and loaderPlacement is overlay', () => {
|
|
324
|
+
const {
|
|
325
|
+
asFragment
|
|
326
|
+
} = render( /*#__PURE__*/React.createElement(Button, {
|
|
327
|
+
status: "loading",
|
|
328
|
+
loaderPlacement: "overlay"
|
|
329
|
+
}));
|
|
330
|
+
expect(asFragment()).toMatchSnapshot();
|
|
331
|
+
});
|
|
332
|
+
test('Should render success overlay when status is success and loaderPlacement is overlay', () => {
|
|
333
|
+
const {
|
|
334
|
+
asFragment
|
|
335
|
+
} = render( /*#__PURE__*/React.createElement(Button, {
|
|
336
|
+
status: "success",
|
|
337
|
+
loaderPlacement: "overlay"
|
|
338
|
+
}));
|
|
339
|
+
expect(asFragment()).toMatchSnapshot();
|
|
340
|
+
});
|
|
341
|
+
test('Should render with dataSelectorId', () => {
|
|
342
|
+
const {
|
|
343
|
+
asFragment
|
|
344
|
+
} = render( /*#__PURE__*/React.createElement(Button, {
|
|
345
|
+
dataSelectorId: "selectorId"
|
|
346
|
+
}));
|
|
347
|
+
expect(asFragment()).toMatchSnapshot();
|
|
348
|
+
});
|
|
349
|
+
describe('Presets', () => {
|
|
350
|
+
const presets = [['BRAND_GHOST', BRAND_GHOST], ['BRAND_TEXT_ONLY', BRAND_TEXT_ONLY], ['BRAND_TINTED_OUTLINE', BRAND_TINTED_OUTLINE], ['SUCCESS_GHOST', SUCCESS_GHOST], ['SUCCESS_TEXT_ONLY', SUCCESS_TEXT_ONLY], ['SUCCESS_TINTED_OUTLINE', SUCCESS_TINTED_OUTLINE], ['SECONDARY_GHOST_BRAND_TINTED_ONSELECT', SECONDARY_GHOST_BRAND_TINTED_ONSELECT], ['SECONDARY_GHOST_CANCEL', SECONDARY_GHOST_CANCEL], ['BLACK_TEXT_BRAND_ONHOVER', BLACK_TEXT_BRAND_ONHOVER], ['BRAND_BG_ONSELECT', BRAND_BG_ONSELECT], ['BRAND_TEXT_TINTED_HOVER', BRAND_TEXT_TINTED_HOVER], ['BRAND_TEXT_TINTED_DANGER_HOVER', BRAND_TEXT_TINTED_DANGER_HOVER]];
|
|
351
|
+
test.each(presets)('Should render preset %s', (_name, preset) => {
|
|
352
|
+
const {
|
|
353
|
+
asFragment
|
|
354
|
+
} = render( /*#__PURE__*/React.createElement(Button, preset, "Button"));
|
|
355
|
+
expect(asFragment()).toMatchSnapshot();
|
|
356
|
+
});
|
|
357
|
+
test.each(presets)('Should render preset %s in selected state', (_name, preset) => {
|
|
358
|
+
const {
|
|
359
|
+
asFragment
|
|
360
|
+
} = render( /*#__PURE__*/React.createElement(Button, _extends({}, preset, {
|
|
361
|
+
isSelected: true
|
|
362
|
+
}), "Button"));
|
|
363
|
+
expect(asFragment()).toMatchSnapshot();
|
|
364
|
+
});
|
|
365
|
+
});
|
|
275
366
|
});
|