@letsrunit/playwright 0.18.1 → 0.18.2
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/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/scrub-html.ts +3 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@letsrunit/playwright",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.2",
|
|
4
4
|
"description": "Playwright extensions and utilities for letsrunit",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"testing",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
},
|
|
43
43
|
"packageManager": "yarn@4.10.3",
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@letsrunit/utils": "0.18.
|
|
45
|
+
"@letsrunit/utils": "0.18.2",
|
|
46
46
|
"@playwright/test": "^1.57.0",
|
|
47
47
|
"case": "^1.6.3",
|
|
48
48
|
"diff": "^8.0.3",
|
package/src/scrub-html.ts
CHANGED
|
@@ -373,10 +373,10 @@ function isUtilityClass(token: string): boolean {
|
|
|
373
373
|
}
|
|
374
374
|
|
|
375
375
|
function stripUtilityClasses(doc: Document) {
|
|
376
|
-
for (const el of doc.body.querySelectorAll<
|
|
377
|
-
const kept = el.
|
|
376
|
+
for (const el of doc.body.querySelectorAll<Element>('[class]')) {
|
|
377
|
+
const kept = [...el.classList].filter((t) => t && !isUtilityClass(t));
|
|
378
378
|
if (kept.length === 0) el.removeAttribute('class');
|
|
379
|
-
else el.
|
|
379
|
+
else el.setAttribute('class', kept.join(' '));
|
|
380
380
|
}
|
|
381
381
|
}
|
|
382
382
|
|