react-a11y
Advanced tools
Comparing version 0.3.3 to 0.3.4
@@ -0,1 +1,8 @@ | ||
v0.3.4 - Fri, 15 Apr 2016 19:32:24 GMT | ||
-------------------------------------- | ||
- [e426ce](../../commit/e426ce) [fixed] Do not test null results of ReactDOM.findDOMNode (resolves #122) | ||
- [8aff35](../../commit/8aff35) [doc] reflect what needs to happen (#129) | ||
- [929307](../../commit/929307) [fixed] Don't throw violations for valid inputs with type="submit" (#132) | ||
v0.3.3 - Fri, 15 Apr 2016 19:32:24 GMT | ||
@@ -149,2 +156,2 @@ -------------------------------------- | ||
- | ||
- |
@@ -452,2 +452,14 @@ 'use strict'; | ||
it('does not warn for submit inputs with a value', function () { | ||
doNotExpectWarning(assertions.render.NO_LABEL.msg, function () { | ||
React.createElement('input', { type: 'submit', value: 'the name' }); | ||
}); | ||
}); | ||
it('warns for submit inputs without a value', function () { | ||
expectWarning(assertions.render.NO_LABEL.msg, function () { | ||
React.createElement('input', { type: 'submit' }); | ||
}); | ||
}); | ||
it('warns if an anchor has a tabIndex but no href', function () { | ||
@@ -761,3 +773,3 @@ expectWarning(assertions.render.NO_LABEL.msg, function () { | ||
before(function () { | ||
a11y(React, { includeSrcNode: "asString" }); | ||
a11y(React, { includeSrcNode: 'asString' }); | ||
fixture = document.createElement('div'); | ||
@@ -793,3 +805,3 @@ fixture.id = 'fixture-1'; | ||
var matches = msgs[assertions.render.NO_LABEL.msg].match(regex); | ||
assert.equal(matches[1], "div"); | ||
assert.equal(matches[1], 'div'); | ||
}); | ||
@@ -801,3 +813,3 @@ }); | ||
var barOnly = function barOnly(name, id, msg) { | ||
return id === "bar"; | ||
return id === 'bar'; | ||
}; | ||
@@ -804,0 +816,0 @@ |
@@ -66,3 +66,3 @@ 'use strict'; | ||
var assertLabel = function assertLabel(node, context, failureCB) { | ||
if (context.passed) return; | ||
if (context.passed || node === null) return; | ||
@@ -121,4 +121,4 @@ context.passed = hasLabel(node); | ||
return !(!isInteractive(tagName, props) && props.tabIndex == null) // tabIndex={0} is valid | ||
; | ||
return !(!isInteractive(tagName, props) && props.tabIndex == null // tabIndex={0} is valid | ||
); | ||
} | ||
@@ -202,2 +202,3 @@ }, | ||
test: function test(tagName, props, children, failureCB) { | ||
var isValidSubmit = tagName === 'input' && props.type === 'submit' && props.value != null; | ||
if (isHiddenFromAT(props) || presentationRoles.indexOf(props.role) !== -1) return; | ||
@@ -207,3 +208,3 @@ | ||
var failed = !(props['aria-label'] || props['aria-labelledby'] || tagName === 'img' && props.alt || hasChildTextNode(props, children, failureCB)); | ||
var failed = !(props['aria-label'] || props['aria-labelledby'] || isValidSubmit || tagName === 'img' && props.alt || hasChildTextNode(props, children, failureCB)); | ||
@@ -210,0 +211,0 @@ if (failed) failureCB(); |
@@ -106,3 +106,3 @@ 'use strict'; | ||
// https://facebook.github.io/react/docs/component-api.html#getdomnode | ||
if (includeSrcNode === "asString") warning.push("Source Node: " + srcNode.outerHTML);else if (srcNode) warning.push(srcNode); | ||
if (includeSrcNode === 'asString') warning.push('Source Node: ' + srcNode.outerHTML);else if (srcNode) warning.push(srcNode); | ||
} | ||
@@ -154,3 +154,3 @@ console.warn.apply(console, warning); | ||
var reactA11y = function reactA11y(_React) { | ||
var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; | ||
var options = arguments[1] === undefined ? {} : arguments[1]; | ||
var ReactDOM = options.ReactDOM; | ||
@@ -157,0 +157,0 @@ |
{ | ||
"name": "react-a11y", | ||
"version": "0.3.3", | ||
"version": "0.3.4", | ||
"description": "Warns about potential accessibility issues with your React elements.", | ||
@@ -25,19 +25,19 @@ "main": "./dist/index.js", | ||
"devDependencies": { | ||
"babel": "^5.2.17", | ||
"babel-core": "^5.2.17", | ||
"babel-loader": "^5.0.0", | ||
"jsx-loader": "^0.12.2", | ||
"jsxhint": "^0.8.1", | ||
"karma": "^0.13.3", | ||
"karma-chrome-launcher": "^0.1.7", | ||
"babel": "5.2.17", | ||
"babel-core": "5.2.17", | ||
"babel-loader": "5.0.0", | ||
"jsx-loader": "0.12.2", | ||
"jsxhint": "0.8.1", | ||
"karma": "0.13.3", | ||
"karma-chrome-launcher": "0.1.7", | ||
"karma-cli": "0.0.4", | ||
"karma-firefox-launcher": "^0.1.3", | ||
"karma-mocha": "^0.1.10", | ||
"karma-sourcemap-loader": "^0.3.2", | ||
"karma-webpack": "^1.7.0", | ||
"mocha": "^2.0.1", | ||
"karma-firefox-launcher": "0.1.3", | ||
"karma-mocha": "0.1.10", | ||
"karma-sourcemap-loader": "0.3.2", | ||
"karma-webpack": "1.7.0", | ||
"mocha": "2.0.1", | ||
"react": "^0.12 || ^0.13 || ^0.14", | ||
"react-dom": "^0.14.7", | ||
"react-dom": "0.14.7", | ||
"rf-release": "0.4.0", | ||
"webpack": "^1.4.13" | ||
"webpack": "1.4.13" | ||
}, | ||
@@ -57,2 +57,2 @@ "tags": [ | ||
} | ||
} | ||
} |
@@ -78,3 +78,3 @@ React A11y | ||
You can pass `ReactDOM` to `a11y` for `React 0.14` compatibility. | ||
You should pass `ReactDOM` to `a11y` for `React >= 0.14` compatibility. | ||
@@ -81,0 +81,0 @@ ``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
217066
14
5706
1