-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(loading): add a11y tests (#4621)
* test(loader): stub out initial test * test(loader): add aria-live test * test(loading): break tests into categories and add AAT * test(loading): add beforeEach block * test(Loading): add DAP AAT and update Axe matcher naming * test(loading): add offline mirrors and test results * test(loading): fix faulty DAP assertion * test(loading): update DAP, update .gitignore, add aatconfig * test(Loading): add enzyme attatchTo and un-breakout a11y tests * test(Loading): untracking results folder * test(Loading): add results folder to .gitignore * test(Loading): add comments, lower timeout * test(Loading): remove accidental important, add test helpers * fix(Tag): add role=button to span for screenreaders * Update packages/react/src/components/Loading/Loading-test.js Co-Authored-By: Josh Black <josh@josh.black> * Update packages/react/src/components/Loading/Loading-test.js Co-Authored-By: Josh Black <josh@josh.black> * test(Loading): fix casing and use render over enzyme * test(Loading): update how we grab elements * test(loading): update DAP version * chore(project): sync offline mirror
- Loading branch information
Showing
26 changed files
with
255 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
module.exports = { | ||
// optional - Specify the rule archive | ||
// Default: latest | ||
// Run `npx aat archives` for a list of valid ruleArchive ids and policy ids | ||
ruleArchive: '2019SeptDeploy', | ||
|
||
// optional - Specify one or many policies to scan. | ||
// Run `npx aat archives` for a list of valid ruleArchive ids and policy ids | ||
policies: ['IBM_Accessibility'], | ||
|
||
// optional - Specify one or many violation levels on which to fail the test | ||
// i.e. If specified violation then the testcase will only fail if | ||
// a violation is found during the scan. | ||
// i.e. failLevels: ["violation"] | ||
// i.e. failLevels: ["violation","potential violation"] or refer to below as a list | ||
// Default: ["violation","potential violation"] | ||
failLevels: ['violation'], | ||
|
||
// optional - Specify one or many violation levels which should be reported | ||
// i.e. If specified violation then in the report it would only contain | ||
// results which are level of violation. | ||
// i.e. reportLevels: ["violation"] | ||
// Valid values: violation, potentialviolation, recommendation, potentialrecommendation, manual | ||
// Default: ["violation","potential violation"] | ||
reportLevels: ['violation'], | ||
|
||
// Optional - Which type should the results be outputted to | ||
// Valid values: json, csv | ||
// Default: json | ||
outputFormat: ['json'], | ||
|
||
// Optional - Specify labels that you would like associated to your scan | ||
// | ||
// i.e. | ||
// label: ["Firefox","master","V12","Linux"] | ||
// Default: N/A | ||
label: [], | ||
|
||
// optional - Where the scan results should be saved. | ||
// Default: results | ||
outputFolder: '.aat/results', | ||
|
||
// optional - Where the baseline results should be loaded from | ||
// Default: baselines | ||
baselineFolder: '.aat/baselines', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/** | ||
* Copyright IBM Corp. 2019 | ||
* | ||
* This source code is licensed under the Apache-2.0 license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
'use strict'; | ||
|
||
const AAT = require('@ibma/aat'); | ||
|
||
async function toHaveNoDAPViolations(node, label) { | ||
const results = await AAT.getCompliance(node, label); | ||
if (AAT.assertCompliance(results.report) === 0) { | ||
return { | ||
pass: true, | ||
}; | ||
} else { | ||
return { | ||
pass: false, | ||
message: () => AAT.stringifyResults(results.report), | ||
}; | ||
} | ||
} | ||
|
||
module.exports = toHaveNoDAPViolations; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.