diff --git a/.circleci/config.yml b/.circleci/config.yml index 758a1e8711..e78803f565 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -365,7 +365,7 @@ workflows: triggers: - schedule: # run at 00:00 UTC every day - cron: "0 0 * * *" + cron: '0 0 * * *' filters: branches: only: @@ -380,4 +380,4 @@ workflows: - dependencies_unix - test_nightly_aria_practices: requires: - - dependencies_unix \ No newline at end of file + - dependencies_unix diff --git a/.github/ISSUE_TEMPLATE/documentation.yml b/.github/ISSUE_TEMPLATE/documentation.yml index cb860c7efc..e9c04d9bce 100644 --- a/.github/ISSUE_TEMPLATE/documentation.yml +++ b/.github/ISSUE_TEMPLATE/documentation.yml @@ -22,4 +22,4 @@ body: attributes: label: Description validations: - required: true \ No newline at end of file + required: true diff --git a/.github/ISSUE_TEMPLATE/feature-request.yml b/.github/ISSUE_TEMPLATE/feature-request.yml index 378745e9af..96ee73453e 100644 --- a/.github/ISSUE_TEMPLATE/feature-request.yml +++ b/.github/ISSUE_TEMPLATE/feature-request.yml @@ -23,4 +23,4 @@ body: label: Feature Description description: What do you wish the product did? If the feature is about adding a new rule to axe-core, please follow our [rule template](https://github.com/dequelabs/axe-core/blob/develop/doc/rule-proposal.md). validations: - required: true \ No newline at end of file + required: true diff --git a/.github/ISSUE_TEMPLATE/question.yaml b/.github/ISSUE_TEMPLATE/question.yaml index 490b4a9c00..cb606735ee 100644 --- a/.github/ISSUE_TEMPLATE/question.yaml +++ b/.github/ISSUE_TEMPLATE/question.yaml @@ -22,4 +22,4 @@ body: attributes: label: Question validations: - required: true \ No newline at end of file + required: true diff --git a/.github/axe-linter.yml b/.github/axe-linter.yml index e836e00a7c..5a8227c858 100644 --- a/.github/axe-linter.yml +++ b/.github/axe-linter.yml @@ -1,3 +1,3 @@ exclude: - CHANGELOG.md - - test/**/* \ No newline at end of file + - test/**/* diff --git a/.github/review.yml b/.github/review.yml index 7744567480..380d589742 100644 --- a/.github/review.yml +++ b/.github/review.yml @@ -8,7 +8,7 @@ pending_description: Pull request not yet approved for security and a correct PR pending_summary: > Awaiting security and PR title review. To approve this pull request, please click the "Approve" button above. You may **not** review your own Pull Request. - + approved_description: Pull request has been reviewed and approved for security and a correct PR title approved_summary: Pull request has been approved for security and having an incorrect PR title by @${approver}. diff --git a/.github/workflows/label-extension-linter-issues.yml b/.github/workflows/label-extension-linter-issues.yml index ad1b036a0e..c0505e81f3 100644 --- a/.github/workflows/label-extension-linter-issues.yml +++ b/.github/workflows/label-extension-linter-issues.yml @@ -14,11 +14,11 @@ jobs: uses: andymckay/labeler@1.0.4 if: contains(toJson(github.event.issue.body), '### Product\n\naxe Extension\n\n') with: - add-labels: "extension" + add-labels: 'extension' repo-token: ${{ secrets.GITHUB_TOKEN }} - name: Label Linting Issues uses: andymckay/labeler@1.0.4 if: contains(toJson(github.event.issue.body), '### Product\n\naxe Linter\n\n') with: - add-labels: "linting" - repo-token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + add-labels: 'linting' + repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/sync-master-develop.yml b/.github/workflows/sync-master-develop.yml index de45285874..52116c2c9e 100644 --- a/.github/workflows/sync-master-develop.yml +++ b/.github/workflows/sync-master-develop.yml @@ -10,5 +10,5 @@ jobs: - uses: dequelabs/action-sync-branches@v1 with: github-token: ${{ secrets.GITHUB_TOKEN }} - pr-title: "chore: merge master into develop" + pr-title: 'chore: merge master into develop' pr-reviewers: straker,WilcoFiers,stephenmathieson diff --git a/.github/workflows/update-generated-files.yaml b/.github/workflows/update-generated-files.yaml index 9933aadf8a..c2d4c3ed06 100644 --- a/.github/workflows/update-generated-files.yaml +++ b/.github/workflows/update-generated-files.yaml @@ -65,4 +65,4 @@ jobs: git commit -m "chore: sync generated files" git push origin $BRANCH_NAME env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/axe-linter.yml b/axe-linter.yml index 5026b68fcd..fbc59ba001 100644 --- a/axe-linter.yml +++ b/axe-linter.yml @@ -1,3 +1,2 @@ # See: https://marketplace.visualstudio.com/items?itemName=deque-systems.vscode-axe-linter&ssr=false#overview -exclude: - test/**/* +exclude: test/**/* diff --git a/build/build-manual.js b/build/build-manual.js index 4d68174672..d86ee1d3cf 100644 --- a/build/build-manual.js +++ b/build/build-manual.js @@ -11,10 +11,10 @@ module.exports = function build(grunt, options, commons, callback) { function parseObject(src) { var files = grunt.file.expand(src); - return files.map(function(file) { + return files.map(function (file) { var json = grunt.file.readJSON(file); var dirname = path.dirname(file); - Object.keys(templates).forEach(function(templateName) { + Object.keys(templates).forEach(function (templateName) { if (json[templateName] && json[templateName].endsWith('.js')) { json[templateName] = path.resolve(dirname, json[templateName]); if (options.getFiles) { diff --git a/build/cherry-pick.js b/build/cherry-pick.js index 4043a78638..0ed8a80af1 100644 --- a/build/cherry-pick.js +++ b/build/cherry-pick.js @@ -29,9 +29,7 @@ if (ignoreCommits) { } // don't run on master or develop branch -const currentBranch = execSync('git branch --show-current') - .toString() - .trim(); +const currentBranch = execSync('git branch --show-current').toString().trim(); if (['develop', 'master'].includes(currentBranch)) { console.error( `Please run the script on a release branch and not the ${currentBranch} branch` @@ -60,20 +58,15 @@ function getCommits(branch) { const hash = commit.substring(0, 8); const msg = commit.substring(commit.indexOf('\n\n')).trim(); - const { - type, - scope, - subject, - merge, - notes - } = conventionalCommitsParser.sync(msg, { - // parse merge commits - mergePattern: /^Merge pull request #(\d+) from (.*)$/, - mergeCorrespondence: ['id', 'source'], - - // allow comma in scope - headerPattern: /^(\w*)(?:\(([\w\$\.\-\*, ]*)\))?\: (.*)$/ - }); + const { type, scope, subject, merge, notes } = + conventionalCommitsParser.sync(msg, { + // parse merge commits + mergePattern: /^Merge pull request #(\d+) from (.*)$/, + mergeCorrespondence: ['id', 'source'], + + // allow comma in scope + headerPattern: /^(\w*)(?:\(([\w\$\.\-\*, ]*)\))?\: (.*)$/ + }); const isBreakingChange = notes.some( note => note.title === 'BREAKING CHANGE' diff --git a/build/rule-generator/get-answers.js b/build/rule-generator/get-answers.js index 7aafa5f32d..1850071a8e 100644 --- a/build/rule-generator/get-answers.js +++ b/build/rule-generator/get-answers.js @@ -41,13 +41,11 @@ const getAnswers = async () => { } // answers if TEST files to be created - const { - getIsUnitTestAssets, - getIsIntegrationTestAssets - } = await inquirer.prompt([ - questions.getIsUnitTestAssets, - questions.getIsIntegrationTestAssets - ]); + const { getIsUnitTestAssets, getIsIntegrationTestAssets } = + await inquirer.prompt([ + questions.getIsUnitTestAssets, + questions.getIsIntegrationTestAssets + ]); return { ruleName: getRuleName.toLowerCase(), diff --git a/build/rule-generator/questions.js b/build/rule-generator/questions.js index 4b0f15fc6e..35d5fcfaba 100644 --- a/build/rule-generator/questions.js +++ b/build/rule-generator/questions.js @@ -69,11 +69,7 @@ const validateGetCheckName = async input => { }); // cannot use `fs.existsSync` here, as we do not know which category of checks to look under const axeChecksFileNames = checkSpecs.map( - f => - f - .replace('.json', '') - .split('/') - .reverse()[0] + f => f.replace('.json', '').split('/').reverse()[0] ); if (axeChecksFileNames.includes(checkName)) { throw new Error('CHECK name conflicts with an existing filename.'); diff --git a/build/tasks/add-locale.js b/build/tasks/add-locale.js index a91d287b2b..f3845d5a19 100644 --- a/build/tasks/add-locale.js +++ b/build/tasks/add-locale.js @@ -3,9 +3,9 @@ var clone = require('clone'); var buildManual = require('../build-manual'); -module.exports = function(grunt) { +module.exports = function (grunt) { function mergeMessages(newMessages, oldMessages) { - Object.keys(newMessages).forEach(function(key) { + Object.keys(newMessages).forEach(function (key) { if (!oldMessages.hasOwnProperty(key)) { return; } @@ -31,7 +31,7 @@ module.exports = function(grunt) { grunt.registerMultiTask( 'add-locale', 'Task for localizing messages in rules and checks', - function() { + function () { var options = this.options({ rules: ['lib/rules/**/*.json'], checks: ['lib/checks/**/*.json'], @@ -41,27 +41,27 @@ module.exports = function(grunt) { lang: 'xxx' }); - this.files.forEach(function(file) { + this.files.forEach(function (file) { var commons = file.src[0]; - buildManual(grunt, options, commons, function(result) { + buildManual(grunt, options, commons, function (result) { var out = { lang: options.lang, - rules: result.rules.reduce(function(out, rule) { + rules: result.rules.reduce(function (out, rule) { out[rule.id] = rule.metadata; return out; }, {}), - checks: result.checks.reduce(function(out, check) { + checks: result.checks.reduce(function (out, check) { if (check.metadata) { out[check.id] = check.metadata.messages; } return out; }, {}), - failureSummaries: result.misc.reduce(function(out, misc) { + failureSummaries: result.misc.reduce(function (out, misc) { out[misc.type] = misc.metadata; return out; }, {}), - incompleteFallbackMessage: result.misc.reduce(function(out, misc) { + incompleteFallbackMessage: result.misc.reduce(function (out, misc) { return misc.incompleteFallbackMessage ? misc.incompleteFallbackMessage : out; diff --git a/build/tasks/aria-supported.js b/build/tasks/aria-supported.js index cccf92ebbf..5f76ca2b16 100644 --- a/build/tasks/aria-supported.js +++ b/build/tasks/aria-supported.js @@ -5,11 +5,11 @@ const { roles, aria: props } = require('aria-query'); const mdTable = require('markdown-table'); const format = require('../shared/format'); -module.exports = function(grunt) { +module.exports = function (grunt) { grunt.registerMultiTask( 'aria-supported', 'Task for generating a diff of supported aria roles and properties.', - function() { + function () { /** * NOTE: * `axe` has to be dynamically required at this stage, diff --git a/build/tasks/configure.js b/build/tasks/configure.js index c8f2f8db7b..86599e9951 100644 --- a/build/tasks/configure.js +++ b/build/tasks/configure.js @@ -3,11 +3,11 @@ var buildRules = require('../configure'); var format = require('../shared/format'); -module.exports = function(grunt) { +module.exports = function (grunt) { grunt.registerMultiTask( 'configure', 'Task for configuring rules and checks', - function() { + function () { var done = this.async(); var options = this.options({ rules: ['lib/rules/**/*.json'], @@ -17,13 +17,13 @@ module.exports = function(grunt) { tags: '' }); - this.files.forEach(function(file) { + this.files.forEach(function (file) { var match = file.dest.auto.match(/\.([a-z]{2,3})\.js/); if (match) { options.locale = match[1]; } - buildRules(grunt, options, null, function(result) { + buildRules(grunt, options, null, function (result) { grunt.file.write(file.dest.auto, 'axe._load(' + result.auto + ');'); // Format the content so Prettier doesn't create a diff after running. diff --git a/build/tasks/esbuild.js b/build/tasks/esbuild.js index 563979a631..6a5479dff9 100644 --- a/build/tasks/esbuild.js +++ b/build/tasks/esbuild.js @@ -1,11 +1,11 @@ const { build } = require('esbuild'); const path = require('path'); -module.exports = function(grunt) { +module.exports = function (grunt) { grunt.registerMultiTask( 'esbuild', 'Task to run the esbuild javascript bundler', - function() { + function () { const done = this.async(); const files = grunt.task.current.data.files; diff --git a/build/tasks/langs.js b/build/tasks/langs.js index 3e88e5c02b..4e512b3045 100644 --- a/build/tasks/langs.js +++ b/build/tasks/langs.js @@ -1,7 +1,7 @@ /*eslint-env node */ 'use strict'; var http = require('http'); -module.exports = function(grunt) { +module.exports = function (grunt) { function getLine(data, start) { var len = data.length; var index = start; @@ -56,7 +56,7 @@ module.exports = function(grunt) { grunt.registerMultiTask( 'langs', 'Task for generating commons language codes from IANA registry', - function() { + function () { var done = this.async(); var ianaLangsURL = 'http://www.iana.org/assignments/language-subtag-registry/language-subtag-registry'; @@ -66,24 +66,24 @@ module.exports = function(grunt) { } var check = this.data.check; var langs = []; - new Promise(function(resolve, reject) { + new Promise(function (resolve, reject) { var data = ''; http - .get(ianaLangsURL, function(res) { + .get(ianaLangsURL, function (res) { res - .on('data', function(chunk) { + .on('data', function (chunk) { data += chunk; }) - .on('end', function() { + .on('end', function () { resolve(data); }); }) - .on('error', function(e) { + .on('error', function (e) { grunt.log.error('Got error: ' + e.message); reject(false); }); }) - .then(function(data) { + .then(function (data) { var entry = getEntry(data, 0); var pos = entry.used; while (true) { @@ -100,10 +100,10 @@ module.exports = function(grunt) { } generateOutput(langs, check); }) - .then(function() { + .then(function () { done(); }) - .catch(function(result) { + .catch(function (result) { done(result); }); } diff --git a/build/tasks/metadata-function-map.js b/build/tasks/metadata-function-map.js index e387bbe232..e2e9d6054c 100644 --- a/build/tasks/metadata-function-map.js +++ b/build/tasks/metadata-function-map.js @@ -8,11 +8,11 @@ function toTitleCase(str) { }); } -module.exports = function(grunt) { +module.exports = function (grunt) { grunt.registerMultiTask( 'metadata-function-map', 'Task to generate the metadata-function-map file', - function() { + function () { const files = grunt.task.current.data.files; files.forEach(file => { diff --git a/build/tasks/notify.js b/build/tasks/notify.js index 00c2336624..5034667eb1 100644 --- a/build/tasks/notify.js +++ b/build/tasks/notify.js @@ -3,11 +3,11 @@ const { notify } = require('node-notifier'); /*eslint-env node */ ('use strict'); -module.exports = function(grunt) { +module.exports = function (grunt) { grunt.registerMultiTask( 'notify', 'This task sends an OS notification when a task has completed', - function() { + function () { notify(this.data); } ); diff --git a/build/tasks/test.js b/build/tasks/test.js index acf92b9940..c1f51a7b44 100644 --- a/build/tasks/test.js +++ b/build/tasks/test.js @@ -4,11 +4,11 @@ const chalk = require('chalk'); /*eslint-env node */ ('use strict'); -module.exports = function(grunt) { +module.exports = function (grunt) { grunt.registerMultiTask( 'test', 'This task runs unit tests based on which file was changed', - function() { + function () { const testFile = this.data.testFile; console.log(`${chalk.green('>>')} File "${testFile}"`); diff --git a/build/tasks/update-help.js b/build/tasks/update-help.js index 6a81f76a2b..417a94048c 100644 --- a/build/tasks/update-help.js +++ b/build/tasks/update-help.js @@ -1,11 +1,11 @@ /*eslint-env node */ 'use strict'; -module.exports = function(grunt) { +module.exports = function (grunt) { grunt.registerMultiTask( 'update-help', 'Task for updating Deque University helpUrls based on rule JSON files', - function() { + function () { var options = this.options({ version: '1.0.0' }); @@ -13,8 +13,8 @@ module.exports = function(grunt) { v.pop(); var baseUrl = 'https://dequeuniversity.com/rules/axe/' + v.join('.') + '/'; - this.files.forEach(function(f) { - f.src.forEach(function(filepath) { + this.files.forEach(function (f) { + f.src.forEach(function (filepath) { var config = grunt.file.readJSON(filepath); config.metadata.helpUrl = baseUrl + config.id; grunt.file.write(filepath, JSON.stringify(config, null, ' ')); diff --git a/build/tasks/validate.js b/build/tasks/validate.js index 542799a40b..c36dfddb53 100644 --- a/build/tasks/validate.js +++ b/build/tasks/validate.js @@ -22,7 +22,7 @@ function fileExists(v, o) { function hasUniqueId() { var seen = {}; - return function(v, o) { + return function (v, o) { if (!seen[v]) { seen[v] = o; return true; @@ -150,7 +150,7 @@ function createSchemas() { type: 'array', items: { type: ['string', 'object'], - conform: function(v) { + conform: function (v) { if (typeof v === 'string') { return true; } @@ -166,7 +166,7 @@ function createSchemas() { type: 'array', items: { type: ['string', 'object'], - conform: function(v) { + conform: function (v) { if (typeof v === 'string') { return true; } @@ -182,7 +182,7 @@ function createSchemas() { type: 'array', items: { type: ['string', 'object'], - conform: function(v) { + conform: function (v) { if (typeof v === 'string') { return true; } @@ -243,13 +243,13 @@ function createSchemas() { function validateFiles(grunt, files, schema, type) { var valid = true; - files.forEach(function(f) { - f.src.forEach(function(pathArg) { + files.forEach(function (f) { + f.src.forEach(function (pathArg) { var file = grunt.file.readJSON(pathArg); file._path = pathArg; var result = revalidator(file, schema); if (!result.valid) { - result.errors.forEach(function(err) { + result.errors.forEach(function (err) { grunt.log.error(pathArg, err.property + ' ' + err.message); }); valid = false; @@ -269,11 +269,11 @@ function validateFiles(grunt, files, schema, type) { return valid; } -module.exports = function(grunt) { +module.exports = function (grunt) { grunt.registerMultiTask( 'validate', 'Task for validating API schema for checks and rules', - function() { + function () { const { type } = this.options(); const schemas = createSchemas(); const schema = schemas[type]; diff --git a/doc/API.md b/doc/API.md index 7745f0254d..b6c92977fd 100644 --- a/doc/API.md +++ b/doc/API.md @@ -735,7 +735,7 @@ Each object returned in these arrays have the following properties: In this example, we will pass the selector for the entire document, pass no options, which means all enabled rules will be run, and have a simple callback function that logs the entire results object to the console log: ```js -axe.run(document, function(err, results) { +axe.run(document, function (err, results) { if (err) throw err; console.log(results); }); @@ -799,7 +799,7 @@ axe.run( 'p-as-heading': { enabled: true } } }, - function(err, results) { + function (err, results) { if (err) throw err; console.log(results); } diff --git a/doc/developer-guide.md b/doc/developer-guide.md index 2e88cce57f..1bbd83e4c3 100644 --- a/doc/developer-guide.md +++ b/doc/developer-guide.md @@ -50,7 +50,7 @@ Changes to files in the [full integration test directory](../test/integration/fu To run all tests from the command line you can run `npm test`, which will run all unit and integration tests using headless Chrome. Having axe built and up-to-date is required in order to run tests. If you update files inside the [lib directory](../lib) you will need to rebuild axe before running tests. -You can scope which set of tests to run through various npm scripts: +You can scope which set of tests to run through various npm scripts: - `npm run test:unit:core` - Run only [core tests](../test/core/) - `npm run test:unit:commons` - Run only [commons tests](../test/commons/) @@ -71,7 +71,7 @@ There are also a set of tests that are not considered unit tests that you can ru Additionally, you can [watch for changes](#watching-for-changes) to files and automatically run the relevant tests. -If you need to debug a test in a non-headless browser, you can run `npm run test:debug` which will run the Karma tests in non-headless Chrome. You can also navigate to the newly opened page using any supported browser. +If you need to debug a test in a non-headless browser, you can run `npm run test:debug` which will run the Karma tests in non-headless Chrome. You can also navigate to the newly opened page using any supported browser. You can scope which set of tests to debug by passing the `testDirs` argument. Supported values are: @@ -187,7 +187,7 @@ The after function must return an `Array` of CheckResults, due to this, it is a ```js var uniqueIds = []; -return results.filter(function(r) { +return results.filter(function (r) { if (uniqueIds.indexOf(r.data) === -1) { uniqueIds.push(r.data); return true; @@ -409,17 +409,17 @@ Create a check context for mocking and resetting data and relatedNodes in tests. #### Synopsis ```js -describe('region', function() { +describe('region', function () { var fixture = document.getElementById('fixture'); var checkContext = new axe.testUtils.MockCheckContext(); - afterEach(function() { + afterEach(function () { fixture.innerHTML = ''; checkContext.reset(); }); - it('should return true when all content is inside the region', function() { + it('should return true when all content is inside the region', function () { assert.isTrue(checks.region.evaluate.apply(checkContext, checkArgs)); assert.equal(checkContext._relatedNodes.length, 0); }); @@ -451,7 +451,7 @@ Provides an API for determining Shadow DOM v0 and v1 support in tests. For examp ```js (axe.testUtils.shadowSupport.v1 ? it : xit)( 'should test Shadow tree content', - function() { + function () { // The rest of the shadow DOM test } ); @@ -476,7 +476,7 @@ it( 'should return true if there is only one ' + type + ' element with the same name', - function() { + function () { axe.testUtils.fixtureSetup( '
Click Here

