import { createHash } from "node:crypto"; import { mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs"; import path from "node:path"; import { fileURLToPath } from "node:url"; import { describe, expect, it } from "vitest"; import { blanksIn, blanksOf, forPreview, previewOf, refusal } from "../blanks"; import { OWN_PATHS, STORE, TEST } from "../pages"; import { checkShots, checkSite, links, linkAllowed, loads } from "../../site/checks"; import { renderSite, webpSize } from "../../site/pages"; import { CONTACT } from "../../site/contact"; import { accountDeleteOn, forDelete, jsonc } from "../../site/switches"; import { APP_PAGES, APPS, type App } from "../../site/registry"; import { LOOSE, esc, keepTogether } from "../../site/html"; import { status, waiting } from "../../site/state"; import { cottonCss } from "../../site/style"; /** * The site (the chosen second design, 23 Nov 2026, with the owner's words of 23 Nov placed on it): a home page with a sheet for each app from apps.json, a page * for each app on its own paper, the plain privacy page (/yours), the full privacy policy with a section per app, * Help, the terms and the 404. Every page is rendered by src/site/pages.ts; these tests read what it renders. * * Nothing is loaded from another host: fonts, icons and screenshots are the * site's own files, there is no script, frame or form, and links go only to * the site's pages, /delete, the contact address (site.json), the two Google pages a reader * is sent to, and the stores. */ const site = renderSite(); const CSS = cottonCss(APPS); const STATIC = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../../../static"); const text = (html: string) => html.replace(/