/**
* @fileoverview Real-Chromium coverage for the "Run a model on this Mac" window
* (src/web/public/local-model-ui.js): what DOM emulation cannot answer, because it lays nothing
* out.
*
* - the numbers of the model list line up: every row's speed and download size end on the
* same edge, under their captions, and every tag starts on the same edge;
* - a row is one line on a desktop and two lines under 560px, where nothing runs off the
* side and the buttons take the full width;
* - the memory bar is 12px high and filled to the selected model's share of its track, and
* the fill follows the selection;
* - the selected row carries the feature's colour on its reading edge;
* - the welcome button is really gone while it is `hidden`, and the window paints above App
* Settings;
* - the models on this Mac: the sizes on disk end on one edge under their caption, a row's
* buttons end on the list's edge, the sizes do not move when a row's Delete question opens,
* a long list scrolls from its top (it is never cut off above the frame), and under 560px a
* row is two lines with nothing running off the side.
*
* The REAL index.html is served with its scripts taken out and the two shipping stylesheets
* inlined (mobile.css under the media query its `` carries); the real module runs on a
* bare `CodemanApp` whose `_api` answers a fixture payload. The states themselves are pinned in
* JSDOM by test/local-model-ui.test.ts.
*
* Port: none (page.route on a fake origin, no server).
*/
import { readFileSync } from 'node:fs';
import { resolve } from 'node:path';
import { afterAll, afterEach, beforeAll, describe, expect, it } from 'vitest';
import { chromium, type Browser, type Page } from 'playwright';
const dir = resolve(import.meta.dirname, '../src/web/public');
const read = (name: string) => readFileSync(resolve(dir, name), 'utf8');
const ORIGIN = 'http://app.test/';
/**
* index.html as shipped, minus every script, with styles.css and mobile.css inlined. The
* comments go first: some of them mention a script tag, which would otherwise open a match
* that swallows the markup up to the next real one.
*/
const MARKUP = read('index.html')
.replace(//g, '')
.replace(/