;
+ });
+ });
+
+ it('does not warn if onClick is undefined', () => {
+ doNotExpectWarning(assertions.props.onClick.NO_LABEL.msg, () => {
+
;
+ });
+ });
+
it('does not warn if there is an aria-label', () => {
doNotExpectWarning(assertions.props.onClick.NO_LABEL.msg, () => {
;
diff --git a/lib/index.js b/lib/index.js
index f1e136b..8ca8432 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -12,6 +12,7 @@ var assertAccessibility = (tagName, props, children) => {
var propTests;
for (var propName in props) {
+ if (props[propName] === null || props[propName] === undefined) continue;
propTests = assertions.props[propName] || [];
for (key in propTests)
if (propTests[key] && !propTests[key].test(tagName, props, children))