test: Added sandboxed, isolated Chromium first-run coverage with stat...

- package.json
- package-lock.json
- .gitignore
- playwright.config.ts
- e2e/fixtures.ts
- e2e/smoke.spec.ts
- tests/svg-image.test.tsx

GSD context:
- Milestone: M001 - Merge upstream v0.4.0 into the Gitea fork
- Slice: S02 - Verify combined application behavior
- Task: T01 - Added sandboxed, isolated Chromium first-run coverage with stateful synthetic API fixtures and fail-closed network boundaries.

GSD-Task: S02/T01
This commit is contained in:
2026-10-31 16:20:49 +03:00
parent 9727516926
commit ece228e8ed
7 changed files with 301 additions and 119 deletions
+3 -1
View File
@@ -179,7 +179,9 @@ it("the fullscreen button opens the same SVG image and inversion; download keeps
// Intercept only the download anchor; never navigate or write a real file.
dom.document.createElement = ((...args: Parameters<typeof originalCreateElement>) => {
const element = originalCreateElement.apply(dom.document, args);
if (args[0] === "a") {
// Playwright imports Electron's final createElement('webview') overload;
// Parameters<> sees that overload, not the runtime string tag.
if ((args[0] as string) === "a") {
element.click = () => { clicked = { name: element.getAttribute("download")!, href: element.getAttribute("href")! }; };
}
return element;