@krizaka/page-audit 0.5.0 → 0.5.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/package.json +3 -3
- package/src/visual.mjs +3 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@krizaka/page-audit",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "The page audit of every Krizaka app, in one place: HTTP status, empty main, horizontal overflow, a card out of its panel, sections covering each other, a column cut off, top chrome overlaps, unnamed buttons, empty headings. Runs in a real browser (Playwright) over a route list, viewports and themes, with View Transitions neutralised and a self-test on its own fixtures.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"krizaka",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"eslint": "^9.39.0",
|
|
62
62
|
"playwright-core": "^1.55.0",
|
|
63
63
|
"vitest": "^4.1.11",
|
|
64
|
-
"@krizaka/config": "^0.14.
|
|
64
|
+
"@krizaka/config": "^0.14.1"
|
|
65
65
|
},
|
|
66
66
|
"engines": {
|
|
67
67
|
"node": ">=22"
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"scripts": {
|
|
73
73
|
"lint": "eslint . --max-warnings 0",
|
|
74
74
|
"typecheck": "node --check src/index.mjs",
|
|
75
|
-
"test": "vitest run",
|
|
75
|
+
"test": "vitest run --coverage --coverage.provider=v8 --coverage.reporter=lcov --coverage.reporter=text-summary \"--coverage.include=src/**/*.ts\"",
|
|
76
76
|
"check": "pnpm run lint && pnpm run test"
|
|
77
77
|
}
|
|
78
78
|
}
|
package/src/visual.mjs
CHANGED
|
@@ -74,8 +74,10 @@ export async function prepareVisualPage(page, { theme, themeKey = "kz-theme", no
|
|
|
74
74
|
|
|
75
75
|
/** Waits until what is on screen is final: the faces, the images, the transitions. */
|
|
76
76
|
export async function settleForShot(page, { javaScript = true } = {}) {
|
|
77
|
-
|
|
77
|
+
// With JavaScript off, Playwright cannot run a script in the page: addStyleTag never returns (the first paint hung for the whole test timeout).
|
|
78
|
+
// Nothing moves without scripts, and `animations: "disabled"` of the screenshot still freezes CSS animations.
|
|
78
79
|
if (!javaScript) return;
|
|
80
|
+
await page.addStyleTag({ content: FREEZE_CSS });
|
|
79
81
|
await page.evaluate(() => document.fonts.ready);
|
|
80
82
|
await settled(page);
|
|
81
83
|
await page.evaluate(() =>
|