Skip to content

Commit

Permalink
Fix test failures raised by the upgrade to ARIA 1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
jessebeach committed Jun 17, 2020
1 parent b1f412a commit 8059f51
Show file tree
Hide file tree
Showing 10 changed files with 2 additions and 17 deletions.
1 change: 0 additions & 1 deletion __tests__/src/rules/alt-text-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ const array = [{
'input[type="image"]': ['InputImage'],
}];


ruleTester.run('alt-text', rule, {
valid: [
// DEFAULT ELEMENT 'img' TESTS
Expand Down
1 change: 0 additions & 1 deletion __tests__/src/rules/label-has-for-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ const expectedEveryError = {
type: 'JSXOpeningElement',
};


const optionsComponents = [{
components: ['Label', 'Descriptor'],
}];
Expand Down
1 change: 0 additions & 1 deletion __tests__/src/rules/no-onchange-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
* @author Ethan Cohen
*/


// -----------------------------------------------------------------------------
// Requirements
// -----------------------------------------------------------------------------
Expand Down
1 change: 0 additions & 1 deletion __tests__/src/rules/role-has-required-aria-props-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ const errorMessage = (role) => {
};
};


// Create basic test cases using all valid role types.
const basicValidityTests = [...roles.keys()].map((role) => {
const {
Expand Down
10 changes: 2 additions & 8 deletions __tests__/src/rules/role-supports-aria-props-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ ruleTester.run('role-supports-aria-props', rule, {
// when `type="checkbox"`, the implicit role is `checkbox`
{ code: '<input type="checkbox" aria-atomic />' },
{ code: '<input type="checkbox" aria-busy />' },
{ code: '<input type="checkbox" aria-checked />' },
{ code: '<input type="checkbox" aria-controls />' },
{ code: '<input type="checkbox" aria-describedby />' },
{ code: '<input type="checkbox" aria-disabled />' },
Expand All @@ -313,6 +314,7 @@ ruleTester.run('role-supports-aria-props', rule, {
// when `type="radio"`, the implicit role is `radio`
{ code: '<input type="radio" aria-atomic />' },
{ code: '<input type="radio" aria-busy />' },
{ code: '<input type="radio" aria-checked />' },
{ code: '<input type="radio" aria-controls />' },
{ code: '<input type="radio" aria-describedby />' },
{ code: '<input type="radio" aria-disabled />' },
Expand Down Expand Up @@ -476,10 +478,6 @@ ruleTester.run('role-supports-aria-props', rule, {
code: '<input type="radio" aria-selected />',
errors: [errorMessage('aria-selected', 'radio', 'input', true)],
},
{
code: '<input type="radio" aria-checked />',
errors: [errorMessage('aria-checked', 'radio', 'input', true)],
},
{
code: '<input type="radio" aria-haspopup />',
errors: [errorMessage('aria-haspopup', 'radio', 'input', true)],
Expand All @@ -488,10 +486,6 @@ ruleTester.run('role-supports-aria-props', rule, {
code: '<input type="checkbox" aria-haspopup />',
errors: [errorMessage('aria-haspopup', 'checkbox', 'input', true)],
},
{
code: '<input type="checkbox" aria-checked />',
errors: [errorMessage('aria-checked', 'checkbox', 'input', true)],
},
{
code: '<input type="reset" aria-invalid />',
errors: [errorMessage('aria-invalid', 'button', 'input', true)],
Expand Down
1 change: 0 additions & 1 deletion __tests__/src/util/hasAccessibleChild-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ describe('hasAccessibleChild', () => {
});
});


describe('has no children and sets dangerouslySetInnerHTML', () => {
it('Returns true', () => {
const prop = JSXAttributeMock('dangerouslySetInnerHTML', true);
Expand Down
1 change: 0 additions & 1 deletion src/rules/alt-text.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ module.exports = {
return type;
}));


return {
JSXOpeningElement: (node) => {
const nodeType = elementType(node);
Expand Down
1 change: 0 additions & 1 deletion src/rules/anchor-has-content.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { elementType } from 'jsx-ast-utils';
import { arraySchema, generateObjSchema } from '../util/schemas';
import hasAccessibleChild from '../util/hasAccessibleChild';


const errorMessage = 'Anchors must have content and the content must be accessible by a screen reader.';

const schema = generateObjSchema({ components: arraySchema });
Expand Down
1 change: 0 additions & 1 deletion src/rules/no-distracting-elements.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ const errorMessage = (element) => (
`Do not use <${element}> elements as they can create visual accessibility issues and are deprecated.`
);


const DEFAULT_ELEMENTS = [
'marquee',
'blink',
Expand Down
1 change: 0 additions & 1 deletion src/rules/no-noninteractive-tabindex.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ module.exports = {
}
const role = getLiteralPropValue(getProp(node.attributes, 'role'));


if (!dom.has(type)) {
// Do not test higher level JSX components, as we do not know what
// low-level DOM element this maps to.
Expand Down

0 comments on commit 8059f51

Please sign in to comment.