@cypress/unique-selector 2.0.0 → 2.0.1
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/lib/getClasses.js +1 -1
- package/lib/index.js +1 -1
- package/package.json +1 -1
package/lib/getClasses.js
CHANGED
|
@@ -22,7 +22,7 @@ function getClasses(el, filter) {
|
|
|
22
22
|
|
|
23
23
|
try {
|
|
24
24
|
return Array.prototype.slice.call(el.classList).filter(function (cls) {
|
|
25
|
-
return !filter || filter('
|
|
25
|
+
return !filter || filter('class', 'class', cls);
|
|
26
26
|
});
|
|
27
27
|
} catch (e) {
|
|
28
28
|
var className = el.getAttribute('class');
|
package/lib/index.js
CHANGED
|
@@ -35,7 +35,7 @@ var attrRegex = /^attribute:(.+)/m;
|
|
|
35
35
|
/**
|
|
36
36
|
* @typedef Filter
|
|
37
37
|
* @type {Function}
|
|
38
|
-
* @param {string} type - the trait being considered ('attribute', 'tag', 'nth-child').
|
|
38
|
+
* @param {string} type - the trait being considered ('attribute', 'tag', 'nth-child'). As a special case, the `class` attribute is split on whitespace and each token passed individually with a `class` type.
|
|
39
39
|
* @param {string} key - your trait key (for 'attribute' will be the attribute name, for others will typically be the same as 'type').
|
|
40
40
|
* @param {string} value - the trait value.
|
|
41
41
|
* @returns {boolean} whether this trait can be used when building the selector (true = allow). Defaults to 'true' if no value returned.
|
package/package.json
CHANGED