testaro 32.0.5 → 32.0.7

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": "testaro",
3
- "version": "32.0.5",
3
+ "version": "32.0.7",
4
4
  "description": "Run 960 web accessibility tests from 9 tools and get a standardized report",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -240,7 +240,7 @@ const doNuVal = (result, standardResult, docType) => {
240
240
  location: {
241
241
  doc: docType === 'pageContent' ? 'dom' : 'source',
242
242
  type: 'line',
243
- spec: item.lastLine.toString()
243
+ spec: item && item.lastLine && item.lastLine.toString() || ''
244
244
  },
245
245
  excerpt: cap(item.extract)
246
246
  };
@@ -41,11 +41,14 @@ exports.reporter = async (page, withItems) => {
41
41
  ruleID: 'allCaps',
42
42
  selector: 'body *:not(style, script, svg)',
43
43
  pruner: async loc => await loc.evaluate(el => {
44
+ // Get the concatenated and debloated text content of the element and its child text nodes.
44
45
  const elText = Array
45
46
  .from(el.childNodes)
46
47
  .filter(node => node.nodeType === Node.TEXT_NODE)
47
48
  .map(textNode => textNode.nodeValue)
48
- .join(' ');
49
+ .join(' ')
50
+ .replace(/\s{2,}/g, ' ')
51
+ .replace(/-{2,}/g, '-');
49
52
  // If the element text includes 8 sequential upper-case letters, spaces, or hyphen-minuses:
50
53
  if (/[- A-Z]{8}/.test(elText)) {
51
54
  // Report this.
package/testaro/hovInd.js CHANGED
@@ -84,18 +84,18 @@ const getCursorData = hovStyles => {
84
84
  // If it is an input:
85
85
  if (tagName === 'INPUT') {
86
86
  // Get whether its hover cursor is standard.
87
- data.ok = cursor === (standardCursor.INPUT[hovStyles.inputType] || 'default');
87
+ data.ok = [standardCursor.INPUT[hovStyles.inputType], 'default', 'auto'].includes(cursor);
88
88
  }
89
89
  // Otherwise, i.e. if it is a link:
90
90
  else {
91
91
  // Get whether its hover cursor is standard.
92
- data.ok = cursor === 'pointer';
92
+ data.ok = [standardCursor.A, 'auto'].includes(cursor);
93
93
  }
94
94
  }
95
95
  // Otherwise, if it is a button:
96
96
  else if (tagName === 'BUTTON') {
97
97
  // Get whether its hover cursor is standard.
98
- data.ok = cursor === 'default';
98
+ data.ok = ['default', 'auto'].includes(cursor);
99
99
  }
100
100
  // Otherwise, i.e. if it has another type and a hover listener:
101
101
  else {