import { readFileSync } from 'node:fs'; import { join } from 'node:path'; import { describe, expect, it } from 'vitest'; const INDEX_HTML = readFileSync(join(process.cwd(), 'src/web/public/index.html'), 'utf-8'); function normalizedHtml(value: string): string { return value.replace(/\s+/g, ' '); } function extractElementById(html: string, id: string): string { const idIndex = html.indexOf(`id="${id}"`); expect(idIndex, `expected #${id} to exist`).toBeGreaterThanOrEqual(0); const start = html.lastIndexOf('<', idIndex); expect(start, `expected #${id} start tag`).toBeGreaterThanOrEqual(0); // Bound at the next HTML comment (every following section is comment-labeled) so // sections inserted between this element and any fixed marker don't leak into the // slice — the cron modal's "Run At" text false-positived the stale-shortcut check. const nextSection = html.indexOf('