Skip to content

Commit b05cf67

Browse files
author
Edward Xiao
committed
no message
1 parent 634bd3b commit b05cf67

19 files changed

+118
-280
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
/*.log
33
/log/*.log
44
coverage
5+
/notes

lib/components/Checkbox.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,14 +262,18 @@ var component = function component(_ref) {
262262
validationCallback && validationCallback(err);
263263
}, []);
264264
useEffect(function () {
265-
/* istanbul ignore if because it won't happen */
265+
/* istanbul ignore next because it won't happen */
266266
if ($el === null) {
267267
return;
268268
}
269+
/* istanbul ignore next because of https://github.com/airbnb/enzyme/issues/441 && https://github.com/airbnb/enzyme/blob/master/docs/future.md */
270+
269271

270272
if (id) {
271273
$el.current.setAttribute('id', String(id));
272274
}
275+
/* istanbul ignore next because of https://github.com/airbnb/enzyme/issues/441 && https://github.com/airbnb/enzyme/blob/master/docs/future.md */
276+
273277

274278
if (tabIndex) {
275279
$el.current.setAttribute('tabindex', String(tabIndex));

lib/components/Radiobox.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,10 +273,14 @@ var component = function component(_ref) {
273273
if ($el === null) {
274274
return;
275275
}
276+
/* istanbul ignore next because of https://github.com/airbnb/enzyme/issues/441 && https://github.com/airbnb/enzyme/blob/master/docs/future.md */
277+
276278

277279
if (id) {
278280
$el.current.setAttribute('id', String(id));
279281
}
282+
/* istanbul ignore next because of https://github.com/airbnb/enzyme/issues/441 && https://github.com/airbnb/enzyme/blob/master/docs/future.md */
283+
280284

281285
if (tabIndex) {
282286
$el.current.setAttribute('tabindex', String(tabIndex));

lib/components/Select.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,7 @@ var component = function component(_ref) {
499499
var removeActive = useCallback(function () {
500500
for (var _i2 = 0; _i2 < $itemsRef.length; _i2 += 1) {
501501
var $node = $itemsRef[_i2];
502+
/* istanbul ignore next because it won't happen */
502503

503504
if (!$node) {
504505
break;

lib/components/Textarea.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,10 +496,14 @@ var component = function component(_ref) {
496496
if ($el === null) {
497497
return;
498498
}
499+
/* istanbul ignore next because of https://github.com/airbnb/enzyme/issues/441 && https://github.com/airbnb/enzyme/blob/master/docs/future.md */
500+
499501

500502
if (id) {
501503
$el.current.setAttribute('id', String(id));
502504
}
505+
/* istanbul ignore next because of https://github.com/airbnb/enzyme/issues/441 && https://github.com/airbnb/enzyme/blob/master/docs/future.md */
506+
503507

504508
if (tabIndex) {
505509
$el.current.setAttribute('tabindex', String(tabIndex));
@@ -514,6 +518,7 @@ var component = function component(_ref) {
514518
setInternalValue(String(value));
515519
}, [value]);
516520
useEffect(function () {
521+
/* istanbul ignore next because of https://github.com/airbnb/enzyme/issues/441 && https://github.com/airbnb/enzyme/blob/master/docs/future.md */
517522
if (typeof prevInternalValue !== 'undefined' && prevInternalValue !== internalValue) {
518523
if (option.customFunc && onKeyUp) {
519524
check();

lib/components/Textbox.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -643,10 +643,14 @@ var component = function component(_ref) {
643643
if ($el === null) {
644644
return;
645645
}
646+
/* istanbul ignore next because of https://github.com/airbnb/enzyme/issues/441 && https://github.com/airbnb/enzyme/blob/master/docs/future.md */
647+
646648

647649
if (id) {
648650
$el.current.setAttribute('id', String(id));
649651
}
652+
/* istanbul ignore next because of https://github.com/airbnb/enzyme/issues/441 && https://github.com/airbnb/enzyme/blob/master/docs/future.md */
653+
650654

651655
if (tabIndex) {
652656
$el.current.setAttribute('tabindex', String(tabIndex));
@@ -661,6 +665,7 @@ var component = function component(_ref) {
661665
setInternalValue(String(value));
662666
}, [value]);
663667
useEffect(function () {
668+
/* istanbul ignore next because of https://github.com/airbnb/enzyme/issues/441 && https://github.com/airbnb/enzyme/blob/master/docs/future.md */
664669
if (typeof prevInternalValue !== 'undefined' && prevInternalValue !== internalValue) {
665670
if (option.customFunc && onKeyUp) {
666671
check();

lib/react-inputs-validation.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/react-inputs-validation.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-inputs-validation",
3-
"version": "3.4.9",
3+
"version": "3.4.10",
44
"description": "React form input validation components",
55
"main": "index.js",
66
"repository": {

src/__tests__/Checkbox.js

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,6 @@ describe('Checkbox component', () => {
1515
wrapper.setProps({ validate: true });
1616
expect(wrapper.update().find(`.${MSG_CLASS_IDENTITIFIER}`).length).toEqual(1);
1717
});
18-
// TODO
19-
// it('[Providing tabIndex]: Should tabIndex be exact the same with given prop', () => {
20-
// const wrapper = mount(<Checkbox tabIndex={10} onBlur={() => {}} />);
21-
// const $input = wrapper.find(INPUT);
22-
// $input.simulate('focus');
23-
// $input.simulate('blur');
24-
// console.log($input.props())
25-
// console.log(wrapper.find(INPUT).props())
26-
// expect(wrapper.find(INPUT).props()['tabindex']).toEqual(1);
27-
// });
2818

2919
it('[Providing msgOnError]: Should msg be msgOnError', () => {
3020
const msgOnError = 'msgOnError';
@@ -187,29 +177,6 @@ describe('Checkbox component', () => {
187177
expect(wrapper.find(`.${MSG_CLASS_IDENTITIFIER}`).length).toEqual(0);
188178
});
189179

190-
// TODO
191-
// it('[All props]: Should pass all props', () => {
192-
// const wrapper = mount(
193-
// <Checkbox
194-
// id="id"
195-
// name="name"
196-
// tabIndex="1"
197-
// value=""
198-
// labelHtml="foo"
199-
// classNameInput="classNameInput"
200-
// classNameWrapper="classNameWrapper"
201-
// classNameInputBox="classNameInputBox"
202-
// classNameContainer="classNameContainer"
203-
// customStyleInput={{}}
204-
// customStyleWrapper={{}}
205-
// customStyleInputBox={{}}
206-
// customStyleContainer={{}}
207-
// validationOption={{}}
208-
// />,
209-
// );
210-
// expect(wrapper.find(`#id`).hostNodes().length).toEqual(1);
211-
// });
212-
213180
it('[asyncObj]: Should show error', () => {
214181
const wrapper = mount(<Checkbox onBlur={() => {}} asyncMsgObj={{}} />);
215182
const $input = wrapper.find(INPUT);

0 commit comments

Comments
 (0)