Skip to content

Commit 72ecb69

Browse files
committed
Merge remote-tracking branch 'upstream/master' into tag-failures
Conflicts: lib/index.js
2 parents e52b7e5 + e7d1373 commit 72ecb69

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

lib/__tests__/index-test.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,18 @@ describe('props', () => {
3535
});
3636
});
3737

38+
it('does not warn if onClick is null', () => {
39+
doNotExpectWarning(assertions.props.onClick.NO_LABEL.msg, () => {
40+
<div onClick={null}/>;
41+
});
42+
});
43+
44+
it('does not warn if onClick is undefined', () => {
45+
doNotExpectWarning(assertions.props.onClick.NO_LABEL.msg, () => {
46+
<div onClick={undefined}/>;
47+
});
48+
});
49+
3850
it('does not warn if there is an aria-label', () => {
3951
doNotExpectWarning(assertions.props.onClick.NO_LABEL.msg, () => {
4052
<div aria-label="foo" onClick={k}/>;

lib/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ var assertAccessibility = (tagName, props, children) => {
1212

1313
var propTests;
1414
for (var propName in props) {
15+
if (props[propName] === null || props[propName] === undefined) continue;
1516
propTests = assertions.props[propName] || [];
1617
for (key in propTests)
1718
if (propTests[key] && !propTests[key].test(tagName, props, children))

0 commit comments

Comments
 (0)