@occmundial/occ-atomic 2.0.0 → 3.0.0-beta.1
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +62 -0
- package/build/Autocomplete/Autocomplete.js +2 -5
- package/build/Autocomplete/Autocomplete.test.js +17 -9
- package/build/Autocomplete/styles.js +5 -5
- package/build/Button/Button.js +28 -7
- package/build/Droplist/Droplist.js +37 -49
- package/build/Droplist/Droplist.test.js +2 -2
- package/build/Droplist/__snapshots__/Droplist.test.js.snap +57 -25
- package/build/Droplist/styles.js +62 -32
- package/build/Fab/__snapshots__/Fab.test.js.snap +1 -0
- package/build/Text/styles.js +2 -1
- package/build/TextField/TextField.js +77 -104
- package/build/TextField/TextField.test.js +7 -15
- package/build/TextField/__snapshots__/TextField.test.js.snap +59 -145
- package/build/TextField/styles.js +81 -149
- package/build/tokens/colors.json +38 -11
- package/package.json +1 -1
package/build/Droplist/styles.js
CHANGED
@@ -5,70 +5,100 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports["default"] = void 0;
|
7
7
|
|
8
|
-
var
|
8
|
+
var _spacing = _interopRequireDefault(require("../tokens/spacing.json"));
|
9
9
|
|
10
|
-
var
|
10
|
+
var _colors = _interopRequireDefault(require("../tokens/colors.json"));
|
11
|
+
|
12
|
+
var _shadows = _interopRequireDefault(require("../tokens/shadows.json"));
|
13
|
+
|
14
|
+
var _fonts = _interopRequireDefault(require("../tokens/fonts.json"));
|
15
|
+
|
16
|
+
var _borderRadius = _interopRequireDefault(require("../tokens/borderRadius.json"));
|
17
|
+
|
18
|
+
var _styles = require("../Text/styles");
|
11
19
|
|
12
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
13
21
|
|
14
|
-
var gutter = _spacing["default"].gutter,
|
15
|
-
tiny = _spacing["default"].tiny,
|
16
|
-
small = _spacing["default"].small,
|
17
|
-
base = _spacing["default"].base,
|
18
|
-
xTiny = _spacing["default"].xTiny;
|
19
|
-
var primLighter = _colors["default"].primLighter,
|
20
|
-
grey50 = _colors["default"].grey50,
|
21
|
-
grey200 = _colors["default"].grey200,
|
22
|
-
bgWhite = _colors["default"].bgWhite,
|
23
|
-
textLink = _colors["default"].textLink;
|
24
22
|
var _default = {
|
25
23
|
block: {
|
26
|
-
background:
|
27
|
-
border: "1px solid ".concat(
|
28
|
-
borderRadius:
|
29
|
-
overflow: 'hidden'
|
24
|
+
background: _colors["default"]['text-field'].bg["default"],
|
25
|
+
border: "1px solid ".concat(_colors["default"]['text-field'].border["default"]),
|
26
|
+
borderRadius: _borderRadius["default"]['br-xs'],
|
27
|
+
overflow: 'hidden',
|
28
|
+
padding: _spacing["default"]['size-2'],
|
29
|
+
boxShadow: _shadows["default"]['elevation-elevation-4']
|
30
|
+
},
|
31
|
+
text: {
|
32
|
+
margin: 0
|
30
33
|
},
|
31
34
|
group: {
|
32
|
-
padding: [
|
35
|
+
padding: [_spacing["default"]['size-2'], _spacing["default"]['size-4'], 0],
|
36
|
+
display: 'inline-block'
|
37
|
+
},
|
38
|
+
groupText: {
|
39
|
+
font: (0, _styles.parseFontValue)(_fonts["default"]['text-field-label'])
|
33
40
|
},
|
34
41
|
item: {
|
35
42
|
display: 'flex',
|
36
43
|
justifyContent: 'space-between',
|
37
|
-
|
44
|
+
alignItems: 'center',
|
45
|
+
padding: [_spacing["default"]['size-3'], _spacing["default"]['size-4']],
|
38
46
|
transition: '0.1s all',
|
47
|
+
borderRadius: _borderRadius["default"]['br-xs'],
|
39
48
|
position: 'relative',
|
40
49
|
'&:hover': {
|
41
|
-
background:
|
50
|
+
background: _colors["default"].dropdown.bg.hover
|
51
|
+
},
|
52
|
+
'&:active, &:focus': {
|
53
|
+
background: _colors["default"].dropdown.bg.active,
|
54
|
+
'& > $rightText': {
|
55
|
+
color: _colors["default"].text.corp.primary
|
56
|
+
}
|
42
57
|
}
|
43
58
|
},
|
44
59
|
itemPointer: {
|
45
60
|
cursor: 'pointer'
|
46
61
|
},
|
62
|
+
disabled: {
|
63
|
+
pointerEvents: 'none'
|
64
|
+
},
|
47
65
|
right: {
|
48
|
-
"
|
49
|
-
|
50
|
-
|
66
|
+
marginLeft: _spacing["default"]['size-4']
|
67
|
+
},
|
68
|
+
rightText: {
|
69
|
+
font: (0, _styles.parseFontValue)(_fonts["default"]['text-field-label']),
|
70
|
+
color: _colors["default"].text.corp.secondary
|
51
71
|
},
|
52
72
|
onFocus: {
|
53
|
-
background:
|
73
|
+
background: _colors["default"].dropdown.bg.active,
|
54
74
|
'&:hover': {
|
55
|
-
background:
|
75
|
+
background: _colors["default"].dropdown.bg.active
|
56
76
|
}
|
57
77
|
},
|
58
78
|
icon: {
|
59
|
-
marginRight:
|
60
|
-
position: 'absolute',
|
61
|
-
top: gutter
|
79
|
+
marginRight: _spacing["default"]['size-2']
|
62
80
|
},
|
63
|
-
|
81
|
+
mainText: {
|
64
82
|
display: 'inline-block',
|
65
|
-
|
83
|
+
font: (0, _styles.parseFontValue)(_fonts["default"]['text-field-placeholder']),
|
84
|
+
color: _colors["default"].text.corp.primary
|
85
|
+
},
|
86
|
+
corpDisabled: {
|
87
|
+
color: _colors["default"].text.corp.disabled
|
66
88
|
},
|
67
89
|
extraText: {
|
68
|
-
marginLeft:
|
90
|
+
marginLeft: _spacing["default"]['size-1'],
|
91
|
+
display: 'inline-block',
|
92
|
+
font: (0, _styles.parseFontValue)(_fonts["default"]['heading-tag']),
|
93
|
+
color: _colors["default"].text.indigo.primary
|
94
|
+
},
|
95
|
+
highlighted: {
|
96
|
+
background: _colors["default"].bg.action.secondary["default"],
|
97
|
+
font: (0, _styles.parseFontValue)(_fonts["default"]['text-field-placeholder'])
|
69
98
|
},
|
70
|
-
|
71
|
-
|
99
|
+
itemContainer: {
|
100
|
+
display: 'flex',
|
101
|
+
alignItems: 'center'
|
72
102
|
}
|
73
103
|
};
|
74
104
|
exports["default"] = _default;
|
@@ -3,6 +3,7 @@
|
|
3
3
|
exports[`FAB matches the snapshot 1`] = `
|
4
4
|
<button
|
5
5
|
className="Button-btn-0-1-28 Button-btn-0-1-1 Button-tertiary-0-1-23 Button-tertiary-0-1-6 fab Button-iconOnly-0-1-38 Button-iconOnly-0-1-18 Button-round-0-1-40 Button-round-0-1-20"
|
6
|
+
disabled={false}
|
6
7
|
>
|
7
8
|
<span
|
8
9
|
className="Button-cont-0-1-29 Button-cont-0-1-2"
|
package/build/Text/styles.js
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports["default"] = void 0;
|
6
|
+
exports["default"] = exports.parseFontValue = void 0;
|
7
7
|
|
8
8
|
var _colors = _interopRequireDefault(require("../subatomic/colors"));
|
9
9
|
|
@@ -46,6 +46,7 @@ var parseFontValue = function parseFontValue(font) {
|
|
46
46
|
return "".concat(font.fontWeight, " ").concat(font.fontSize, "/").concat(font.lineHeight, " ").concat(_fonts["default"].body);
|
47
47
|
};
|
48
48
|
|
49
|
+
exports.parseFontValue = parseFontValue;
|
49
50
|
var _default = {
|
50
51
|
text: {
|
51
52
|
letterSpacing: 0,
|
@@ -15,9 +15,9 @@ var _reactTextMask = _interopRequireDefault(require("react-text-mask"));
|
|
15
15
|
|
16
16
|
var _Icon = _interopRequireDefault(require("../Icon"));
|
17
17
|
|
18
|
-
var
|
18
|
+
var _Button = _interopRequireDefault(require("../Button"));
|
19
19
|
|
20
|
-
var
|
20
|
+
var _colors = _interopRequireDefault(require("../tokens/colors.json"));
|
21
21
|
|
22
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
23
23
|
|
@@ -222,12 +222,9 @@ var TextField = /*#__PURE__*/function (_React$Component) {
|
|
222
222
|
type = _this$props7.type,
|
223
223
|
inputClassName = _this$props7.inputClassName,
|
224
224
|
alignRight = _this$props7.alignRight,
|
225
|
-
hjWhitelist = _this$props7.hjWhitelist
|
226
|
-
searchField = _this$props7.searchField;
|
225
|
+
hjWhitelist = _this$props7.hjWhitelist;
|
227
226
|
var className = classes.input;
|
228
|
-
if (searchField) className += " ".concat(classes.searchField);
|
229
227
|
if (iconName) className += " ".concat(classes.hasIcon);
|
230
|
-
if (searchField && iconName) className += " ".concat(classes.searchFieldHasIcon);
|
231
228
|
if (clear) className += " ".concat(classes.hasClear);
|
232
229
|
if (alignRight) className += " ".concat(classes.alignRight);
|
233
230
|
if (type == 'select') className += " ".concat(classes.select);
|
@@ -240,65 +237,54 @@ var TextField = /*#__PURE__*/function (_React$Component) {
|
|
240
237
|
}, {
|
241
238
|
key: "setIconColor",
|
242
239
|
value: function setIconColor() {
|
243
|
-
var
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
disabled = _this$props8.disabled,
|
249
|
-
searchField = _this$props8.searchField,
|
250
|
-
error = _this$props8.error,
|
251
|
-
allowError = _this$props8.allowError;
|
252
|
-
if (disabled) return _colors["default"].grey500;
|
253
|
-
if (status === 'focus' && searchField) return _colors["default"].prim;
|
254
|
-
if (error && (allowError || touched)) return _colors["default"].error;
|
255
|
-
if (status !== 'focus' && searchField && value) return _colors["default"].grey900;
|
256
|
-
return _colors["default"].grey500;
|
240
|
+
var status = this.state.status;
|
241
|
+
var disabled = this.props.disabled;
|
242
|
+
if (disabled) return _colors["default"].icon["default"].disabled;
|
243
|
+
if (status === 'focus') return _colors["default"].icon.brand.bold;
|
244
|
+
return _colors["default"].icon["default"]["default"];
|
257
245
|
}
|
258
246
|
}, {
|
259
247
|
key: "render",
|
260
248
|
value: function render() {
|
261
249
|
var _this2 = this;
|
262
250
|
|
263
|
-
var _this$
|
264
|
-
status = _this$
|
265
|
-
value = _this$
|
266
|
-
touched = _this$
|
267
|
-
showPass = _this$
|
268
|
-
passIconBeingClicked = _this$
|
269
|
-
var _this$
|
270
|
-
classes = _this$
|
271
|
-
input = _this$
|
272
|
-
meta = _this$
|
273
|
-
label = _this$
|
274
|
-
placeholder = _this$
|
275
|
-
counter = _this$
|
276
|
-
maxLength = _this$
|
277
|
-
type = _this$
|
278
|
-
name = _this$
|
279
|
-
options = _this$
|
280
|
-
id = _this$
|
281
|
-
style = _this$
|
282
|
-
disabled = _this$
|
283
|
-
autoFocus = _this$
|
284
|
-
error = _this$
|
285
|
-
assistiveText = _this$
|
286
|
-
clear = _this$
|
287
|
-
iconName = _this$
|
288
|
-
allowError = _this$
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
searchField = _this$props9.searchField,
|
297
|
-
testId = _this$props9.testId;
|
251
|
+
var _this$state = this.state,
|
252
|
+
status = _this$state.status,
|
253
|
+
value = _this$state.value,
|
254
|
+
touched = _this$state.touched,
|
255
|
+
showPass = _this$state.showPass,
|
256
|
+
passIconBeingClicked = _this$state.passIconBeingClicked;
|
257
|
+
var _this$props8 = this.props,
|
258
|
+
classes = _this$props8.classes,
|
259
|
+
input = _this$props8.input,
|
260
|
+
meta = _this$props8.meta,
|
261
|
+
label = _this$props8.label,
|
262
|
+
placeholder = _this$props8.placeholder,
|
263
|
+
counter = _this$props8.counter,
|
264
|
+
maxLength = _this$props8.maxLength,
|
265
|
+
type = _this$props8.type,
|
266
|
+
name = _this$props8.name,
|
267
|
+
options = _this$props8.options,
|
268
|
+
id = _this$props8.id,
|
269
|
+
style = _this$props8.style,
|
270
|
+
disabled = _this$props8.disabled,
|
271
|
+
autoFocus = _this$props8.autoFocus,
|
272
|
+
error = _this$props8.error,
|
273
|
+
assistiveText = _this$props8.assistiveText,
|
274
|
+
clear = _this$props8.clear,
|
275
|
+
iconName = _this$props8.iconName,
|
276
|
+
allowError = _this$props8.allowError,
|
277
|
+
required = _this$props8.required,
|
278
|
+
mask = _this$props8.mask,
|
279
|
+
guide = _this$props8.guide,
|
280
|
+
inputMode = _this$props8.inputMode,
|
281
|
+
disableAutoComplete = _this$props8.disableAutoComplete,
|
282
|
+
pattern = _this$props8.pattern,
|
283
|
+
testId = _this$props8.testId;
|
298
284
|
var realStatus = status;
|
299
285
|
var InputType = type == 'select' ? 'select' : type == 'textarea' ? 'textarea' : 'input';
|
300
286
|
var errorStatus = meta && meta.error && (meta.touched || allowError) || error && (touched || allowError) && !passIconBeingClicked;
|
301
|
-
if (disabled) realStatus = 'disabled';else if (status != 'focus' && errorStatus) realStatus = 'error';
|
287
|
+
if (disabled) realStatus = 'disabled';else if (status != 'focus' && errorStatus) realStatus = 'error';
|
302
288
|
var element, passIcon;
|
303
289
|
var commonProps = {
|
304
290
|
name: name,
|
@@ -344,14 +330,13 @@ var TextField = /*#__PURE__*/function (_React$Component) {
|
|
344
330
|
}, input && input.value ? input.value : value ? value : placeholder));
|
345
331
|
}
|
346
332
|
|
347
|
-
passIcon = /*#__PURE__*/_react["default"].createElement("
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
}));
|
333
|
+
passIcon = /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
334
|
+
theme: "ghostGrey",
|
335
|
+
icon: "eye",
|
336
|
+
size: "md",
|
337
|
+
disabled: true,
|
338
|
+
className: classes.rightButton
|
339
|
+
});
|
355
340
|
} else if (type == 'select') {
|
356
341
|
element = /*#__PURE__*/_react["default"].createElement(InputType, commonProps, /*#__PURE__*/_react["default"].createElement("option", {
|
357
342
|
value: "",
|
@@ -369,7 +354,7 @@ var TextField = /*#__PURE__*/function (_React$Component) {
|
|
369
354
|
value: option.value,
|
370
355
|
disabled: option.disabled
|
371
356
|
}, testId && {
|
372
|
-
'data-testid': "".concat(testId, "__item-").concat(
|
357
|
+
'data-testid': "".concat(testId, "__item-").concat(option.value)
|
373
358
|
}), option.label);
|
374
359
|
}));
|
375
360
|
} else {
|
@@ -399,61 +384,55 @@ var TextField = /*#__PURE__*/function (_React$Component) {
|
|
399
384
|
}, disableAutoComplete && {
|
400
385
|
autoComplete: 'off'
|
401
386
|
}));
|
402
|
-
passIcon = /*#__PURE__*/_react["default"].createElement("
|
387
|
+
passIcon = /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
388
|
+
theme: "ghostGrey",
|
389
|
+
icon: showPass ? 'eye' : 'eye-slash',
|
390
|
+
size: "md",
|
391
|
+
className: classes.rightButton,
|
403
392
|
onMouseDown: this.togglePass,
|
404
393
|
onMouseUp: this.focusInput,
|
405
|
-
onMouseOut: this.outOfPassIcon
|
406
|
-
|
407
|
-
}, /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
|
408
|
-
iconName: showPass ? 'eye' : 'eyeClosed',
|
409
|
-
width: _iconSizes["default"].small,
|
410
|
-
height: _iconSizes["default"].small,
|
411
|
-
colors: showPass ? [_colors["default"].grey900] : [_colors["default"].grey400]
|
412
|
-
}));
|
394
|
+
onMouseOut: this.outOfPassIcon
|
395
|
+
});
|
413
396
|
}
|
414
397
|
|
415
398
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
416
399
|
className: this.setClassName(realStatus),
|
417
400
|
style: style
|
418
|
-
},
|
401
|
+
}, label && /*#__PURE__*/_react["default"].createElement("div", {
|
419
402
|
className: classes.top
|
420
403
|
}, label && /*#__PURE__*/_react["default"].createElement("label", {
|
421
|
-
className:
|
404
|
+
className: classes.label
|
422
405
|
}, label)), /*#__PURE__*/_react["default"].createElement("div", {
|
423
406
|
className: classes.inputWrap
|
424
407
|
}, iconName && /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
|
425
408
|
iconName: iconName,
|
426
|
-
width:
|
427
|
-
height:
|
409
|
+
width: 24,
|
410
|
+
height: 24,
|
428
411
|
className: classes.icon,
|
429
412
|
colors: [this.setIconColor()]
|
430
413
|
}), type == 'select' && /*#__PURE__*/_react["default"].createElement("div", {
|
431
414
|
className: classes.selectIcon
|
432
415
|
}, /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
|
433
|
-
iconName: "
|
434
|
-
width:
|
435
|
-
height:
|
436
|
-
colors: disabled ? [_colors["default"].
|
437
|
-
})), type == 'password' && passIcon, value && clear && /*#__PURE__*/_react["default"].createElement("
|
438
|
-
|
439
|
-
|
416
|
+
iconName: "chevron-down",
|
417
|
+
width: 24,
|
418
|
+
height: 24,
|
419
|
+
colors: disabled ? [_colors["default"].icon["default"].disabled] : [_colors["default"].icon["default"]["default"]]
|
420
|
+
})), element, type == 'password' && passIcon, value && clear && /*#__PURE__*/_react["default"].createElement(_Button["default"], _extends({
|
421
|
+
icon: "x",
|
422
|
+
theme: "ghostGrey",
|
423
|
+
size: "md",
|
424
|
+
className: classes.rightButton,
|
425
|
+
onClick: this.onClear
|
440
426
|
}, testId && {
|
441
427
|
'data-testid': "".concat(testId, "__container-close-icon")
|
442
|
-
}), /*#__PURE__*/_react["default"].createElement(
|
443
|
-
iconName: "close",
|
444
|
-
width: _iconSizes["default"].small,
|
445
|
-
height: _iconSizes["default"].small
|
446
|
-
})), element), (assistiveText || counter && maxLength || lockHeight) && /*#__PURE__*/_react["default"].createElement("div", {
|
428
|
+
}))), (assistiveText || counter && maxLength) && /*#__PURE__*/_react["default"].createElement("div", {
|
447
429
|
className: classes.bottom
|
430
|
+
}, /*#__PURE__*/_react["default"].createElement("span", {
|
431
|
+
className: classes.assistiveTextWrap
|
448
432
|
}, assistiveText && /*#__PURE__*/_react["default"].createElement("label", {
|
449
|
-
className: "".concat(classes.
|
450
|
-
},
|
451
|
-
|
452
|
-
width: _iconSizes["default"].tiny,
|
453
|
-
height: _iconSizes["default"].tiny,
|
454
|
-
className: classes.errorIcon
|
455
|
-
}) : null, ' ', assistiveText), counter && maxLength && /*#__PURE__*/_react["default"].createElement("label", {
|
456
|
-
className: "".concat(classes.label, " ").concat(classes.right, " ").concat(classes.counter)
|
433
|
+
className: "".concat(classes.assistiveText, " ").concat(realStatus == 'error' ? classes.assistiveError : null)
|
434
|
+
}, assistiveText)), counter && maxLength && /*#__PURE__*/_react["default"].createElement("label", {
|
435
|
+
className: "".concat(classes.counter)
|
457
436
|
}, value.length, " / ", maxLength)));
|
458
437
|
}
|
459
438
|
}]);
|
@@ -511,9 +490,6 @@ TextField.propTypes = {
|
|
511
490
|
/** It allows the component to display the error messages even if it hasn't been touched. */
|
512
491
|
allowError: _propTypes["default"].bool,
|
513
492
|
|
514
|
-
/** By default the TextField container would be smaller without a label or an assistive text. lockHeight will maintain the same height as if it had both, label and assistive text. */
|
515
|
-
lockHeight: _propTypes["default"].bool,
|
516
|
-
|
517
493
|
/** Use as a default value. */
|
518
494
|
valueProp: _propTypes["default"].node,
|
519
495
|
|
@@ -583,9 +559,6 @@ TextField.propTypes = {
|
|
583
559
|
/** Regular expression to validate the input content. */
|
584
560
|
pattern: _propTypes["default"].string,
|
585
561
|
|
586
|
-
/** Size of the TextField. */
|
587
|
-
searchField: _propTypes["default"].bool,
|
588
|
-
|
589
562
|
/** The testId property adds the data attribute data-testid to the main element and should be used for testing only. */
|
590
563
|
testId: _propTypes["default"].string
|
591
564
|
};
|
@@ -105,13 +105,13 @@ describe("TextField", function () {
|
|
105
105
|
classes: classes,
|
106
106
|
clear: true
|
107
107
|
}));
|
108
|
-
expect(wrapper.find('.
|
108
|
+
expect(wrapper.find('.rightButton').length).toBe(0);
|
109
109
|
wrapper.setState({
|
110
110
|
value: 'Value'
|
111
111
|
});
|
112
|
-
expect(wrapper.find('.
|
113
|
-
wrapper.find('.
|
114
|
-
expect(wrapper.find('.
|
112
|
+
expect(wrapper.find('.rightButton').length).toBe(1);
|
113
|
+
wrapper.find('.rightButton').simulate('click');
|
114
|
+
expect(wrapper.find('.rightButton').length).toBe(0);
|
115
115
|
expect(wrapper.state('value')).toBe('');
|
116
116
|
});
|
117
117
|
it('shows the TextField with an error', function () {
|
@@ -121,12 +121,12 @@ describe("TextField", function () {
|
|
121
121
|
error: true
|
122
122
|
}));
|
123
123
|
expect(wrapper.find('.error').length).toBe(0);
|
124
|
-
expect(wrapper.find('.
|
124
|
+
expect(wrapper.find('.assistiveError').length).toBe(0);
|
125
125
|
wrapper.setState({
|
126
126
|
touched: true
|
127
127
|
});
|
128
128
|
expect(wrapper.find('.error').length).toBe(1);
|
129
|
-
expect(wrapper.find('.
|
129
|
+
expect(wrapper.find('.assistiveError').length).toBe(1);
|
130
130
|
expect(wrapper.find('.error').at(0).hasClass('container')).toBe(true);
|
131
131
|
});
|
132
132
|
it('sets a default value', function () {
|
@@ -179,7 +179,7 @@ describe("TextField", function () {
|
|
179
179
|
onClear: onClear,
|
180
180
|
valueProp: "Value"
|
181
181
|
}));
|
182
|
-
wrapper.find('.
|
182
|
+
wrapper.find('.rightButton').simulate('click');
|
183
183
|
expect(onClear.mock.calls.length).toBe(1);
|
184
184
|
});
|
185
185
|
it('calls the onRef function', function () {
|
@@ -228,14 +228,6 @@ describe("TextField", function () {
|
|
228
228
|
});
|
229
229
|
expect(wrapper.state('value')).toBe('123abc');
|
230
230
|
});
|
231
|
-
it('renders as a SearchField', function () {
|
232
|
-
var wrapper = (0, _enzyme.shallow)( /*#__PURE__*/_react["default"].createElement(_TextField["default"], {
|
233
|
-
searchField: true,
|
234
|
-
classes: classes
|
235
|
-
}));
|
236
|
-
var input = wrapper.find('input');
|
237
|
-
expect(input.hasClass('searchField')).toBe(true);
|
238
|
-
});
|
239
231
|
});
|
240
232
|
describe("TextFieldJSS", function () {
|
241
233
|
it('matches the snapshot', function () {
|