/** * Session Options structural guard. * * The modal shares the `set-*` settings surface with App Settings, but its rail * is a real switcher: switchOptionsTab shows one `.set-section` and hides the * rest. Like App Settings, its load/save path is `getElementById` by a fixed set * of ids, so dropping or renaming an element in the markup fails silently — the * option just stops loading, or stops being written back. * * These tests read the REAL session-ui.js and index.html and pin that contract. */ import { describe, it, expect } from 'vitest'; import { readFileSync } from 'node:fs'; import { resolve } from 'node:path'; const publicDir = resolve(import.meta.dirname, '../src/web/public'); const html = readFileSync(resolve(publicDir, 'index.html'), 'utf8'); const sessionUi = readFileSync(resolve(publicDir, 'session-ui.js'), 'utf8'); const styles = readFileSync(resolve(publicDir, 'styles.css'), 'utf8'); /** The Session Options markup, so assertions can't be satisfied elsewhere. */ function optionsModal(): string { const start = html.indexOf('