import { renderApplicationHtml } from './testSupport/applicationHtml.mjs';
import test from 'node:test';
import assert from 'node:assert/strict';
import { readFileSync } from 'node:fs';
const html = await renderApplicationHtml(readFileSync(new URL('../index.html', import.meta.url), 'utf8'));
const parameters = readFileSync(new URL('./ui/styleParameters.js', import.meta.url), 'utf8');
// Focused markup guards; actual computed names are checked in Chromium.
// Native labels and hidden inputs must not be treated as missing aria-labels.
test('HUD sliders and location search have descriptive explicit names', () => {
for (const [id, name] of [
['scope-feather-slider', 'Scope edge feather'],
['bloom-intensity-slider', 'Bloom intensity'],
['sharpen-intensity-slider', 'Sharpen intensity'],
['location-search', 'Search location by name or coordinates'],
]) {
const input = html.match(new RegExp(`]*\\bid="${id}"[^>]*>`))?.[0];
assert.ok(input, `${id} exists`);
assert.ok(input.includes(`aria-label="${name}"`), `${id} has its descriptive name`);
}
});
test('the first-run checkbox keeps its native visible label', () => {
// The span may carry a data-i18n extraction attribute; the native wrapping
// label contract is what this guards.
assert.match(html, /