Introduction

' ); diff --git a/doc/examples/html-handlebars.md b/doc/examples/html-handlebars.md index 8b20ee2385..eff2ef61bf 100644 --- a/doc/examples/html-handlebars.md +++ b/doc/examples/html-handlebars.md @@ -16,13 +16,13 @@ function helperItemIterator(items, template) { } return out; } -Handlebars.registerHelper('violations', function(items) { +Handlebars.registerHelper('violations', function (items) { return helperItemIterator(items, compiledRowTemplate); }); -Handlebars.registerHelper('related', function(items) { +Handlebars.registerHelper('related', function (items) { return helperItemIterator(items, compiledRelatedNodeTemplate); }); -Handlebars.registerHelper('reasons', function(items) { +Handlebars.registerHelper('reasons', function (items) { return helperItemIterator(items, compiledFailureTemplate); }); @@ -38,7 +38,7 @@ compiledReasonsTemplate = Handlebars.compile(reasonsTemplate.innerHTML); function messageFromRelatedNodes(relatedNodes) { var retVal = ''; if (relatedNodes.length) { - var list = relatedNodes.map(function(node) { + var list = relatedNodes.map(function (node) { return { targetArrayString: JSON.stringify(node.target), targetString: node.target.join(' ') @@ -50,7 +50,7 @@ function messageFromRelatedNodes(relatedNodes) { } function messagesFromArray(nodes) { - var list = nodes.map(function(failure) { + var list = nodes.map(function (failure) { return { message: failure.message.replace(//gi, '>'), relatedNodesMessage: messageFromRelatedNodes(failure.relatedNodes) @@ -83,7 +83,7 @@ function summary(node) { */ if (results.violations.length) { - var violations = results.violations.map(function(rule, i) { + var violations = results.violations.map(function (rule, i) { return { impact: rule.impact, help: rule.help.replace(//gi, '>'), @@ -107,58 +107,42 @@ reasonHtml = summary(node); ## The Handlebars Templates ```handlebars - - - - - - ``` diff --git a/doc/examples/jasmine/karma.conf.js b/doc/examples/jasmine/karma.conf.js index 01b9be3c5e..b07fc5c91c 100644 --- a/doc/examples/jasmine/karma.conf.js +++ b/doc/examples/jasmine/karma.conf.js @@ -1,4 +1,4 @@ -module.exports = function(config) { +module.exports = function (config) { config.set({ basePath: '', diff --git a/doc/examples/jasmine/spec/a11y.js b/doc/examples/jasmine/spec/a11y.js index b00cd94224..1c32b9fc40 100644 --- a/doc/examples/jasmine/spec/a11y.js +++ b/doc/examples/jasmine/spec/a11y.js @@ -1,6 +1,6 @@ /* global describe, it, expect, axe, document */ -describe('axe', function() { +describe('axe', function () { 'use strict'; document @@ -16,18 +16,18 @@ describe('axe', function() { '' ); - it('should report that good HTML is good', function(done) { + it('should report that good HTML is good', function (done) { var n = document.getElementById('working'); - axe.run(n, function(err, result) { + axe.run(n, function (err, result) { expect(err).toBe(null); expect(result.violations.length).toBe(0); done(); }); }); - it('should report that bad HTML is bad', function(done) { + it('should report that bad HTML is bad', function (done) { var n = document.getElementById('broken'); - axe.run(n, function(err, result) { + axe.run(n, function (err, result) { expect(err).toBe(null); expect(result.violations.length).toBe(1); done(); diff --git a/doc/examples/jest_react/.babelrc b/doc/examples/jest_react/.babelrc index 18151f1f8f..2b7bafa5fa 100644 --- a/doc/examples/jest_react/.babelrc +++ b/doc/examples/jest_react/.babelrc @@ -1,3 +1,3 @@ { "presets": ["@babel/preset-env", "@babel/preset-react"] -} \ No newline at end of file +} diff --git a/doc/examples/jsdom/test/a11y.js b/doc/examples/jsdom/test/a11y.js index 8fa945d89d..bd946cef0c 100644 --- a/doc/examples/jsdom/test/a11y.js +++ b/doc/examples/jsdom/test/a11y.js @@ -27,18 +27,18 @@ describe('axe', () => { } }; - it('should report that good HTML is good', function(done) { + it('should report that good HTML is good', function (done) { var n = window.document.getElementById('working'); - axe.run(n, config, function(err, result) { + axe.run(n, config, function (err, result) { assert.equal(err, null, 'Error is not null'); assert.equal(result.violations.length, 0, 'Violations is not empty'); done(); }); }); - it('should report that bad HTML is bad', function(done) { + it('should report that bad HTML is bad', function (done) { var n = window.document.getElementById('broken'); - axe.run(n, config, function(err, result) { + axe.run(n, config, function (err, result) { assert.equal(err, null, 'Error is not null'); assert.equal(result.violations.length, 1, 'Violations.length is not 1'); done(); diff --git a/doc/examples/mocha/karma.conf.js b/doc/examples/mocha/karma.conf.js index 6ff71908e7..a376057757 100644 --- a/doc/examples/mocha/karma.conf.js +++ b/doc/examples/mocha/karma.conf.js @@ -1,4 +1,4 @@ -module.exports = function(config) { +module.exports = function (config) { config.set({ basePath: '', diff --git a/doc/examples/mocha/test/a11y.js b/doc/examples/mocha/test/a11y.js index 9ba51e377a..d3d1e1f162 100644 --- a/doc/examples/mocha/test/a11y.js +++ b/doc/examples/mocha/test/a11y.js @@ -1,6 +1,6 @@ /* global describe, it, expect, axe, document, expect */ -describe('axe', function() { +describe('axe', function () { 'use strict'; document @@ -16,18 +16,18 @@ describe('axe', function() { '' ); - it('should report that good HTML is good', function(done) { + it('should report that good HTML is good', function (done) { var n = document.getElementById('working'); - axe.run(n, function(err, result) { + axe.run(n, function (err, result) { expect(err).to.be.null; expect(result.violations.length).to.equal(0); done(); }); }); - it('should report that bad HTML is bad', function(done) { + it('should report that bad HTML is bad', function (done) { var n = document.getElementById('broken'); - axe.run(n, function(err, result) { + axe.run(n, function (err, result) { expect(err).to.be.null; expect(result.violations.length).to.equal(1); done(); diff --git a/doc/examples/qunit/Gruntfile.js b/doc/examples/qunit/Gruntfile.js index 9cd8292635..c70bbe6ef8 100644 --- a/doc/examples/qunit/Gruntfile.js +++ b/doc/examples/qunit/Gruntfile.js @@ -1,4 +1,4 @@ -module.exports = function(grunt) { +module.exports = function (grunt) { 'use strict'; grunt.loadNpmTasks('grunt-contrib-qunit'); diff --git a/doc/examples/qunit/test/a11y.js b/doc/examples/qunit/test/a11y.js index 62b4f6c4be..8260a8309c 100644 --- a/doc/examples/qunit/test/a11y.js +++ b/doc/examples/qunit/test/a11y.js @@ -2,24 +2,24 @@ QUnit.module('axe'); -QUnit.test('should report that good HTML is good', function(assert) { +QUnit.test('should report that good HTML is good', function (assert) { var n = document.getElementById('working'); assert.expect(2); var done = assert.async(); - axe.run(n, function(err, result) { + axe.run(n, function (err, result) { assert.equal(err, null); assert.equal(result.violations.length, 0); done(); }); }); -QUnit.test('should report that bad HTML is bad', function(assert) { +QUnit.test('should report that bad HTML is bad', function (assert) { var n = document.getElementById('broken'); assert.expect(2); var done = assert.async(); - axe.run(n, function(err, result) { + axe.run(n, function (err, result) { assert.equal(err, null); assert.equal(result.violations.length, 1); done(); diff --git a/doc/plugins.md b/doc/plugins.md index 9ce4e58d08..a440d2d3fd 100644 --- a/doc/plugins.md +++ b/doc/plugins.md @@ -23,14 +23,14 @@ In order to create such a plugin, we need to implement the "run" function for th ```js axe.registerPlugin({ id: 'doStuff', - run: function(id, action, options, callback) { + run: function (id, action, options, callback) { var frames; var q = axe.utils.queue(); var that = this; frames = axe.utils.toArray(document.querySelectorAll('iframe, frame')); - frames.forEach(function(frame) { - q.defer(function(done) { + frames.forEach(function (frame) { + q.defer(function (done) { axe.utils.sendCommandToFrame( frame, { @@ -39,7 +39,7 @@ axe.registerPlugin({ parameter: id, action: action }, - function() { + function () { done(); } ); @@ -47,7 +47,7 @@ axe.registerPlugin({ }); if (!options.context.length) { - q.defer(function(done) { + q.defer(function (done) { that._registry[id][action].call( that._registry[id], document, @@ -61,7 +61,7 @@ axe.registerPlugin({ commands: [ { id: 'run-doStuff', - callback: function(data, callback) { + callback: function (data, callback) { return axe.plugins.doStuff.run( data.parameter, data.action, @@ -100,16 +100,16 @@ Lets implement a basic plugin instance to see how this works. This instance will var highlight = { id: 'highlight', highlighter: new Highlighter(), - run: function(contextNode, options, done) { + run: function (contextNode, options, done) { var that = this; Array.prototype.slice .call(contextNode.querySelectorAll(options.selector)) - .forEach(function(node) { + .forEach(function (node) { that.highlighter.highlight(node, options); }); done(); }, - cleanup: function(done) { + cleanup: function (done) { this.highlighter.clear(); done(); } diff --git a/lib/checks/aria/aria-prohibited-attr-evaluate.js b/lib/checks/aria/aria-prohibited-attr-evaluate.js index c4e7085761..e6e2f9da7d 100644 --- a/lib/checks/aria/aria-prohibited-attr-evaluate.js +++ b/lib/checks/aria/aria-prohibited-attr-evaluate.js @@ -26,12 +26,20 @@ import standards from '../../standards'; * @memberof checks * @return {Boolean} True if the element uses any prohibited ARIA attributes. False otherwise. */ -export default function ariaProhibitedAttrEvaluate(node, options = {}, virtualNode) { +export default function ariaProhibitedAttrEvaluate( + node, + options = {}, + virtualNode +) { const elementsAllowedAriaLabel = options?.elementsAllowedAriaLabel || []; const { nodeName } = virtualNode.props; const role = getRole(virtualNode, { chromium: true }); - const prohibitedList = listProhibitedAttrs(role, nodeName, elementsAllowedAriaLabel); + const prohibitedList = listProhibitedAttrs( + role, + nodeName, + elementsAllowedAriaLabel + ); const prohibited = prohibitedList.filter(attrName => { if (!virtualNode.attrNames.includes(attrName)) { return false; diff --git a/lib/checks/aria/aria-required-children-evaluate.js b/lib/checks/aria/aria-required-children-evaluate.js index bebe639da2..3ba1c2b757 100644 --- a/lib/checks/aria/aria-required-children-evaluate.js +++ b/lib/checks/aria/aria-required-children-evaluate.js @@ -20,15 +20,14 @@ function getOwnedRoles(virtualNode, required) { const hasGlobalAria = getGlobalAriaAttrs().some(attr => ownedElement.hasAttr(attr) ); - const hasGlobalAriaOrFocusable = - hasGlobalAria || isFocusable(ownedElement); + const hasGlobalAriaOrFocusable = hasGlobalAria || isFocusable(ownedElement); // if owned node has no role or is presentational, or if role // allows group or rowgroup, we keep parsing the descendant tree. // this means intermediate roles between a required parent and // child will fail the check if ( - (!role && ! hasGlobalAriaOrFocusable) || + (!role && !hasGlobalAriaOrFocusable) || (['group', 'rowgroup'].includes(role) && required.some(requiredRole => requiredRole === role)) ) { diff --git a/lib/checks/aria/unsupportedrole-evaluate.js b/lib/checks/aria/unsupportedrole-evaluate.js index ee7ff3d71e..d8f407faaf 100644 --- a/lib/checks/aria/unsupportedrole-evaluate.js +++ b/lib/checks/aria/unsupportedrole-evaluate.js @@ -15,7 +15,6 @@ function unsupportedroleEvaluate(node, options, virtualNode) { this.data(role); } return isUnsupported; - } export default unsupportedroleEvaluate; diff --git a/lib/checks/color/color-contrast-evaluate.js b/lib/checks/color/color-contrast-evaluate.js index dae20aae4b..b4637aab52 100644 --- a/lib/checks/color/color-contrast-evaluate.js +++ b/lib/checks/color/color-contrast-evaluate.js @@ -102,8 +102,10 @@ export default function colorContrastEvaluate(node, options, virtualNode) { // ratio is outside range if ( - (typeof minThreshold === 'number' && (typeof contrast !== 'number' || contrast < minThreshold)) || - (typeof maxThreshold === 'number' && (typeof contrast !== 'number' || contrast > maxThreshold)) + (typeof minThreshold === 'number' && + (typeof contrast !== 'number' || contrast < minThreshold)) || + (typeof maxThreshold === 'number' && + (typeof contrast !== 'number' || contrast > maxThreshold)) ) { this.data({ contrastRatio: contrast }); return true; diff --git a/lib/checks/language/valid-lang-evaluate.js b/lib/checks/language/valid-lang-evaluate.js index b59970281d..e8822d9fd6 100644 --- a/lib/checks/language/valid-lang-evaluate.js +++ b/lib/checks/language/valid-lang-evaluate.js @@ -1,6 +1,6 @@ import { isValidLang, getBaseLang } from '../../core/utils'; import { sanitize } from '../../commons/text'; -import { hasLangText } from '../../commons/dom' +import { hasLangText } from '../../commons/dom'; function validLangEvaluate(node, options, virtualNode) { const invalid = []; @@ -29,7 +29,8 @@ function validLangEvaluate(node, options, virtualNode) { if (!invalid.length) { return false; } - if ( // Except for `html`, ignore elements with no text + if ( + // Except for `html`, ignore elements with no text virtualNode.props.nodeName !== 'html' && !hasLangText(virtualNode) ) { diff --git a/lib/checks/lists/listitem-evaluate.js b/lib/checks/lists/listitem-evaluate.js index b09c5414bb..dde5dcb4f4 100644 --- a/lib/checks/lists/listitem-evaluate.js +++ b/lib/checks/lists/listitem-evaluate.js @@ -1,7 +1,7 @@ import { isValidRole, getExplicitRole } from '../../commons/aria'; export default function listitemEvaluate(node, options, virtualNode) { - const { parent } = virtualNode; + const { parent } = virtualNode; if (!parent) { // Can only happen with detached DOM nodes and roots: return undefined; diff --git a/lib/checks/navigation/internal-link-present-evaluate.js b/lib/checks/navigation/internal-link-present-evaluate.js index d235bfbe2b..89fedb46fc 100644 --- a/lib/checks/navigation/internal-link-present-evaluate.js +++ b/lib/checks/navigation/internal-link-present-evaluate.js @@ -1,10 +1,10 @@ -import { querySelectorAll } from '../../core/utils'; - -function internalLinkPresentEvaluate(node, options, virtualNode) { - const links = querySelectorAll(virtualNode, 'a[href]'); - return links.some(vLink => { - return /^#[^/!]/.test(vLink.attr('href')); - }); -} - -export default internalLinkPresentEvaluate; +import { querySelectorAll } from '../../core/utils'; + +function internalLinkPresentEvaluate(node, options, virtualNode) { + const links = querySelectorAll(virtualNode, 'a[href]'); + return links.some(vLink => { + return /^#[^/!]/.test(vLink.attr('href')); + }); +} + +export default internalLinkPresentEvaluate; diff --git a/lib/commons/color/get-background-stack.js b/lib/commons/color/get-background-stack.js index 10a54dccfe..a37833eb9f 100644 --- a/lib/commons/color/get-background-stack.js +++ b/lib/commons/color/get-background-stack.js @@ -23,7 +23,7 @@ function isInlineDescendant(node, descendant) { return false; } // IE needs this; It doesn't set display:block when position is set - const position = style.getPropertyValue('position') + const position = style.getPropertyValue('position'); return position === 'static'; } diff --git a/lib/commons/color/incomplete-data.js b/lib/commons/color/incomplete-data.js index e9c6406f31..0ece568087 100644 --- a/lib/commons/color/incomplete-data.js +++ b/lib/commons/color/incomplete-data.js @@ -13,7 +13,7 @@ const incompleteData = { * @param {String} key Identifier for missing data point (fgColor, bgColor, etc.) * @param {String} reason Missing data reason to match message template */ - set: function(key, reason) { + set: function (key, reason) { if (typeof key !== 'string') { throw new Error('Incomplete data: key must be a string'); } @@ -30,7 +30,7 @@ const incompleteData = { * @param {String} key Identifier for missing data point (fgColor, bgColor, etc.) * @return {String} String for reason we couldn't tell */ - get: function(key) { + get: function (key) { return data[key]; }, /** @@ -39,7 +39,7 @@ const incompleteData = { * @memberof axe.commons.color.incompleteData * @instance */ - clear: function() { + clear: function () { data = {}; } }; diff --git a/lib/commons/dom/has-content-virtual.js b/lib/commons/dom/has-content-virtual.js index 9d28a05802..ae71c1f7d0 100644 --- a/lib/commons/dom/has-content-virtual.js +++ b/lib/commons/dom/has-content-virtual.js @@ -16,16 +16,16 @@ const hiddenTextElms = [ /** * Test if the element has child nodes that are non-empty text nodes - * @param {VirtualNode} elm + * @param {VirtualNode} elm * @returns boolean */ export function hasChildTextNodes(elm) { if (hiddenTextElms.includes(elm.props.nodeName)) { - return false + return false; } return elm.children.some(({ props }) => { - return props.nodeType === 3 && props.nodeValue.trim() - }) + return props.nodeType === 3 && props.nodeValue.trim(); + }); } /** diff --git a/lib/core/base/virtual-node/virtual-node.js b/lib/core/base/virtual-node/virtual-node.js index 4235b23c20..0c5e2d2a92 100644 --- a/lib/core/base/virtual-node/virtual-node.js +++ b/lib/core/base/virtual-node/virtual-node.js @@ -56,15 +56,8 @@ class VirtualNode extends AbstractVirtualNode { // add to the prototype so memory is shared across all virtual nodes get props() { if (!this._cache.hasOwnProperty('props')) { - const { - nodeType, - nodeName, - id, - multiple, - nodeValue, - value, - selected - } = this.actualNode; + const { nodeType, nodeName, id, multiple, nodeValue, value, selected } = + this.actualNode; this._cache.props = { nodeType, diff --git a/lib/core/public/finish-run.js b/lib/core/public/finish-run.js index 63228d0bb6..bc3a194f1c 100644 --- a/lib/core/public/finish-run.js +++ b/lib/core/public/finish-run.js @@ -9,7 +9,7 @@ import { export default function finishRun(partialResults, options = {}) { options = clone(options); - const { environmentData } = partialResults.find(r => r.environmentData) || {} + const { environmentData } = partialResults.find(r => r.environmentData) || {}; // normalize the runOnly option for the output of reporters toolOptions axe._audit.normalizeOptions(options); diff --git a/lib/core/public/run-partial.js b/lib/core/public/run-partial.js index b39f832e69..5ded49a5a6 100644 --- a/lib/core/public/run-partial.js +++ b/lib/core/public/run-partial.js @@ -1,6 +1,11 @@ import Context from '../base/context'; import teardown from './teardown'; -import { DqElement, getSelectorData, assert, getEnvironmentData } from '../utils'; +import { + DqElement, + getSelectorData, + assert, + getEnvironmentData +} from '../utils'; import normalizeRunParams from './run/normalize-run-params'; export default function runPartial(...args) { @@ -17,31 +22,33 @@ export default function runPartial(...args) { axe._selectorData = getSelectorData(contextObj.flatTree); axe._running = true; - return new Promise((res, rej) => { - axe._audit.run(contextObj, options, res, rej); - }) - .then(results => { - results = results.map(({ nodes, ...result }) => ({ - nodes: nodes.map(serializeNode), - ...result - })); - const frames = contextObj.frames.map(({ node }) => { - return new DqElement(node, options).toJSON(); - }); - let environmentData; - if (contextObj.initiator) { - environmentData = getEnvironmentData(); - } - axe._running = false; - teardown(); - return { results, frames, environmentData }; + return ( + new Promise((res, rej) => { + axe._audit.run(contextObj, options, res, rej); }) - // Avoid .finally() to deal with Mocha 9 + IE issues - .catch((err) => { - axe._running = false; - teardown(); - return Promise.reject(err); - }); + .then(results => { + results = results.map(({ nodes, ...result }) => ({ + nodes: nodes.map(serializeNode), + ...result + })); + const frames = contextObj.frames.map(({ node }) => { + return new DqElement(node, options).toJSON(); + }); + let environmentData; + if (contextObj.initiator) { + environmentData = getEnvironmentData(); + } + axe._running = false; + teardown(); + return { results, frames, environmentData }; + }) + // Avoid .finally() to deal with Mocha 9 + IE issues + .catch(err => { + axe._running = false; + teardown(); + return Promise.reject(err); + }) + ); } function serializeNode({ node, ...nodeResult }) { diff --git a/lib/core/public/run/globals-setup.js b/lib/core/public/run/globals-setup.js index 3e8311484d..3bd442d8e4 100644 --- a/lib/core/public/run/globals-setup.js +++ b/lib/core/public/run/globals-setup.js @@ -21,7 +21,7 @@ export function setupGlobals(context) { cache.set('globalDocumentSet', true); document = context.ownerDocument; } - + if (!hasWindow) { cache.set('globalWindowSet', true); window = document.defaultView; diff --git a/lib/core/reporters/helpers/incomplete-fallback-msg.js b/lib/core/reporters/helpers/incomplete-fallback-msg.js index 53d1d96553..7a14e025a6 100644 --- a/lib/core/reporters/helpers/incomplete-fallback-msg.js +++ b/lib/core/reporters/helpers/incomplete-fallback-msg.js @@ -3,7 +3,7 @@ * This mechanism allows the string to be localized. * @return {String} */ - export default function incompleteFallbackMessage() { +export default function incompleteFallbackMessage() { let { incompleteFallbackMessage } = axe._audit.data; if (typeof incompleteFallbackMessage === 'function') { incompleteFallbackMessage = incompleteFallbackMessage(); diff --git a/lib/core/reporters/raw-env.js b/lib/core/reporters/raw-env.js index cda4904b37..199effb5a2 100644 --- a/lib/core/reporters/raw-env.js +++ b/lib/core/reporters/raw-env.js @@ -7,7 +7,7 @@ const rawEnvReporter = (results, options, callback) => { options = {}; } const { environmentData, ...toolOptions } = options; - rawReporter(results, toolOptions, (raw) => { + rawReporter(results, toolOptions, raw => { const env = getEnvironmentData(environmentData); callback({ raw, env }); }); diff --git a/lib/core/reporters/v1.js b/lib/core/reporters/v1.js index d83f6d3b72..10d939cc2f 100644 --- a/lib/core/reporters/v1.js +++ b/lib/core/reporters/v1.js @@ -1,11 +1,11 @@ import { processAggregate, failureSummary } from './helpers'; -import { getEnvironmentData } from '../utils' +import { getEnvironmentData } from '../utils'; const v1Reporter = (results, options, callback) => { if (typeof options === 'function') { callback = options; options = {}; - }; + } const { environmentData, ...toolOptions } = options; const out = processAggregate(results, options); diff --git a/lib/core/utils/clone.js b/lib/core/utils/clone.js index a880f192e3..45d0b17e03 100644 --- a/lib/core/utils/clone.js +++ b/lib/core/utils/clone.js @@ -10,7 +10,7 @@ function clone(obj) { out = obj; // DOM nodes cannot be cloned. if ( - (window?.Node && obj instanceof window.Node) || + (window?.Node && obj instanceof window.Node) || (window?.HTMLCollection && obj instanceof window.HTMLCollection) ) { return obj; diff --git a/lib/core/utils/contains.js b/lib/core/utils/contains.js index 45d33e8d27..90efa09680 100644 --- a/lib/core/utils/contains.js +++ b/lib/core/utils/contains.js @@ -14,7 +14,7 @@ export default function contains(vNode, otherVNode) { return true; } otherVNode = otherVNode.parent; - } while (otherVNode) + } while (otherVNode); return false; } @@ -25,12 +25,14 @@ export default function contains(vNode, otherVNode) { if (otherVNode === vNode) { return true; } - otherVNode = otherVNode.parent + otherVNode = otherVNode.parent; } while (otherVNode); } if (typeof vNode.actualNode.contains !== 'function') { - const position = vNode.actualNode.compareDocumentPosition(otherVNode.actualNode); + const position = vNode.actualNode.compareDocumentPosition( + otherVNode.actualNode + ); return !!(position & 16); } return vNode.actualNode.contains(otherVNode.actualNode); diff --git a/lib/core/utils/frame-messenger.js b/lib/core/utils/frame-messenger.js index 7768016149..ecb4796ac4 100644 --- a/lib/core/utils/frame-messenger.js +++ b/lib/core/utils/frame-messenger.js @@ -12,7 +12,7 @@ export const frameMessenger = { return; } - const handler = function(messageEvent) { + const handler = function (messageEvent) { messageHandler(messageEvent, topicHandler); }; window.addEventListener('message', handler, false); diff --git a/lib/core/utils/get-base-lang.js b/lib/core/utils/get-base-lang.js index c9c1e1fc5a..df2a2e640a 100644 --- a/lib/core/utils/get-base-lang.js +++ b/lib/core/utils/get-base-lang.js @@ -9,10 +9,7 @@ function getBaseLang(lang) { if (!lang) { return ''; } - return lang - .trim() - .split('-')[0] - .toLowerCase(); + return lang.trim().split('-')[0].toLowerCase(); } export default getBaseLang; diff --git a/lib/core/utils/get-environment-data.js b/lib/core/utils/get-environment-data.js index fc99f56796..61c3da7359 100644 --- a/lib/core/utils/get-environment-data.js +++ b/lib/core/utils/get-environment-data.js @@ -6,7 +6,7 @@ export default function getEnvironmentData(metadata = null, win = window) { if (metadata && typeof metadata === 'object') { return metadata; } else if (typeof win !== 'object') { - return {} + return {}; } return { @@ -25,23 +25,19 @@ export default function getEnvironmentData(metadata = null, win = window) { function getTestEnvironment(win) { if (!win.navigator || typeof win.navigator !== 'object') { - return {} + return {}; } const { navigator, innerHeight, innerWidth } = win; - const { angle, type } = getOrientation(win) || {} + const { angle, type } = getOrientation(win) || {}; return { userAgent: navigator.userAgent, windowWidth: innerWidth, windowHeight: innerHeight, orientationAngle: angle, orientationType: type - } + }; } function getOrientation({ screen }) { - return ( - screen.orientation || - screen.msOrientation || - screen.mozOrientation - ); + return screen.orientation || screen.msOrientation || screen.mozOrientation; } diff --git a/lib/core/utils/get-flattened-tree.js b/lib/core/utils/get-flattened-tree.js index 13299c2923..84fb41b18c 100644 --- a/lib/core/utils/get-flattened-tree.js +++ b/lib/core/utils/get-flattened-tree.js @@ -87,11 +87,7 @@ function flattenTree(node, shadowId, parent) { // generate an ID for this shadow root and overwrite the current // closure shadowId with this value so that it cascades down the tree retVal = createNode(node, parent, shadowId); - shadowId = - 'a' + - Math.random() - .toString() - .substring(2); + shadowId = 'a' + Math.random().toString().substring(2); realArray = Array.from(node.shadowRoot.childNodes); retVal.children = realArray.reduce((res, child) => { return reduceShadowDOM(res, child, retVal); diff --git a/lib/core/utils/get-scroll.js b/lib/core/utils/get-scroll.js index 0771e71f3c..306237270e 100644 --- a/lib/core/utils/get-scroll.js +++ b/lib/core/utils/get-scroll.js @@ -6,7 +6,7 @@ * @param {buffer} (Optional) allowed negligence in overflow * @returns {Object | undefined} */ - export default function getScroll(elm, buffer = 0) { +export default function getScroll(elm, buffer = 0) { const overflowX = elm.scrollWidth > elm.clientWidth + buffer; const overflowY = elm.scrollHeight > elm.clientHeight + buffer; diff --git a/lib/core/utils/preload-cssom.js b/lib/core/utils/preload-cssom.js index 3d96666a68..43c2ffcc24 100644 --- a/lib/core/utils/preload-cssom.js +++ b/lib/core/utils/preload-cssom.js @@ -34,10 +34,9 @@ function preloadCssom({ treeRoot = axe._tree[0] }) { const convertDataToStylesheet = getStyleSheetFactory(dynamicDoc); - return getCssomForAllRootNodes( - rootNodes, - convertDataToStylesheet - ).then(assets => flattenAssets(assets)); + return getCssomForAllRootNodes(rootNodes, convertDataToStylesheet).then( + assets => flattenAssets(assets) + ); } export default preloadCssom; diff --git a/lib/core/utils/queue.js b/lib/core/utils/queue.js index b081d643ee..5d5e82053b 100644 --- a/lib/core/utils/queue.js +++ b/lib/core/utils/queue.js @@ -112,7 +112,7 @@ function queue() { return q; }, - catch: function(fn) { + catch: function (fn) { funcGuard(fn); if (failed !== defaultFail) { throw new Error('queue `catch` already set'); diff --git a/lib/core/utils/shadow-select.js b/lib/core/utils/shadow-select.js index 73b6d50c8a..c6a38bbdcd 100644 --- a/lib/core/utils/shadow-select.js +++ b/lib/core/utils/shadow-select.js @@ -1,7 +1,7 @@ /** * Find the first element to match a selector. * Use an array of selectors to reach into shadow DOM trees - * + * * @param {string|string[]} selector String or array of strings with a CSS selector * @param {Document} doc Optional document node * @returns {Element|Null} @@ -9,7 +9,7 @@ export default function shadowSelect(selectors) { // Spread to avoid mutating the input const selectorArr = Array.isArray(selectors) ? [...selectors] : [selectors]; - return selectRecursive(selectorArr, document) + return selectRecursive(selectorArr, document); } /* Find an element in shadow or light DOM trees, using an axe selector */ diff --git a/lib/rules/color-contrast-enhanced.json b/lib/rules/color-contrast-enhanced.json index 4fbfbef79f..1c80d60715 100644 --- a/lib/rules/color-contrast-enhanced.json +++ b/lib/rules/color-contrast-enhanced.json @@ -2,7 +2,7 @@ "id": "color-contrast-enhanced", "matches": "color-contrast-matches", "excludeHidden": false, - "enabled": false, + "enabled": false, "tags": ["cat.color", "wcag2aaa", "wcag146", "ACT"], "actIds": ["09o5cg"], "metadata": { diff --git a/lib/rules/meta-refresh-no-exceptions.json b/lib/rules/meta-refresh-no-exceptions.json index e1d3e819c5..1d6c0c4d6e 100644 --- a/lib/rules/meta-refresh-no-exceptions.json +++ b/lib/rules/meta-refresh-no-exceptions.json @@ -3,12 +3,7 @@ "selector": "meta[http-equiv=\"refresh\"][content]", "excludeHidden": false, "enabled": false, - "tags": [ - "cat.time-and-media", - "wcag2aaa", - "wcag224", - "wcag325" - ], + "tags": ["cat.time-and-media", "wcag2aaa", "wcag224", "wcag325"], "actIds": ["bisz58"], "metadata": { "description": "Ensures is not used for delayed refresh", diff --git a/locales/fr.json b/locales/fr.json index a5fb70ea0b..c20c0d4d9e 100644 --- a/locales/fr.json +++ b/locales/fr.json @@ -436,7 +436,7 @@ "pass": "Les valeurs d’aria-level sont valides", "incomplete": "Les valeurs d’aria-level supérieures à 6 ne sont pas supportées par toutes les combinaisons de navigateurs et de lecteurs d’écrans" }, - "aria-prohibited-attr":{ + "aria-prohibited-attr": { "pass": "L’attribut ARIA est autorisé", "fail": "L’attribut ARIA ne peut pas être utilisé, ajoutez un attribut role ou utilisez un élément différent : ${data.values}", "incomplete": "L’attribut ARIA n’est pas bien supporté sur l’élément et le contenu texte sera utilisé à la place : ${data.values}" diff --git a/test/aria-practices/README.md b/test/aria-practices/README.md index 9f47a048a8..4555c4ead7 100644 --- a/test/aria-practices/README.md +++ b/test/aria-practices/README.md @@ -1,5 +1,5 @@ # ARIA Practices -Runs axe-core on the examples provided in the [ARIA Practices](https://www.w3.org/WAI/ARIA/apg/). To run the tests, run `npm run test:apg`. +Runs axe-core on the examples provided in the [ARIA Practices](https://www.w3.org/WAI/ARIA/apg/). To run the tests, run `npm run test:apg`. -If certain axe-core rules should not be run on certain pages, you can disable those rules using the `disabledRules` object in [apg.spec.js](./apg.spec.js). Please be sure to add a comment as to why the rule should not be run. If applicable, please open an issue in either axe-core or [aria-practices](https://github.com/w3c/aria-practices) and link to the issue in the code so that we can track the issue and know when we can run the rule again. \ No newline at end of file +If certain axe-core rules should not be run on certain pages, you can disable those rules using the `disabledRules` object in [apg.spec.js](./apg.spec.js). Please be sure to add a comment as to why the rule should not be run. If applicable, please open an issue in either axe-core or [aria-practices](https://github.com/w3c/aria-practices) and link to the issue in the code so that we can track the issue and know when we can run the rule again. diff --git a/test/aria-practices/run-server.js b/test/aria-practices/run-server.js index 06ebebce98..7ff38e4ecc 100644 --- a/test/aria-practices/run-server.js +++ b/test/aria-practices/run-server.js @@ -10,7 +10,7 @@ const getWebdriver = () => { return webdriver; }; -const connectToChromeDriver = (port) => { +const connectToChromeDriver = port => { let socket; return new Promise((resolve, reject) => { // Give up after 1s @@ -31,7 +31,7 @@ const connectToChromeDriver = (port) => { ); // Fail on error - socket.once('error', (err) => { + socket.once('error', err => { clearTimeout(timer); socket.destroy(); return reject(err); @@ -39,5 +39,5 @@ const connectToChromeDriver = (port) => { }); }; -module.exports.getWebdriver = getWebdriver -module.exports.connectToChromeDriver = connectToChromeDriver +module.exports.getWebdriver = getWebdriver; +module.exports.connectToChromeDriver = connectToChromeDriver; diff --git a/test/checks/aria/allowed-attr.js b/test/checks/aria/allowed-attr.js index 177e7bda8c..4725c4645f 100644 --- a/test/checks/aria/allowed-attr.js +++ b/test/checks/aria/allowed-attr.js @@ -1,14 +1,14 @@ -describe('aria-allowed-attr', function() { +describe('aria-allowed-attr', function () { 'use strict'; var queryFixture = axe.testUtils.queryFixture; var checkContext = axe.testUtils.MockCheckContext(); - afterEach(function() { + afterEach(function () { checkContext.reset(); }); - it('should detect incorrectly used attributes', function() { + it('should detect incorrectly used attributes', function () { var vNode = queryFixture( '
' ); @@ -21,7 +21,7 @@ describe('aria-allowed-attr', function() { assert.deepEqual(checkContext._data, ['aria-selected="true"']); }); - it('should not report on required attributes', function() { + it('should not report on required attributes', function () { var vNode = queryFixture( '' ); @@ -33,7 +33,7 @@ describe('aria-allowed-attr', function() { ); }); - it('should detect incorrectly used attributes - implicit role', function() { + it('should detect incorrectly used attributes - implicit role', function () { var vNode = queryFixture( '' ); @@ -46,7 +46,7 @@ describe('aria-allowed-attr', function() { assert.deepEqual(checkContext._data, ['aria-selected="true"']); }); - it('should return true for global attributes if there is no role', function() { + it('should return true for global attributes if there is no role', function () { var vNode = queryFixture( '
' ); @@ -59,7 +59,7 @@ describe('aria-allowed-attr', function() { assert.isNull(checkContext._data); }); - it('should return false for non-global attributes if there is no role', function() { + it('should return false for non-global attributes if there is no role', function () { var vNode = queryFixture( '
' ); @@ -72,7 +72,7 @@ describe('aria-allowed-attr', function() { assert.deepEqual(checkContext._data, ['aria-selected="true"']); }); - it('should not report on invalid attributes', function() { + it('should not report on invalid attributes', function () { var vNode = queryFixture( '' ); @@ -85,7 +85,7 @@ describe('aria-allowed-attr', function() { assert.isNull(checkContext._data); }); - it('should not report on allowed attributes', function() { + it('should not report on allowed attributes', function () { var vNode = queryFixture( '' ); @@ -98,7 +98,7 @@ describe('aria-allowed-attr', function() { assert.isNull(checkContext._data); }); - it('should return undefined for custom element that has no role and is not focusable', function() { + it('should return undefined for custom element that has no role and is not focusable', function () { var vNode = queryFixture( '' ); @@ -111,7 +111,7 @@ describe('aria-allowed-attr', function() { assert.isNotNull(checkContext._data); }); - it("should return false for custom element that has a role which doesn't allow the attribute", function() { + it("should return false for custom element that has a role which doesn't allow the attribute", function () { var vNode = queryFixture( '' ); @@ -124,7 +124,7 @@ describe('aria-allowed-attr', function() { assert.isNotNull(checkContext._data); }); - it('should return false for custom element that is focusable', function() { + it('should return false for custom element that is focusable', function () { var vNode = queryFixture( '' ); @@ -137,18 +137,18 @@ describe('aria-allowed-attr', function() { assert.isNotNull(checkContext._data); }); - describe('invalid aria-attributes when used on role=row as a descendant of a table or a grid', function() { + describe('invalid aria-attributes when used on role=row as a descendant of a table or a grid', function () { [ 'aria-posinset="1"', 'aria-setsize="1"', 'aria-expanded="true"', 'aria-level="1"' - ].forEach(function(attrName) { + ].forEach(function (attrName) { it( 'should return false when ' + attrName + ' is used on role=row thats parent is a table', - function() { + function () { var vNode = queryFixture( '
' + '
' + '
' ); @@ -23,7 +23,7 @@ describe('aria-allowed-role', function() { assert.isNull(checkContext._data, null); }); - it('returns false with implicit role of row for TR when allowImplicit is set to false via options', function() { + it('returns false with implicit role of row for TR when allowImplicit is set to false via options', function () { var vNode = queryFixture( '
' ); @@ -38,7 +38,7 @@ describe('aria-allowed-role', function() { assert.deepEqual(checkContext._data, ['row']); }); - it('returns undefined (needs review) when element is hidden and has unallowed role', function() { + it('returns undefined (needs review) when element is hidden and has unallowed role', function () { var vNode = queryFixture( '' @@ -49,7 +49,7 @@ describe('aria-allowed-role', function() { assert.isUndefined(actual); }); - it('returns undefined (needs review) when element is with in hidden parent and has unallowed role', function() { + it('returns undefined (needs review) when element is with in hidden parent and has unallowed role', function () { var vNode = queryFixture( '
' + '' ); @@ -73,7 +73,7 @@ describe('aria-allowed-role', function() { ); }); - it('returns true when img has no alt and role="presentation"', function() { + it('returns true when img has no alt and role="presentation"', function () { var vNode = queryFixture(''); assert.isTrue( axe.testUtils @@ -83,7 +83,7 @@ describe('aria-allowed-role', function() { assert.deepEqual(checkContext._data, null); }); - it('returns true when img has no alt and role="none"', function() { + it('returns true when img has no alt and role="none"', function () { var vNode = queryFixture(''); assert.isTrue( axe.testUtils @@ -93,7 +93,7 @@ describe('aria-allowed-role', function() { assert.deepEqual(checkContext._data, null); }); - it('returns true when img has empty alt and role="presentation"', function() { + it('returns true when img has empty alt and role="presentation"', function () { var vNode = queryFixture(''); assert.isTrue( axe.testUtils @@ -103,7 +103,7 @@ describe('aria-allowed-role', function() { assert.deepEqual(checkContext._data, null); }); - it('returns true when img has empty alt and role="none"', function() { + it('returns true when img has empty alt and role="none"', function () { var vNode = queryFixture(''); assert.isTrue( axe.testUtils @@ -113,7 +113,7 @@ describe('aria-allowed-role', function() { assert.deepEqual(checkContext._data, null); }); - it('returns false when img has alt and role="presentation"', function() { + it('returns false when img has alt and role="presentation"', function () { var vNode = queryFixture( 'not empty' ); @@ -125,7 +125,7 @@ describe('aria-allowed-role', function() { assert.deepEqual(checkContext._data, ['presentation']); }); - it('returns false when img has alt and role="none"', function() { + it('returns false when img has alt and role="none"', function () { var vNode = queryFixture('not empty'); assert.isFalse( axe.testUtils @@ -135,7 +135,7 @@ describe('aria-allowed-role', function() { assert.deepEqual(checkContext._data, ['none']); }); - it('returns true when img has aria-label and a valid role, role="button"', function() { + it('returns true when img has aria-label and a valid role, role="button"', function () { var vNode = queryFixture( '' ); @@ -147,7 +147,7 @@ describe('aria-allowed-role', function() { assert.isNull(checkContext._data, null); }); - it('returns false when img has aria-label and a invalid role, role="alert"', function() { + it('returns false when img has aria-label and a invalid role, role="alert"', function () { var vNode = queryFixture( '' ); @@ -159,7 +159,7 @@ describe('aria-allowed-role', function() { assert.deepEqual(checkContext._data, ['alert']); }); - it('returns true when img has aria-labelledby and a valid role, role="menuitem"', function() { + it('returns true when img has aria-labelledby and a valid role, role="menuitem"', function () { var vNode = queryFixture( '
hello world
' + '' @@ -172,7 +172,7 @@ describe('aria-allowed-role', function() { assert.isNull(checkContext._data, null); }); - it('returns false when img has aria-labelledby and a invalid role, role="rowgroup"', function() { + it('returns false when img has aria-labelledby and a invalid role, role="rowgroup"', function () { var vNode = queryFixture( '
hello world
' + '' @@ -185,7 +185,7 @@ describe('aria-allowed-role', function() { assert.deepEqual(checkContext._data, ['rowgroup']); }); - it('returns true when img has title and a valid role, role="link"', function() { + it('returns true when img has title and a valid role, role="link"', function () { var vNode = queryFixture( '
hello world
' + '' @@ -198,7 +198,7 @@ describe('aria-allowed-role', function() { assert.isNull(checkContext._data, null); }); - it('returns false when img has title and a invalid role, role="radiogroup"', function() { + it('returns false when img has title and a invalid role, role="radiogroup"', function () { var vNode = queryFixture( '
hello world
' + '' @@ -211,7 +211,7 @@ describe('aria-allowed-role', function() { assert.deepEqual(checkContext._data, ['radiogroup']); }); - it('returns true when input of type image and no role', function() { + it('returns true when input of type image and no role', function () { var vNode = queryFixture(''); assert.isTrue( axe.testUtils @@ -221,7 +221,7 @@ describe('aria-allowed-role', function() { assert.isNull(checkContext._data, null); }); - it('returns true when INPUT type is checkbox and has aria-pressed attribute', function() { + it('returns true when INPUT type is checkbox and has aria-pressed attribute', function () { var vNode = queryFixture( '' ); @@ -232,7 +232,7 @@ describe('aria-allowed-role', function() { ); }); - it('returns true when INPUT type is text with role combobox', function() { + it('returns true when INPUT type is text with role combobox', function () { var vNode = queryFixture(''); assert.isTrue( axe.testUtils @@ -241,7 +241,7 @@ describe('aria-allowed-role', function() { ); }); - it('returns true when INPUT type is tel with role combobox', function() { + it('returns true when INPUT type is tel with role combobox', function () { var vNode = queryFixture(''); assert.isTrue( axe.testUtils @@ -250,7 +250,7 @@ describe('aria-allowed-role', function() { ); }); - it('returns true when INPUT type is url with role combobox', function() { + it('returns true when INPUT type is url with role combobox', function () { var vNode = queryFixture(''); assert.isTrue( axe.testUtils @@ -259,7 +259,7 @@ describe('aria-allowed-role', function() { ); }); - it('returns true when INPUT type is search with role combobox', function() { + it('returns true when INPUT type is search with role combobox', function () { var vNode = queryFixture( '' ); @@ -270,7 +270,7 @@ describe('aria-allowed-role', function() { ); }); - it('returns true when INPUT type is email with role combobox', function() { + it('returns true when INPUT type is email with role combobox', function () { var vNode = queryFixture( '' ); @@ -281,7 +281,7 @@ describe('aria-allowed-role', function() { ); }); - it('returns true when INPUT type is text with role spinbutton', function() { + it('returns true when INPUT type is text with role spinbutton', function () { var vNode = queryFixture( '' ); @@ -292,7 +292,7 @@ describe('aria-allowed-role', function() { ); }); - it('returns true when INPUT type is number with role spinbutton', function() { + it('returns true when INPUT type is number with role spinbutton', function () { var vNode = queryFixture( '' ); @@ -303,7 +303,7 @@ describe('aria-allowed-role', function() { ); }); - it('returns true when INPUT type is tel with role spinbutton', function() { + it('returns true when INPUT type is tel with role spinbutton', function () { var vNode = queryFixture( '' ); @@ -314,7 +314,7 @@ describe('aria-allowed-role', function() { ); }); - it('returns true when INPUT type is text with role searchbox', function() { + it('returns true when INPUT type is text with role searchbox', function () { var vNode = queryFixture( '' ); @@ -325,7 +325,7 @@ describe('aria-allowed-role', function() { ); }); - it('returns false when a role is set on an element that does not allow any role', function() { + it('returns false when a role is set on an element that does not allow any role', function () { var vNode = queryFixture('
'); assert.isFalse( axe.testUtils @@ -335,7 +335,7 @@ describe('aria-allowed-role', function() { assert.deepEqual(checkContext._data, ['link']); }); - it('returns true when a role is set on an element that can have any role', function() { + it('returns true when a role is set on an element that can have any role', function () { var vNode = queryFixture('
'); assert.isTrue( axe.testUtils @@ -344,7 +344,7 @@ describe('aria-allowed-role', function() { ); }); - it('returns true an without a href to have any role', function() { + it('returns true an without a href to have any role', function () { var vNode = queryFixture(''); assert.isTrue( axe.testUtils @@ -353,7 +353,7 @@ describe('aria-allowed-role', function() { ); }); - it('returns true with a empty href to have any valid role', function() { + it('returns true with a empty href to have any valid role', function () { var vNode = queryFixture(''); var actual = axe.testUtils .getCheckEvaluate('aria-allowed-role') @@ -361,7 +361,7 @@ describe('aria-allowed-role', function() { assert.isTrue(actual); }); - it('returns true with a non-empty alt', function() { + it('returns true with a non-empty alt', function () { var vNode = queryFixture('some text'); assert.isTrue( axe.testUtils @@ -370,7 +370,7 @@ describe('aria-allowed-role', function() { ); }); - it('should allow without a multiple and size attribute to have a menu role', function () { var vNode = queryFixture(''); assert.isFalse(checkEvaluate.apply(checkContext, params)); assert.isNull(checkContext._data); }); - describe('with fallback roles', function() { - it('returns true if the deprecated role is the first valid role', function() { + describe('with fallback roles', function () { + it('returns true if the deprecated role is the first valid role', function () { axe.configure({ standards: { ariaRoles: { @@ -78,7 +78,7 @@ describe('deprecatedrole', function() { assert.deepEqual(checkContext._data, 'melon'); }); - it('returns false if the deprecated role is not the first valid role', function() { + it('returns false if the deprecated role is not the first valid role', function () { axe.configure({ standards: { ariaRoles: { diff --git a/test/checks/aria/errormessage.js b/test/checks/aria/errormessage.js index e54f44ffed..fd95256b21 100644 --- a/test/checks/aria/errormessage.js +++ b/test/checks/aria/errormessage.js @@ -1,4 +1,4 @@ -describe('aria-errormessage', function() { +describe('aria-errormessage', function () { 'use strict'; var queryFixture = axe.testUtils.queryFixture; @@ -6,11 +6,11 @@ describe('aria-errormessage', function() { var shadowCheckSetup = axe.testUtils.shadowCheckSetup; var checkContext = axe.testUtils.MockCheckContext(); - afterEach(function() { + afterEach(function () { checkContext.reset(); }); - it('should return false if aria-errormessage value is invalid', function() { + it('should return false if aria-errormessage value is invalid', function () { var vNode = queryFixture( '
' + '
' @@ -22,7 +22,7 @@ describe('aria-errormessage', function() { ); }); - it('should return undefined if aria-errormessage references an element that does not exist', function() { + it('should return undefined if aria-errormessage references an element that does not exist', function () { var vNode = queryFixture( '
' + '
' @@ -34,7 +34,7 @@ describe('aria-errormessage', function() { ); }); - it('should return true if aria-errormessage id is alert', function() { + it('should return true if aria-errormessage id is alert', function () { var vNode = queryFixture( '
' + '' @@ -46,7 +46,7 @@ describe('aria-errormessage', function() { ); }); - it('should return true if aria-errormessage id is aria-live=assertive', function() { + it('should return true if aria-errormessage id is aria-live=assertive', function () { var vNode = queryFixture( '
' + '
' @@ -58,7 +58,7 @@ describe('aria-errormessage', function() { ); }); - it('should return true if aria-errormessage id is aria-describedby', function() { + it('should return true if aria-errormessage id is aria-describedby', function () { var vNode = queryFixture( '
' + '
' @@ -70,7 +70,7 @@ describe('aria-errormessage', function() { ); }); - it('sets an array of IDs in data', function() { + it('sets an array of IDs in data', function () { var vNode = queryFixture( '
' + '
' @@ -81,7 +81,7 @@ describe('aria-errormessage', function() { assert.deepEqual(checkContext._data, ['foo', 'bar', 'baz']); }); - it('returns true when aria-errormessage is empty, if that is allowed', function() { + it('returns true when aria-errormessage is empty, if that is allowed', function () { axe.configure({ standards: { ariaAttrs: { @@ -101,7 +101,7 @@ describe('aria-errormessage', function() { ); }); - it('should return true when aria-invalid is not set', function() { + it('should return true when aria-invalid is not set', function () { var vNode = queryFixture( '
' + '
' ); @@ -112,7 +112,7 @@ describe('aria-errormessage', function() { ); }); - it('should return true when aria-invalid=false', function() { + it('should return true when aria-invalid=false', function () { var vNode = queryFixture( '
' + '
' @@ -124,7 +124,7 @@ describe('aria-errormessage', function() { ); }); - it('returns false when aria-errormessage is empty, if that is not allowed', function() { + it('returns false when aria-errormessage is empty, if that is not allowed', function () { axe.configure({ standards: { ariaAttrs: { @@ -144,7 +144,7 @@ describe('aria-errormessage', function() { ); }); - it('should return false when hidden attribute is used', function() { + it('should return false when hidden attribute is used', function () { var vNode = queryFixture( '' + '' @@ -160,7 +160,7 @@ describe('aria-errormessage', function() { }); }); - it('should return false when display: "none" is used', function() { + it('should return false when display: "none" is used', function () { var vNode = queryFixture( '' + '' @@ -176,7 +176,7 @@ describe('aria-errormessage', function() { }); }); - it('should return false when visibility: "hidden" is used', function() { + it('should return false when visibility: "hidden" is used', function () { var vNode = queryFixture( '' + '' @@ -192,7 +192,7 @@ describe('aria-errormessage', function() { }); }); - it('should return false when aria-hidden=true is used', function() { + it('should return false when aria-hidden=true is used', function () { var vNode = queryFixture( '' + '' @@ -208,7 +208,7 @@ describe('aria-errormessage', function() { }); }); - it('should return true when aria-hidden=false is used', function() { + it('should return true when aria-hidden=false is used', function () { var vNode = queryFixture( '' + '
Error message 1
' @@ -220,7 +220,7 @@ describe('aria-errormessage', function() { ); }); - it('should return true when no hidden functionality is used', function() { + it('should return true when no hidden functionality is used', function () { var vNode = queryFixture( '' + '
Error message 1
' @@ -234,7 +234,7 @@ describe('aria-errormessage', function() { (shadowSupported ? it : xit)( 'should return undefined if aria-errormessage value crosses shadow boundary', - function() { + function () { var params = shadowCheckSetup( '
', '
' @@ -249,7 +249,7 @@ describe('aria-errormessage', function() { (shadowSupported ? it : xit)( 'should return false if aria-errormessage and invalid reference are both inside shadow dom', - function() { + function () { var params = shadowCheckSetup( '
', '
' + @@ -265,7 +265,7 @@ describe('aria-errormessage', function() { (shadowSupported ? it : xit)( 'should return true if aria-errormessage and valid reference are both inside shadow dom', - function() { + function () { var params = shadowCheckSetup( '
', '
' + @@ -279,8 +279,8 @@ describe('aria-errormessage', function() { } ); - describe('SerialVirtualNode', function() { - it('should return undefined', function() { + describe('SerialVirtualNode', function () { + it('should return undefined', function () { var vNode = new axe.SerialVirtualNode({ nodeName: 'div', attributes: { diff --git a/test/checks/aria/fallbackrole.js b/test/checks/aria/fallbackrole.js index 999f333e37..b40a29e362 100644 --- a/test/checks/aria/fallbackrole.js +++ b/test/checks/aria/fallbackrole.js @@ -1,14 +1,14 @@ -describe('fallbackrole', function() { +describe('fallbackrole', function () { 'use strict'; var fixture = document.getElementById('fixture'); var queryFixture = axe.testUtils.queryFixture; - afterEach(function() { + afterEach(function () { fixture.innerHTML = ''; }); - it('should return true if fallback role is used', function() { + it('should return true if fallback role is used', function () { var virtualNode = queryFixture( '
Foo
' ); @@ -17,28 +17,28 @@ describe('fallbackrole', function() { ); }); - it('should return false if fallback role is not used', function() { + it('should return false if fallback role is not used', function () { var virtualNode = queryFixture('
Foo
'); assert.isFalse( checks.fallbackrole.evaluate(virtualNode.actualNode, null, virtualNode) ); }); - it('should return false if applied to an invalid role', function() { + it('should return false if applied to an invalid role', function () { var virtualNode = queryFixture('
Foo
'); assert.isFalse( checks.fallbackrole.evaluate(virtualNode.actualNode, null, virtualNode) ); }); - it('should return false if applied to an invalid role', function() { + it('should return false if applied to an invalid role', function () { var virtualNode = queryFixture('
Foo
'); assert.isFalse( checks.fallbackrole.evaluate(virtualNode.actualNode, null, virtualNode) ); }); - it('should return undefined/needs review if an element with no implicit role uses both none and presentation', function() { + it('should return undefined/needs review if an element with no implicit role uses both none and presentation', function () { var virtualNode = queryFixture( '
Foo
' ); @@ -47,7 +47,7 @@ describe('fallbackrole', function() { ); }); - it('should return undefined/needs review if an element with no implicit role uses both presentation and none', function() { + it('should return undefined/needs review if an element with no implicit role uses both presentation and none', function () { var virtualNode = queryFixture( '
Foo
' ); @@ -56,7 +56,7 @@ describe('fallbackrole', function() { ); }); - it('should return true if an element with an implicit role uses both presentation and none', function() { + it('should return true if an element with an implicit role uses both presentation and none', function () { var virtualNode = queryFixture( '' ); diff --git a/test/checks/aria/has-widget-role.js b/test/checks/aria/has-widget-role.js index ab71bb6ef5..f7324cadc9 100644 --- a/test/checks/aria/has-widget-role.js +++ b/test/checks/aria/has-widget-role.js @@ -1,16 +1,16 @@ -describe('has-widget-role', function() { +describe('has-widget-role', function () { 'use strict'; var fixture = document.getElementById('fixture'); var node; var checkContext = axe.testUtils.MockCheckContext(); - afterEach(function() { + afterEach(function () { node.innerHTML = ''; checkContext._data = null; }); - it('should return false for elements with no role', function() { + it('should return false for elements with no role', function () { node = document.createElement('div'); fixture.appendChild(node); assert.isFalse( @@ -18,7 +18,7 @@ describe('has-widget-role', function() { ); }); - it('should return false for elements with nonsensical roles', function() { + it('should return false for elements with nonsensical roles', function () { node = document.createElement('div'); node.setAttribute('role', 'buttonbuttonbutton'); fixture.appendChild(node); @@ -28,7 +28,7 @@ describe('has-widget-role', function() { }); // Widget roles - it('should return true for role=button', function() { + it('should return true for role=button', function () { node = document.createElement('div'); node.setAttribute('role', 'button'); fixture.appendChild(node); @@ -37,7 +37,7 @@ describe('has-widget-role', function() { ); }); - it('should return true for role=checkbox', function() { + it('should return true for role=checkbox', function () { node = document.createElement('div'); node.setAttribute('role', 'checkbox'); fixture.appendChild(node); @@ -46,7 +46,7 @@ describe('has-widget-role', function() { ); }); - it('should return true for role=gridcell', function() { + it('should return true for role=gridcell', function () { node = document.createElement('div'); node.setAttribute('role', 'gridcell'); fixture.appendChild(node); @@ -55,7 +55,7 @@ describe('has-widget-role', function() { ); }); - it('should return true for role=link', function() { + it('should return true for role=link', function () { node = document.createElement('div'); node.setAttribute('role', 'link'); fixture.appendChild(node); @@ -64,7 +64,7 @@ describe('has-widget-role', function() { ); }); - it('should return true for role=menuitem', function() { + it('should return true for role=menuitem', function () { node = document.createElement('div'); node.setAttribute('role', 'menuitem'); fixture.appendChild(node); @@ -73,7 +73,7 @@ describe('has-widget-role', function() { ); }); - it('should return true for role=menuitemcheckbox', function() { + it('should return true for role=menuitemcheckbox', function () { node = document.createElement('div'); node.setAttribute('role', 'menuitemcheckbox'); fixture.appendChild(node); @@ -82,7 +82,7 @@ describe('has-widget-role', function() { ); }); - it('should return true for role=menuitemradio', function() { + it('should return true for role=menuitemradio', function () { node = document.createElement('div'); node.setAttribute('role', 'menuitemradio'); fixture.appendChild(node); @@ -91,7 +91,7 @@ describe('has-widget-role', function() { ); }); - it('should return true for role=option', function() { + it('should return true for role=option', function () { node = document.createElement('div'); node.setAttribute('role', 'option'); fixture.appendChild(node); @@ -100,7 +100,7 @@ describe('has-widget-role', function() { ); }); - it('should return true for role=progressbar', function() { + it('should return true for role=progressbar', function () { node = document.createElement('div'); node.setAttribute('role', 'progressbar'); fixture.appendChild(node); @@ -109,7 +109,7 @@ describe('has-widget-role', function() { ); }); - it('should return true for role=radio', function() { + it('should return true for role=radio', function () { node = document.createElement('div'); node.setAttribute('role', 'radio'); fixture.appendChild(node); @@ -118,7 +118,7 @@ describe('has-widget-role', function() { ); }); - it('should return true for role=scrollbar', function() { + it('should return true for role=scrollbar', function () { node = document.createElement('div'); node.setAttribute('role', 'scrollbar'); fixture.appendChild(node); @@ -127,7 +127,7 @@ describe('has-widget-role', function() { ); }); - it('should return true for role=searchbox', function() { + it('should return true for role=searchbox', function () { node = document.createElement('div'); node.setAttribute('role', 'searchbox'); fixture.appendChild(node); @@ -136,7 +136,7 @@ describe('has-widget-role', function() { ); }); - it('should return true for role=slider', function() { + it('should return true for role=slider', function () { node = document.createElement('div'); node.setAttribute('role', 'slider'); fixture.appendChild(node); @@ -145,7 +145,7 @@ describe('has-widget-role', function() { ); }); - it('should return true for role=spinbutton', function() { + it('should return true for role=spinbutton', function () { node = document.createElement('div'); node.setAttribute('role', 'spinbutton'); fixture.appendChild(node); @@ -154,7 +154,7 @@ describe('has-widget-role', function() { ); }); - it('should return true for role=switch', function() { + it('should return true for role=switch', function () { node = document.createElement('div'); node.setAttribute('role', 'switch'); fixture.appendChild(node); @@ -163,7 +163,7 @@ describe('has-widget-role', function() { ); }); - it('should return true for role=tab', function() { + it('should return true for role=tab', function () { node = document.createElement('div'); node.setAttribute('role', 'tab'); fixture.appendChild(node); @@ -172,7 +172,7 @@ describe('has-widget-role', function() { ); }); - it('should return true for role=tabpanel', function() { + it('should return true for role=tabpanel', function () { node = document.createElement('div'); node.setAttribute('role', 'tabpanel'); fixture.appendChild(node); @@ -181,7 +181,7 @@ describe('has-widget-role', function() { ); }); - it('should return true for role=textbox', function() { + it('should return true for role=textbox', function () { node = document.createElement('div'); node.setAttribute('role', 'textbox'); fixture.appendChild(node); @@ -190,7 +190,7 @@ describe('has-widget-role', function() { ); }); - it('should return true for role=treeitem', function() { + it('should return true for role=treeitem', function () { node = document.createElement('div'); node.setAttribute('role', 'treeitem'); fixture.appendChild(node); @@ -200,7 +200,7 @@ describe('has-widget-role', function() { }); // Composite widget roles - it('should return true for role=combobox', function() { + it('should return true for role=combobox', function () { node = document.createElement('div'); node.setAttribute('role', 'combobox'); fixture.appendChild(node); @@ -209,7 +209,7 @@ describe('has-widget-role', function() { ); }); - it('should return true for role=grid', function() { + it('should return true for role=grid', function () { node = document.createElement('div'); node.setAttribute('role', 'grid'); fixture.appendChild(node); @@ -218,7 +218,7 @@ describe('has-widget-role', function() { ); }); - it('should return true for role=listbox', function() { + it('should return true for role=listbox', function () { node = document.createElement('div'); node.setAttribute('role', 'listbox'); fixture.appendChild(node); @@ -227,7 +227,7 @@ describe('has-widget-role', function() { ); }); - it('should return true for role=menu', function() { + it('should return true for role=menu', function () { node = document.createElement('div'); node.setAttribute('role', 'menu'); fixture.appendChild(node); @@ -236,7 +236,7 @@ describe('has-widget-role', function() { ); }); - it('should return true for role=menubar', function() { + it('should return true for role=menubar', function () { node = document.createElement('div'); node.setAttribute('role', 'menubar'); fixture.appendChild(node); @@ -245,7 +245,7 @@ describe('has-widget-role', function() { ); }); - it('should return true for role=radiogroup', function() { + it('should return true for role=radiogroup', function () { node = document.createElement('div'); node.setAttribute('role', 'radiogroup'); fixture.appendChild(node); @@ -254,7 +254,7 @@ describe('has-widget-role', function() { ); }); - it('should return true for role=tablist', function() { + it('should return true for role=tablist', function () { node = document.createElement('div'); node.setAttribute('role', 'tablist'); fixture.appendChild(node); @@ -263,7 +263,7 @@ describe('has-widget-role', function() { ); }); - it('should return true for role=tree', function() { + it('should return true for role=tree', function () { node = document.createElement('div'); node.setAttribute('role', 'tree'); fixture.appendChild(node); @@ -272,7 +272,7 @@ describe('has-widget-role', function() { ); }); - it('should return true for role=treegrid', function() { + it('should return true for role=treegrid', function () { node = document.createElement('div'); node.setAttribute('role', 'treegrid'); fixture.appendChild(node); @@ -281,7 +281,7 @@ describe('has-widget-role', function() { ); }); - it('should return false for role=application', function() { + it('should return false for role=application', function () { node = document.createElement('div'); node.setAttribute('role', 'application'); fixture.appendChild(node); @@ -290,7 +290,7 @@ describe('has-widget-role', function() { ); }); - it('should return false for role=article', function() { + it('should return false for role=article', function () { node = document.createElement('div'); node.setAttribute('role', 'article'); fixture.appendChild(node); @@ -299,7 +299,7 @@ describe('has-widget-role', function() { ); }); - it('should return false for role=cell', function() { + it('should return false for role=cell', function () { node = document.createElement('div'); node.setAttribute('role', 'cell'); fixture.appendChild(node); @@ -308,7 +308,7 @@ describe('has-widget-role', function() { ); }); - it('should return false for role=columnheader', function() { + it('should return false for role=columnheader', function () { node = document.createElement('div'); node.setAttribute('role', 'columnheader'); fixture.appendChild(node); @@ -317,7 +317,7 @@ describe('has-widget-role', function() { ); }); - it('should return false for role=definition', function() { + it('should return false for role=definition', function () { node = document.createElement('div'); node.setAttribute('role', 'definition'); fixture.appendChild(node); @@ -326,7 +326,7 @@ describe('has-widget-role', function() { ); }); - it('should return false for role=directory', function() { + it('should return false for role=directory', function () { node = document.createElement('div'); node.setAttribute('role', 'directory'); fixture.appendChild(node); @@ -335,7 +335,7 @@ describe('has-widget-role', function() { ); }); - it('should return false for role=document', function() { + it('should return false for role=document', function () { node = document.createElement('div'); node.setAttribute('role', 'document'); fixture.appendChild(node); @@ -344,7 +344,7 @@ describe('has-widget-role', function() { ); }); - it('should return false for role=feed', function() { + it('should return false for role=feed', function () { node = document.createElement('div'); node.setAttribute('role', 'feed'); fixture.appendChild(node); @@ -353,7 +353,7 @@ describe('has-widget-role', function() { ); }); - it('should return false for role=figure', function() { + it('should return false for role=figure', function () { node = document.createElement('div'); node.setAttribute('role', 'figure'); fixture.appendChild(node); @@ -362,7 +362,7 @@ describe('has-widget-role', function() { ); }); - it('should return false for role=group', function() { + it('should return false for role=group', function () { node = document.createElement('div'); node.setAttribute('role', 'group'); fixture.appendChild(node); @@ -371,7 +371,7 @@ describe('has-widget-role', function() { ); }); - it('should return false for role=heading', function() { + it('should return false for role=heading', function () { node = document.createElement('div'); node.setAttribute('role', 'heading'); fixture.appendChild(node); @@ -380,7 +380,7 @@ describe('has-widget-role', function() { ); }); - it('should return false for role=img', function() { + it('should return false for role=img', function () { node = document.createElement('div'); node.setAttribute('role', 'img'); fixture.appendChild(node); @@ -389,7 +389,7 @@ describe('has-widget-role', function() { ); }); - it('should return false for role=list', function() { + it('should return false for role=list', function () { node = document.createElement('div'); node.setAttribute('role', 'list'); fixture.appendChild(node); @@ -398,7 +398,7 @@ describe('has-widget-role', function() { ); }); - it('should return false for role=listitem', function() { + it('should return false for role=listitem', function () { node = document.createElement('div'); node.setAttribute('role', 'listitem'); fixture.appendChild(node); @@ -407,7 +407,7 @@ describe('has-widget-role', function() { ); }); - it('should return false for role=math', function() { + it('should return false for role=math', function () { node = document.createElement('div'); node.setAttribute('role', 'math'); fixture.appendChild(node); @@ -416,7 +416,7 @@ describe('has-widget-role', function() { ); }); - it('should return false for role=none', function() { + it('should return false for role=none', function () { node = document.createElement('div'); node.setAttribute('role', 'none'); fixture.appendChild(node); @@ -425,7 +425,7 @@ describe('has-widget-role', function() { ); }); - it('should return false for role=note', function() { + it('should return false for role=note', function () { node = document.createElement('div'); node.setAttribute('role', 'note'); fixture.appendChild(node); @@ -434,7 +434,7 @@ describe('has-widget-role', function() { ); }); - it('should return false for role=presentation', function() { + it('should return false for role=presentation', function () { node = document.createElement('div'); node.setAttribute('role', 'presentation'); fixture.appendChild(node); @@ -443,7 +443,7 @@ describe('has-widget-role', function() { ); }); - it('should return false for role=row', function() { + it('should return false for role=row', function () { node = document.createElement('div'); node.setAttribute('role', 'row'); fixture.appendChild(node); @@ -452,7 +452,7 @@ describe('has-widget-role', function() { ); }); - it('should return false for role=rowgroup', function() { + it('should return false for role=rowgroup', function () { node = document.createElement('div'); node.setAttribute('role', 'rowgroup'); fixture.appendChild(node); @@ -461,7 +461,7 @@ describe('has-widget-role', function() { ); }); - it('should return false for role=rowheader', function() { + it('should return false for role=rowheader', function () { node = document.createElement('div'); node.setAttribute('role', 'rowheader'); fixture.appendChild(node); @@ -470,7 +470,7 @@ describe('has-widget-role', function() { ); }); - it('should return false for role=table', function() { + it('should return false for role=table', function () { node = document.createElement('div'); node.setAttribute('role', 'table'); fixture.appendChild(node); @@ -479,7 +479,7 @@ describe('has-widget-role', function() { ); }); - it('should return false for role=term', function() { + it('should return false for role=term', function () { node = document.createElement('div'); node.setAttribute('role', 'term'); fixture.appendChild(node); @@ -488,7 +488,7 @@ describe('has-widget-role', function() { ); }); - it('should return false for role=toolbar', function() { + it('should return false for role=toolbar', function () { node = document.createElement('div'); node.setAttribute('role', 'toolbar'); fixture.appendChild(node); @@ -498,7 +498,7 @@ describe('has-widget-role', function() { }); // Landmark Roles - it('should return false for role=banner', function() { + it('should return false for role=banner', function () { node = document.createElement('div'); node.setAttribute('role', 'banner'); fixture.appendChild(node); @@ -507,7 +507,7 @@ describe('has-widget-role', function() { ); }); - it('should return false for role=complementary', function() { + it('should return false for role=complementary', function () { node = document.createElement('div'); node.setAttribute('role', 'complementary'); fixture.appendChild(node); @@ -516,7 +516,7 @@ describe('has-widget-role', function() { ); }); - it('should return false for role=contentinfo', function() { + it('should return false for role=contentinfo', function () { node = document.createElement('div'); node.setAttribute('role', 'contentinfo'); fixture.appendChild(node); @@ -525,7 +525,7 @@ describe('has-widget-role', function() { ); }); - it('should return false for role=form', function() { + it('should return false for role=form', function () { node = document.createElement('div'); node.setAttribute('role', 'form'); fixture.appendChild(node); @@ -534,7 +534,7 @@ describe('has-widget-role', function() { ); }); - it('should return false for role=main', function() { + it('should return false for role=main', function () { node = document.createElement('div'); node.setAttribute('role', 'main'); fixture.appendChild(node); @@ -543,7 +543,7 @@ describe('has-widget-role', function() { ); }); - it('should return false for role=navigation', function() { + it('should return false for role=navigation', function () { node = document.createElement('div'); node.setAttribute('role', 'navigation'); fixture.appendChild(node); @@ -552,7 +552,7 @@ describe('has-widget-role', function() { ); }); - it('should return false for role=region', function() { + it('should return false for role=region', function () { node = document.createElement('div'); node.setAttribute('role', 'region'); fixture.appendChild(node); @@ -561,7 +561,7 @@ describe('has-widget-role', function() { ); }); - it('should return false for role=search', function() { + it('should return false for role=search', function () { node = document.createElement('div'); node.setAttribute('role', 'search'); fixture.appendChild(node); diff --git a/test/checks/aria/no-implicit-explicit-label.js b/test/checks/aria/no-implicit-explicit-label.js index 2be4ba1c6f..62d860deb4 100644 --- a/test/checks/aria/no-implicit-explicit-label.js +++ b/test/checks/aria/no-implicit-explicit-label.js @@ -1,4 +1,4 @@ -describe('no-implicit-explicit-label', function() { +describe('no-implicit-explicit-label', function () { 'use strict'; var fixture = document.getElementById('fixture'); @@ -6,12 +6,12 @@ describe('no-implicit-explicit-label', function() { var check = checks['no-implicit-explicit-label']; var checkContext = axe.testUtils.MockCheckContext(); - afterEach(function() { + afterEach(function () { fixture.innerHTML = ''; checkContext.reset(); }); - it('returns false when there is no label text or accessible text', function() { + it('returns false when there is no label text or accessible text', function () { var vNode = queryFixture( '' ); @@ -19,7 +19,7 @@ describe('no-implicit-explicit-label', function() { assert.isFalse(actual); }); - it('returns undefined when there is no accessible text', function() { + it('returns undefined when there is no accessible text', function () { var vNode = queryFixture( '' ); @@ -27,7 +27,7 @@ describe('no-implicit-explicit-label', function() { assert.isUndefined(actual); }); - it('returns undefined when accessible text does not contain label text', function() { + it('returns undefined when accessible text does not contain label text', function () { var vNode = queryFixture( '
England
' ); @@ -35,7 +35,7 @@ describe('no-implicit-explicit-label', function() { assert.isUndefined(actual); }); - it('returns false when accessible text contains label text', function() { + it('returns false when accessible text contains label text', function () { var vNode = queryFixture( '
England
' ); @@ -43,8 +43,8 @@ describe('no-implicit-explicit-label', function() { assert.isFalse(actual); }); - describe('SerialVirtualNode', function() { - it('should return false if there is no parent', function() { + describe('SerialVirtualNode', function () { + it('should return false if there is no parent', function () { var serialNode = new axe.SerialVirtualNode({ nodeName: 'div', attributes: { @@ -58,7 +58,7 @@ describe('no-implicit-explicit-label', function() { assert.isFalse(actual); }); - it('should return undefined if incomplete tree', function() { + it('should return undefined if incomplete tree', function () { var serialNode = new axe.SerialVirtualNode({ nodeName: 'div', attributes: { diff --git a/test/checks/aria/required-parent.js b/test/checks/aria/required-parent.js index adbb3ea33a..2cadf1d6ba 100644 --- a/test/checks/aria/required-parent.js +++ b/test/checks/aria/required-parent.js @@ -1,4 +1,4 @@ -describe('aria-required-parent', function() { +describe('aria-required-parent', function () { 'use strict'; var fixture = document.getElementById('fixture'); @@ -6,13 +6,13 @@ describe('aria-required-parent', function() { var checkContext = axe.testUtils.MockCheckContext(); var checkSetup = axe.testUtils.checkSetup; - afterEach(function() { + afterEach(function () { fixture.innerHTML = ''; checkContext.reset(); axe._tree = undefined; }); - it('should detect missing required parent', function() { + it('should detect missing required parent', function () { var params = checkSetup( '

Nothing here.

' ); @@ -26,7 +26,7 @@ describe('aria-required-parent', function() { (shadowSupported ? it : xit)( 'should detect missing required parent across shadow boundary', - function() { + function () { fixture.innerHTML = '
'; var shadowRoot = document @@ -48,7 +48,7 @@ describe('aria-required-parent', function() { } ); - it('should pass when required parent is present in an ancestral aria-owns context', function() { + it('should pass when required parent is present in an ancestral aria-owns context', function () { var snippet = '
' + '

Nothing here.

'; @@ -60,7 +60,7 @@ describe('aria-required-parent', function() { ); }); - it('should fail when wrong role is present in an aria-owns context', function() { + it('should fail when wrong role is present in an aria-owns context', function () { var params = checkSetup( '
' + '

Nothing here.

' @@ -73,7 +73,7 @@ describe('aria-required-parent', function() { assert.deepEqual(checkContext._data, ['list', 'group']); }); - it('should pass when required parent is present in an aria-owns context', function() { + it('should pass when required parent is present in an aria-owns context', function () { var params = checkSetup( '

Nothing here.

' ); @@ -84,7 +84,7 @@ describe('aria-required-parent', function() { ); }); - it('should pass when at least one required parent of multiple is present', function() { + it('should pass when at least one required parent of multiple is present', function () { var params = checkSetup( '

Nothing here.

' ); @@ -95,7 +95,7 @@ describe('aria-required-parent', function() { ); }); - it('should pass when required parent is present', function() { + it('should pass when required parent is present', function () { var params = checkSetup( '

Nothing here.

' ); @@ -106,7 +106,7 @@ describe('aria-required-parent', function() { ); }); - it('should fail when there is an intermediate role between the child and parent', function() { + it('should fail when there is an intermediate role between the child and parent', function () { var params = checkSetup( '

Nothing here.

' ); @@ -117,7 +117,7 @@ describe('aria-required-parent', function() { ); }); - it('should pass when intermediate node is role=presentation', function() { + it('should pass when intermediate node is role=presentation', function () { var params = checkSetup( '

Nothing here.

' ); @@ -128,7 +128,7 @@ describe('aria-required-parent', function() { ); }); - it('should pass when intermediate node is role=group and required parent is present', function() { + it('should pass when intermediate node is role=group and required parent is present', function () { var params = checkSetup( '
' ); @@ -139,7 +139,7 @@ describe('aria-required-parent', function() { ); }); - it('should fail when intermediate node is role=group but required parent is missing', function() { + it('should fail when intermediate node is role=group but required parent is missing', function () { var params = checkSetup( '
' ); @@ -151,7 +151,7 @@ describe('aria-required-parent', function() { assert.deepEqual(checkContext._data, ['menu', 'menubar']); }); - it('should fail when intermediate node is role=group but this not an allowed context', function() { + it('should fail when intermediate node is role=group but this not an allowed context', function () { var params = checkSetup( '

Nothing here.

' ); @@ -162,8 +162,8 @@ describe('aria-required-parent', function() { ); }); - describe('group with ownGroupRoles', function() { - it('should pass when the role and grand parent role is in ownGroupRoles', function() { + describe('group with ownGroupRoles', function () { + it('should pass when the role and grand parent role is in ownGroupRoles', function () { var params = checkSetup( '
' + '
' + @@ -182,7 +182,7 @@ describe('aria-required-parent', function() { ); }); - it('should fail when the role and grand parent role is in ownGroupRoles', function() { + it('should fail when the role and grand parent role is in ownGroupRoles', function () { var params = checkSetup( '
' + '
' + @@ -201,7 +201,7 @@ describe('aria-required-parent', function() { ); }); - it('should fail when the role is not in a group', function() { + it('should fail when the role is not in a group', function () { var params = checkSetup( '
' + '
' + @@ -221,7 +221,7 @@ describe('aria-required-parent', function() { }); }); - it('should pass when intermediate node is role=none', function() { + it('should pass when intermediate node is role=none', function () { var params = checkSetup( '

Nothing here.

' ); @@ -232,7 +232,7 @@ describe('aria-required-parent', function() { ); }); - it('should pass when intermediate node is not owned by parent', function() { + it('should pass when intermediate node is not owned by parent', function () { var params = checkSetup( '

Nothing here.

' ); @@ -243,7 +243,7 @@ describe('aria-required-parent', function() { ); }); - it('should pass for multiple group and presentational roles', function() { + it('should pass for multiple group and presentational roles', function () { var params = checkSetup( '
Nothing here.
' ); @@ -256,7 +256,7 @@ describe('aria-required-parent', function() { (shadowSupported ? it : xit)( 'should pass when required parent is present across shadow boundary', - function() { + function () { fixture.innerHTML = '
'; var shadowRoot = document @@ -279,7 +279,7 @@ describe('aria-required-parent', function() { (shadowSupported ? it : xit)( 'should fail when aria-owns context crosses shadow boundary', - function() { + function () { fixture.innerHTML = '
'; diff --git a/test/checks/aria/unsupportedattr.js b/test/checks/aria/unsupportedattr.js index 472afb79a4..0b564ad78a 100644 --- a/test/checks/aria/unsupportedattr.js +++ b/test/checks/aria/unsupportedattr.js @@ -1,16 +1,16 @@ -describe('unsupportedattr', function() { +describe('unsupportedattr', function () { 'use strict'; var checkContext = axe.testUtils.MockCheckContext(); var checkSetup = axe.testUtils.checkSetup; var check = checks['aria-unsupported-attr']; - afterEach(function() { + afterEach(function () { checkContext.reset(); axe.reset(); }); - it('should return true if applied to an unsupported attribute', function() { + it('should return true if applied to an unsupported attribute', function () { axe.configure({ standards: { ariaAttrs: { @@ -27,7 +27,7 @@ describe('unsupportedattr', function() { assert.isTrue(check.evaluate.apply(checkContext, params)); }); - it('should return true with multiple unsupported and supported attributes', function() { + it('should return true with multiple unsupported and supported attributes', function () { axe.configure({ standards: { ariaAttrs: { @@ -50,21 +50,21 @@ describe('unsupportedattr', function() { ]); }); - it('should return false if applied to a supported attribute', function() { + it('should return false if applied to a supported attribute', function () { var params = checkSetup( '
Contents
' ); assert.isFalse(check.evaluate.apply(checkContext, params)); }); - it('should return false if all ARIA attributes are supported', function() { + it('should return false if all ARIA attributes are supported', function () { var params = checkSetup( '
Contents
' ); assert.isFalse(check.evaluate.apply(checkContext, params)); }); - it('should return false if applied to an element that matches the unsupported "exceptions" list', function() { + it('should return false if applied to an element that matches the unsupported "exceptions" list', function () { axe.configure({ standards: { ariaAttrs: { @@ -82,7 +82,7 @@ describe('unsupportedattr', function() { assert.isFalse(check.evaluate.apply(checkContext, params)); }); - it('should return false if applied to an element that matches the unsupported "exceptions" list using complex conditions', function() { + it('should return false if applied to an element that matches the unsupported "exceptions" list using complex conditions', function () { axe.configure({ standards: { ariaAttrs: { @@ -107,7 +107,7 @@ describe('unsupportedattr', function() { assert.isFalse(check.evaluate.apply(checkContext, params)); }); - it('should return true if applied to an element that does not match the unsupported "exceptions" list', function() { + it('should return true if applied to an element that does not match the unsupported "exceptions" list', function () { axe.configure({ standards: { ariaAttrs: { @@ -125,7 +125,7 @@ describe('unsupportedattr', function() { assert.isTrue(check.evaluate.apply(checkContext, params)); }); - it('should return true if applied to an element that does not match the unsupported "exceptions" list using complex conditions', function() { + it('should return true if applied to an element that does not match the unsupported "exceptions" list using complex conditions', function () { axe.configure({ standards: { ariaAttrs: { diff --git a/test/checks/aria/unsupportedrole.js b/test/checks/aria/unsupportedrole.js index cf7e8e6c81..08a10980be 100644 --- a/test/checks/aria/unsupportedrole.js +++ b/test/checks/aria/unsupportedrole.js @@ -1,15 +1,15 @@ -describe('unsupportedrole', function() { +describe('unsupportedrole', function () { 'use strict'; var checkContext = axe.testUtils.MockCheckContext(); var checkSetup = axe.testUtils.checkSetup; var check = checks.unsupportedrole; - afterEach(function() { + afterEach(function () { checkContext.reset(); axe.reset(); }); - it('should return true if applied to an unsupported role', function() { + it('should return true if applied to an unsupported role', function () { axe.configure({ standards: { ariaRoles: { @@ -25,10 +25,10 @@ describe('unsupportedrole', function() { '
Contents
' ); assert.isTrue(check.evaluate.apply(checkContext, params)); - assert.deepEqual(checkContext._data, "mccheddarton"); + assert.deepEqual(checkContext._data, 'mccheddarton'); }); - it('should return false if applied to a supported role', function() { + it('should return false if applied to a supported role', function () { var params = checkSetup(''); assert.isFalse(check.evaluate.apply(checkContext, params)); assert.isNull(checkContext._data); @@ -38,13 +38,13 @@ describe('unsupportedrole', function() { assert.isNull(checkContext._data); }); - it('should return false if applied to an invalid role', function() { + it('should return false if applied to an invalid role', function () { var params = checkSetup(''); assert.isFalse(check.evaluate.apply(checkContext, params)); assert.isNull(checkContext._data); }); - it('should return true if applied to an unsupported dpub role', function() { + it('should return true if applied to an unsupported dpub role', function () { axe.configure({ standards: { ariaRoles: { @@ -60,10 +60,10 @@ describe('unsupportedrole', function() { '
Contents
' ); assert.isTrue(check.evaluate.apply(checkContext, params)); - assert.deepEqual(checkContext._data, "doc-abstract"); + assert.deepEqual(checkContext._data, 'doc-abstract'); }); - it('should return true if applied to an unsupported fallback role', function() { + it('should return true if applied to an unsupported fallback role', function () { axe.configure({ standards: { ariaRoles: { @@ -79,7 +79,6 @@ describe('unsupportedrole', function() { '
Contents
' ); assert.isTrue(check.evaluate.apply(checkContext, params)); - assert.deepEqual(checkContext._data, "alert"); + assert.deepEqual(checkContext._data, 'alert'); }); - }); diff --git a/test/checks/aria/valid-attr.js b/test/checks/aria/valid-attr.js index 3b41a344c2..691a9efe44 100644 --- a/test/checks/aria/valid-attr.js +++ b/test/checks/aria/valid-attr.js @@ -1,14 +1,14 @@ -describe('aria-valid-attr', function() { +describe('aria-valid-attr', function () { 'use strict'; var queryFixture = axe.testUtils.queryFixture; var checkContext = axe.testUtils.MockCheckContext(); - afterEach(function() { + afterEach(function () { checkContext.reset(); }); - it('should return false if any invalid ARIA attributes are found', function() { + it('should return false if any invalid ARIA attributes are found', function () { var vNode = queryFixture( '
' ); @@ -20,7 +20,7 @@ describe('aria-valid-attr', function() { assert.deepEqual(checkContext._data, ['aria-cats', 'aria-dogs']); }); - it('should return true if no invalid ARIA attributes are found', function() { + it('should return true if no invalid ARIA attributes are found', function () { var vNode = queryFixture( '
' ); @@ -32,7 +32,7 @@ describe('aria-valid-attr', function() { assert.isNull(checkContext._data); }); - it('should return true for unsupported ARIA attributes', function() { + it('should return true for unsupported ARIA attributes', function () { axe.configure({ standards: { ariaAttrs: { @@ -54,8 +54,8 @@ describe('aria-valid-attr', function() { assert.isNull(checkContext._data); }); - describe('options', function() { - it('should exclude provided attribute names', function() { + describe('options', function () { + it('should exclude provided attribute names', function () { var vNode = queryFixture( '
' ); diff --git a/test/checks/aria/valid-scrollable-semantics.js b/test/checks/aria/valid-scrollable-semantics.js index ffe1f95361..c4aca6578e 100644 --- a/test/checks/aria/valid-scrollable-semantics.js +++ b/test/checks/aria/valid-scrollable-semantics.js @@ -1,16 +1,16 @@ -describe('valid-scrollable-semantics', function() { +describe('valid-scrollable-semantics', function () { 'use strict'; var fixture = document.getElementById('fixture'); var flatTreeSetup = axe.testUtils.flatTreeSetup; var checkContext = axe.testUtils.MockCheckContext(); - afterEach(function() { + afterEach(function () { fixture.innerHTML = ''; checkContext._data = null; }); - it('should return false for role=banner', function() { + it('should return false for role=banner', function () { var node = document.createElement('div'); node.setAttribute('role', '"banner'); fixture.appendChild(node); @@ -22,7 +22,7 @@ describe('valid-scrollable-semantics', function() { ); }); - it('should return false for role=search', function() { + it('should return false for role=search', function () { var node = document.createElement('div'); node.setAttribute('role', 'search'); fixture.appendChild(node); @@ -34,7 +34,7 @@ describe('valid-scrollable-semantics', function() { ); }); - it('should return true for role=form', function() { + it('should return true for role=form', function () { var node = document.createElement('div'); node.setAttribute('role', 'form'); fixture.appendChild(node); @@ -46,7 +46,7 @@ describe('valid-scrollable-semantics', function() { ); }); - it('should return true for role=navigation', function() { + it('should return true for role=navigation', function () { var node = document.createElement('div'); node.setAttribute('role', 'navigation'); fixture.appendChild(node); @@ -58,7 +58,7 @@ describe('valid-scrollable-semantics', function() { ); }); - it('should return true for role=complementary', function() { + it('should return true for role=complementary', function () { var node = document.createElement('div'); node.setAttribute('role', 'complementary'); fixture.appendChild(node); @@ -70,7 +70,7 @@ describe('valid-scrollable-semantics', function() { ); }); - it('should return true for role=contentinfo', function() { + it('should return true for role=contentinfo', function () { var node = document.createElement('div'); node.setAttribute('role', 'contentinfo'); fixture.appendChild(node); @@ -82,7 +82,7 @@ describe('valid-scrollable-semantics', function() { ); }); - it('should return true for role=main', function() { + it('should return true for role=main', function () { var node = document.createElement('div'); node.setAttribute('role', 'main'); fixture.appendChild(node); @@ -94,7 +94,7 @@ describe('valid-scrollable-semantics', function() { ); }); - it('should return true for role=region', function() { + it('should return true for role=region', function () { var node = document.createElement('div'); node.setAttribute('role', 'region'); fixture.appendChild(node); @@ -106,7 +106,7 @@ describe('valid-scrollable-semantics', function() { ); }); - it('should return true for nav elements', function() { + it('should return true for nav elements', function () { var node = document.createElement('nav'); fixture.appendChild(node); flatTreeSetup(fixture); @@ -117,7 +117,7 @@ describe('valid-scrollable-semantics', function() { ); }); - it('should return true for section elements', function() { + it('should return true for section elements', function () { var node = document.createElement('section'); fixture.appendChild(node); flatTreeSetup(fixture); @@ -128,7 +128,7 @@ describe('valid-scrollable-semantics', function() { ); }); - it('should return true for article elements', function() { + it('should return true for article elements', function () { var node = document.createElement('article'); fixture.appendChild(node); flatTreeSetup(fixture); @@ -139,7 +139,7 @@ describe('valid-scrollable-semantics', function() { ); }); - it('should return true for aside elements', function() { + it('should return true for aside elements', function () { var node = document.createElement('aside'); fixture.appendChild(node); flatTreeSetup(fixture); @@ -150,7 +150,7 @@ describe('valid-scrollable-semantics', function() { ); }); - it('should return true for role=tooltip', function() { + it('should return true for role=tooltip', function () { var node = document.createElement('div'); node.setAttribute('role', 'tooltip'); fixture.appendChild(node); @@ -162,8 +162,8 @@ describe('valid-scrollable-semantics', function() { ); }); - describe('options', function() { - it('should allow options.roles to return true for role', function() { + describe('options', function () { + it('should allow options.roles to return true for role', function () { var node = document.createElement('div'); node.setAttribute('role', 'banner'); fixture.appendChild(node); diff --git a/test/checks/forms/autocomplete-appropriate.js b/test/checks/forms/autocomplete-appropriate.js index 39ab73ffa5..96fd802559 100644 --- a/test/checks/forms/autocomplete-appropriate.js +++ b/test/checks/forms/autocomplete-appropriate.js @@ -1,4 +1,4 @@ -describe('autocomplete-appropriate', function() { +describe('autocomplete-appropriate', function () { 'use strict'; var fixture = document.getElementById('fixture'); @@ -6,11 +6,11 @@ describe('autocomplete-appropriate', function() { var checkContext = axe.testUtils.MockCheckContext(); var evaluate = axe.testUtils.getCheckEvaluate('autocomplete-appropriate'); - beforeEach(function() { + beforeEach(function () { axe._tree = undefined; }); - afterEach(function() { + afterEach(function () { fixture.innerHTML = ''; checkContext.reset(); }); @@ -22,8 +22,8 @@ describe('autocomplete-appropriate', function() { ); } - it('returns true for non-select elements', function() { - ['div', 'button', 'select', 'textarea'].forEach(function(tagName) { + it('returns true for non-select elements', function () { + ['div', 'button', 'select', 'textarea'].forEach(function (tagName) { var elm = document.createElement(tagName); elm.setAttribute('autocomplete', 'foo'); elm.setAttribute('type', 'email'); @@ -36,61 +36,61 @@ describe('autocomplete-appropriate', function() { }); }); - it('returns true if the input type is in the map', function() { + it('returns true if the input type is in the map', function () { var options = { foo: ['url'] }; var params = autocompleteCheckParams('foo', 'url', options); assert.isTrue(evaluate.apply(checkContext, params)); }); - it('returns false if the input type is not in the map', function() { + it('returns false if the input type is not in the map', function () { var options = { foo: ['url'] }; var params = autocompleteCheckParams('foo', 'email', options); assert.isFalse(evaluate.apply(checkContext, params)); }); - it('returns true if the input type is text and the term is undefined', function() { + it('returns true if the input type is text and the term is undefined', function () { var options = {}; var params = autocompleteCheckParams('foo', 'text', options); assert.isTrue(evaluate.apply(checkContext, params)); }); - it('returns true if the input type is tel and the term is off', function() { + it('returns true if the input type is tel and the term is off', function () { var options = {}; var params = autocompleteCheckParams('off', 'tel', options); assert.isTrue(evaluate.apply(checkContext, params)); }); - it('returns true if the input type is url and the term is on', function() { + it('returns true if the input type is url and the term is on', function () { var options = {}; var params = autocompleteCheckParams('on', 'url', options); assert.isTrue(evaluate.apply(checkContext, params)); }); - it('returns true if the input type is foobar and the term is undefined', function() { + it('returns true if the input type is foobar and the term is undefined', function () { var options = {}; var params = autocompleteCheckParams('foo', 'foobar', options); assert.isTrue(evaluate.apply(checkContext, params)); }); - it('returns true if the input type is email and the term is username', function() { + it('returns true if the input type is email and the term is username', function () { var options = {}; var params = autocompleteCheckParams('username', 'email', options); assert.isTrue(evaluate.apply(checkContext, params)); }); - it('returns false if the input type is text and the term maps to an empty array', function() { + it('returns false if the input type is text and the term maps to an empty array', function () { var options = { foo: [] }; var params = autocompleteCheckParams('foo', 'text', options); assert.isFalse(evaluate.apply(checkContext, params)); }); - it('returns false if the input type is month and term is bday-month', function() { + it('returns false if the input type is month and term is bday-month', function () { var options = {}; var params = autocompleteCheckParams('bday-month', 'month', options); assert.isFalse(evaluate.apply(checkContext, params)); }); - it('returns false if the input type is MONTH (case-insensitive & sanitized) and term is bday-month', function() { + it('returns false if the input type is MONTH (case-insensitive & sanitized) and term is bday-month', function () { var options = {}; var params = autocompleteCheckParams('bday-month', ' MONTH ', options); assert.isFalse(evaluate.apply(checkContext, params)); diff --git a/test/checks/forms/autocomplete-valid.js b/test/checks/forms/autocomplete-valid.js index 804a523f41..d44b0dd73c 100644 --- a/test/checks/forms/autocomplete-valid.js +++ b/test/checks/forms/autocomplete-valid.js @@ -1,4 +1,4 @@ -describe('autocomplete-valid', function() { +describe('autocomplete-valid', function () { 'use strict'; var fixture = document.getElementById('fixture'); @@ -6,22 +6,22 @@ describe('autocomplete-valid', function() { var checkContext = axe.testUtils.MockCheckContext(); var evaluate = axe.testUtils.getCheckEvaluate('autocomplete-valid'); - afterEach(function() { + afterEach(function () { fixture.innerHTML = ''; checkContext.reset(); }); - it('returns true if autocomplete is valid', function() { + it('returns true if autocomplete is valid', function () { var params = checkSetup(''); assert.isTrue(evaluate.apply(checkContext, params)); }); - it('returns false if autocomplete is not valid', function() { + it('returns false if autocomplete is not valid', function () { var params = checkSetup(''); assert.isFalse(evaluate.apply(checkContext, params)); }); - it('uses options to change what is valid autocomplete', function() { + it('uses options to change what is valid autocomplete', function () { var options = { stateTerms: ['foo'] }; var params = checkSetup( '', diff --git a/test/checks/keyboard/focusable-content.js b/test/checks/keyboard/focusable-content.js index ea706e688c..3650cf8311 100644 --- a/test/checks/keyboard/focusable-content.js +++ b/test/checks/keyboard/focusable-content.js @@ -1,4 +1,4 @@ -describe('focusable-content tests', function() { +describe('focusable-content tests', function () { 'use strict'; var check; @@ -8,17 +8,17 @@ describe('focusable-content tests', function() { var checkContext = axe.testUtils.MockCheckContext(); var checkSetup = axe.testUtils.checkSetup; - before(function() { + before(function () { check = checks['focusable-content']; }); - afterEach(function() { + afterEach(function () { fixture.innerHTML = ''; axe._tree = undefined; checkContext.reset(); }); - it('returns false when there are no focusable content elements (content element `div` is not focusable)', function() { + it('returns false when there are no focusable content elements (content element `div` is not focusable)', function () { var params = checkSetup( '
' + '
Content
' + '
' ); @@ -26,7 +26,7 @@ describe('focusable-content tests', function() { assert.isFalse(actual); }); - it('returns false when content element is taken out of focusable order (tabindex = -1)', function() { + it('returns false when content element is taken out of focusable order (tabindex = -1)', function () { var params = checkSetup( '
' + '' + '
' ); @@ -34,7 +34,7 @@ describe('focusable-content tests', function() { assert.isFalse(actual); }); - it('returns false when element is focusable (only checks if contents are focusable)', function() { + it('returns false when element is focusable (only checks if contents are focusable)', function () { var params = checkSetup( '
' + '

' + @@ -44,7 +44,7 @@ describe('focusable-content tests', function() { assert.isFalse(actual); }); - it('returns false when all content elements are not focusable', function() { + it('returns false when all content elements are not focusable', function () { var params = checkSetup( '
' + '' + @@ -56,7 +56,7 @@ describe('focusable-content tests', function() { assert.isFalse(actual); }); - it('returns true when one deeply nested content element is focusable', function() { + it('returns true when one deeply nested content element is focusable', function () { var params = checkSetup( '
' + '
' + @@ -70,7 +70,7 @@ describe('focusable-content tests', function() { assert.isTrue(actual); }); - it('returns true when content element can be focused', function() { + it('returns true when content element can be focused', function () { var params = checkSetup( '
' + '' + '
' ); @@ -78,7 +78,7 @@ describe('focusable-content tests', function() { assert.isTrue(actual); }); - it('returns true when any one of the many content elements can be focused', function() { + it('returns true when any one of the many content elements can be focused', function () { var params = checkSetup( '
' + '' + @@ -91,14 +91,14 @@ describe('focusable-content tests', function() { assert.isTrue(actual); }); - describe('shadowDOM - focusable content', function() { - before(function() { + describe('shadowDOM - focusable content', function () { + before(function () { if (!shadowSupported) { this.skip(); } }); - it('returns true when content element can be focused', function() { + it('returns true when content element can be focused', function () { fixtureSetup('
' + '
'); var node = fixture.querySelector('#target'); var shadow = node.attachShadow({ mode: 'open' }); @@ -110,7 +110,7 @@ describe('focusable-content tests', function() { assert.isTrue(actual); }); - it('returns false when no focusable content', function() { + it('returns false when no focusable content', function () { fixtureSetup('
' + '
'); var node = fixture.querySelector('#target'); var shadow = node.attachShadow({ mode: 'open' }); diff --git a/test/checks/keyboard/focusable-element.js b/test/checks/keyboard/focusable-element.js index 8436652318..d0d1cd5a0a 100644 --- a/test/checks/keyboard/focusable-element.js +++ b/test/checks/keyboard/focusable-element.js @@ -1,4 +1,4 @@ -describe('focusable-element tests', function() { +describe('focusable-element tests', function () { 'use strict'; var check; @@ -6,23 +6,23 @@ describe('focusable-element tests', function() { var checkContext = axe.testUtils.MockCheckContext(); var checkSetup = axe.testUtils.checkSetup; - before(function() { + before(function () { check = checks['focusable-element']; }); - afterEach(function() { + afterEach(function () { fixture.innerHTML = ''; axe._tree = undefined; checkContext.reset(); }); - it('returns true when element is focusable', function() { + it('returns true when element is focusable', function () { var params = checkSetup(''); var actual = check.evaluate.apply(checkContext, params); assert.isTrue(actual); }); - it('returns false when element made not focusable by tabindex', function() { + it('returns false when element made not focusable by tabindex', function () { var params = checkSetup( '' ); @@ -30,13 +30,13 @@ describe('focusable-element tests', function() { assert.isFalse(actual); }); - it('returns false when element is not focusable by default', function() { + it('returns false when element is not focusable by default', function () { var params = checkSetup('

I hold some text

'); var actual = check.evaluate.apply(checkContext, params); assert.isFalse(actual); }); - it('returns true when element made focusable by tabindex', function() { + it('returns true when element made focusable by tabindex', function () { var params = checkSetup( '

I hold some text

' ); @@ -44,7 +44,7 @@ describe('focusable-element tests', function() { assert.isTrue(actual); }); - it('returns true when element made focusable by contenteditable', function() { + it('returns true when element made focusable by contenteditable', function () { var params = checkSetup( '

I hold some text

' ); @@ -52,7 +52,7 @@ describe('focusable-element tests', function() { assert.isTrue(actual); }); - it('returns true when element made focusable by contenteditable="true"', function() { + it('returns true when element made focusable by contenteditable="true"', function () { var params = checkSetup( '

I hold some text

' ); @@ -60,7 +60,7 @@ describe('focusable-element tests', function() { assert.isTrue(actual); }); - it('returns false when element made focusable by contenteditable="false"', function() { + it('returns false when element made focusable by contenteditable="false"', function () { var params = checkSetup( '

I hold some text

' ); @@ -68,7 +68,7 @@ describe('focusable-element tests', function() { assert.isFalse(actual); }); - it('returns true when element made focusable by contenteditable="invalid" and parent is contenteditable', function() { + it('returns true when element made focusable by contenteditable="invalid" and parent is contenteditable', function () { var params = checkSetup( '

I hold some text

' ); @@ -76,7 +76,7 @@ describe('focusable-element tests', function() { assert.isTrue(actual); }); - it('returns false when element made focusable by contenteditable="invalid" and parent is not contenteditable', function() { + it('returns false when element made focusable by contenteditable="invalid" and parent is not contenteditable', function () { var params = checkSetup( '

I hold some text

' ); @@ -84,7 +84,7 @@ describe('focusable-element tests', function() { assert.isFalse(actual); }); - it('returns false when element made focusable by contenteditable="invalid" and parent is contenteditable="false"', function() { + it('returns false when element made focusable by contenteditable="invalid" and parent is contenteditable="false"', function () { var params = checkSetup( '

I hold some text

' ); diff --git a/test/checks/keyboard/focusable-modal-open.js b/test/checks/keyboard/focusable-modal-open.js index cc0b11a485..bb7693573c 100644 --- a/test/checks/keyboard/focusable-modal-open.js +++ b/test/checks/keyboard/focusable-modal-open.js @@ -1,4 +1,4 @@ -describe('focusable-modal-open', function() { +describe('focusable-modal-open', function () { 'use strict'; var check; @@ -6,18 +6,18 @@ describe('focusable-modal-open', function() { var checkContext = axe.testUtils.MockCheckContext(); var checkSetup = axe.testUtils.checkSetup; - before(function() { + before(function () { check = checks['focusable-modal-open']; }); - afterEach(function() { + afterEach(function () { fixture.innerHTML = ''; axe._tree = undefined; axe._selectorData = undefined; checkContext.reset(); }); - it('returns true when no modal is open', function() { + it('returns true when no modal is open', function () { var params = checkSetup( '