testaro 5.0.1 → 5.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/tests/htmlcs.js +7 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testaro",
3
- "version": "5.0.1",
3
+ "version": "5.1.0",
4
4
  "description": "Automation of accessibility testing",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/tests/htmlcs.js CHANGED
@@ -10,7 +10,7 @@ exports.reporter = async page => {
10
10
  path: `${__dirname}/../htmlcs/HTMLCS.js`
11
11
  });
12
12
  let messageStrings = [];
13
- for (const standard of ['WCAG2A', 'WCAG2AA', 'WCAG2AAA']) {
13
+ for (const standard of ['WCAG2AA']) {
14
14
  const nextIssues = await page.evaluate(standard => HTMLCS_RUNNER.run(standard), standard);
15
15
  messageStrings.push(... nextIssues);
16
16
  }
@@ -38,13 +38,14 @@ exports.reporter = async page => {
38
38
  descriptions that state the contrast ratio of an element, most descriptions are
39
39
  generic, so typically many issues share a description.
40
40
  */
41
- if (! result[parts[0]][parts[1]]) {
42
- result[parts[0]][parts[1]] = {};
41
+ const issueCode = parts[1].replace(/^WCAG2|\.Principle\d\.Guideline[\d_]+/g, '');
42
+ if (! result[parts[0]][issueCode]) {
43
+ result[parts[0]][issueCode] = {};
43
44
  }
44
- if (! result[parts[0]][parts[1]][parts[4]]) {
45
- result[parts[0]][parts[1]][parts[4]] = [];
45
+ if (! result[parts[0]][issueCode][parts[4]]) {
46
+ result[parts[0]][issueCode][parts[4]] = [];
46
47
  }
47
- result[parts[0]][parts[1]][parts[4]].push({
48
+ result[parts[0]][issueCode][parts[4]].push({
48
49
  tagName: parts[2],
49
50
  id: parts[3],
50
51
  code: parts[5]