testilo 19.4.1 → 20.0.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testilo",
3
- "version": "19.4.1",
3
+ "version": "20.0.0",
4
4
  "description": "Prepares and processes Testaro reports",
5
5
  "main": "aim.js",
6
6
  "scripts": {
@@ -13,7 +13,8 @@ exports.credit = reports => {
13
13
  issueCounts: {
14
14
  total: 0,
15
15
  nonOnlies: 0,
16
- onlies: {}
16
+ onlies: 0,
17
+ toolOnlies: {}
17
18
  }
18
19
  };
19
20
  const {instanceCounts, onlies, mosts, tools, issueCounts} = tally;
@@ -21,10 +22,8 @@ exports.credit = reports => {
21
22
  reports.forEach(report => {
22
23
  // If it is valid:
23
24
  if (report.score && report.score.details && report.score.details.issue) {
24
- // Populate the issue count.
25
- const issues = report.score.details && report.score.details.issue;
26
- issueCounts.nonOnlies = issueCounts.total = Object.keys(issues).length;
27
25
  // For each issue:
26
+ const issues = report.score.details && report.score.details.issue;
28
27
  Object.keys(issues).forEach(issueID => {
29
28
  // For each tool with any complaints about it:
30
29
  if (! instanceCounts[issueID]) {
@@ -73,18 +72,21 @@ exports.credit = reports => {
73
72
  console.log(`ERROR: Report ${report.id} missing score data`);
74
73
  }
75
74
  });
75
+ // Populate the total and initial non-only issue counts.
76
+ issueCounts.nonOnlies = issueCounts.total = Object.keys(instanceCounts).length;
76
77
  // For each tallied issue:
77
78
  Object.keys(instanceCounts).forEach(issueID => {
78
79
  // If only 1 tool complained about it:
79
- const toolIDs = Object.keys(instanceCounts[issueID])
80
+ const toolIDs = Object.keys(instanceCounts[issueID]);
80
81
  if (toolIDs.length === 1) {
81
- // Add this to the tally.
82
+ // Add this to the tally and decrement the non-only total.
82
83
  const toolID = toolIDs[0];
83
84
  onlies[issueID] = toolID;
84
- if (! issueCounts.onlies[toolID]) {
85
- issueCounts.onlies[toolID] = 0;
85
+ issueCounts.onlies++;
86
+ if (! issueCounts.toolOnlies[toolID]) {
87
+ issueCounts.toolOnlies[toolID] = 0;
86
88
  }
87
- issueCounts.onlies[toolID]++;
89
+ issueCounts.toolOnlies[toolID]++;
88
90
  issueCounts.nonOnlies--;
89
91
  }
90
92
  // Otherwise, i.e. if multiple tools complained about it:
@@ -3585,12 +3585,12 @@ exports.issues = {
3585
3585
  summary: 'autocomplete missing',
3586
3586
  why: 'User cannot get help entering personal information in a form',
3587
3587
  wcag: '1.3.5',
3588
- weight: 1,
3588
+ weight: 4,
3589
3589
  tools: {
3590
3590
  testaro: {
3591
3591
  autocomplete: {
3592
3592
  variable: false,
3593
- quality: 1,
3593
+ quality: 0.5,
3594
3594
  what: 'Name or email input is missing its required autocomplete attribute'
3595
3595
  }
3596
3596
  }