testaro 2.3.7 → 2.3.10
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 +1 -1
- package/procs/score/asp09.js +7 -7
- package/tests/ibm.js +1 -1
- package/tests/radioSet.js +1 -1
package/package.json
CHANGED
package/procs/score/asp09.js
CHANGED
|
@@ -255,7 +255,7 @@ exports.scorer = acts => {
|
|
|
255
255
|
facts = test.result;
|
|
256
256
|
if (facts && facts.content && facts.url && (facts.content.totals || facts.url.totals)) {
|
|
257
257
|
rules.ibm = 'multiply violations by 4*, recommendations by 2* (*discounted); sum';
|
|
258
|
-
const
|
|
258
|
+
const ibmScores = {
|
|
259
259
|
content: null,
|
|
260
260
|
url: null
|
|
261
261
|
};
|
|
@@ -263,7 +263,7 @@ exports.scorer = acts => {
|
|
|
263
263
|
const totals = facts[type].totals;
|
|
264
264
|
if (totals) {
|
|
265
265
|
const items = facts[type].items || [];
|
|
266
|
-
|
|
266
|
+
ibmScores[type] = Math.round(items.reduce((total, item) => {
|
|
267
267
|
const {ruleId, level} = item;
|
|
268
268
|
const rawScore = [4, 2][['violation', 'recommendation'].indexOf(level)] || 0;
|
|
269
269
|
const divisor = duplications.ibm[`${level.slice(0, 1)}:${ruleId}`] + 1 || 1;
|
|
@@ -271,8 +271,8 @@ exports.scorer = acts => {
|
|
|
271
271
|
}, 0));
|
|
272
272
|
}
|
|
273
273
|
});
|
|
274
|
-
if (
|
|
275
|
-
scores.ibm = Math.max(
|
|
274
|
+
if (ibmScores.content !== null || ibmScores.url !== null) {
|
|
275
|
+
scores.ibm = Math.max(ibmScores.content || 0, ibmScores.url || 0);
|
|
276
276
|
scores.total += scores.ibm;
|
|
277
277
|
}
|
|
278
278
|
}
|
|
@@ -287,20 +287,20 @@ exports.scorer = acts => {
|
|
|
287
287
|
contrast: 3,
|
|
288
288
|
alert: 2
|
|
289
289
|
};
|
|
290
|
-
const
|
|
290
|
+
const waveScores = {
|
|
291
291
|
error: 0,
|
|
292
292
|
contrast: 0,
|
|
293
293
|
alert: 0
|
|
294
294
|
};
|
|
295
295
|
['error', 'contrast', 'alert'].forEach(level => {
|
|
296
296
|
const {items} = facts[level];
|
|
297
|
-
|
|
297
|
+
waveScores[level] = Math.round(Object.keys(items).reduce((total, ruleID) => {
|
|
298
298
|
const rawScore = items[ruleID].count * weights[level];
|
|
299
299
|
const divisor = duplications.wave[`${level.slice(0, 1)}:${ruleID}`] + 1 || 1;
|
|
300
300
|
return total + rawScore / divisor;
|
|
301
301
|
}, 0));
|
|
302
302
|
});
|
|
303
|
-
scores.wave =
|
|
303
|
+
scores.wave = waveScores.error + waveScores.contrast + waveScores.alert;
|
|
304
304
|
scores.total += scores.wave;
|
|
305
305
|
}
|
|
306
306
|
}
|
package/tests/ibm.js
CHANGED
package/tests/radioSet.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
that two or more radio buttons with the same name, and no other radio buttons, be grouped in a
|
|
5
5
|
'fieldset' element with a valid 'legend' element.
|
|
6
6
|
*/
|
|
7
|
-
const fs = require('fs
|
|
7
|
+
const fs = require('fs').promises;
|
|
8
8
|
// Tabulates and lists radio buttons in and not in accessible field sets.
|
|
9
9
|
exports.reporter = async (page, withItems) => {
|
|
10
10
|
// Initialize the argument array to be passed to the page function.
|