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 +1 -1
- package/procs/standardize.js +1 -1
- package/testaro/allCaps.js +4 -1
- package/testaro/hovInd.js +3 -3
package/package.json
CHANGED
package/procs/standardize.js
CHANGED
|
@@ -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
|
};
|
package/testaro/allCaps.js
CHANGED
|
@@ -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 =
|
|
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 =
|
|
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 =
|
|
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 {
|