cat / goq
clone

turns a linux box into a private steam streaming appliance: plug in, tap your key, play from another computer

release/portal-packaging
goq / portal / session-accessibility.test.mjs
session-accessibility.test.mjs 1.7K
1import assert from 'node:assert/strict';2import { readFile } from 'node:fs/promises';3import test from 'node:test';45const html = await readFile(new URL('./index.html', import.meta.url), 'utf8');6const css = await readFile(new URL('./style.css', import.meta.url), 'utf8');7const main = await readFile(new URL('./main.js', import.meta.url), 'utf8');8const roster = await readFile(new URL('./roster-ui.mjs', import.meta.url), 'utf8');910test('viewer and focus status is textual, live, and not color-only', () => {11 assert.match(html, /id="viewer-status"[^>]*aria-live="polite"/);12 assert.match(html, /id="roster-summary"[^>]*aria-live="polite"/);13 assert.match(html, /id="roster-list"[^>]*aria-label="Connected viewers"/);14 assert.match(roster, /you hold control/);15 assert.match(roster, /control available/);16 assert.match(roster, /view only/);17 assert.match(roster, /input eligible/);18});1920test('view-only v2 spectators have no focus action but retain audio and drawer access', () => {21 assert.match(main, /classList\.toggle\('hidden', v2 && !sessionStateRuntime\.eligible\)/);22 assert.match(html, /id="audio-toggle"[^>]*data-controller-focus/);23 assert.match(html, /onclick="togglePanel\(true\)"/);24 assert.match(main, /spectating ยท request control/);25});2627test('roster rendering is text-safe and responsive controller focus remains visible', () => {28 assert.doesNotMatch(roster, /innerHTML|insertAdjacentHTML|outerHTML/);29 assert.match(roster, /textContent = text/);30 assert.match(css, /\.link-btn:focus-visible,[\s\S]*\.link-btn\.controller-focus[\s\S]*outline:\s*2px solid var\(--moss\)/);31 assert.match(css, /@media \(max-width: 720px\)[\s\S]*\.topbar-right[\s\S]*min-width:\s*0/);32});