okami.mom/strata
git clone https://git.nkp.pet/okami.mom/strata
8667a3dbf
main
1// The saved Monitor screenshot starts with the Strata logo alone (no "Monitor" headline); the live Monitor page keeps its title. 2import test from 'node:test' ; 3import assert from 'node:assert/strict' ; 4import { readFile } from 'node:fs/promises' ; 5 6const read = path => readFile ( new URL ( path , import . meta. url ), 'utf8' ). then ( s => s . replace ( / \r\n / g , '\n' )); 7 8test ( 'the exported Monitor picture has the logo and no "Monitor" headline; the page itself keeps its title' , async () => { 9const source = await read ( '../src/screens/Monitor.tsx' ); 10const header = / \{tr\(frozen \? <header className="section-toolbar"> ( . * ? ) <\/header> : null\)\} / s . exec ( source )?.[ 1 ]; 11assert . ok ( header , 'the picture has its own header (it only exists while the picture is taken)' ); 12assert . match ( header , / <Brand variant="lockup" / ); 13assert . doesNotMatch ( header , / <h1 / ); 14assert . doesNotMatch ( header , / tr\("Monitor"\) / ); 15assert . match ( header , / frozen\.modelLabel / , 'the model and time line stays' ); 16assert . match ( source , / <Screen width="wide" plainHeader title=\{tr\("Monitor"\)\} / , 'the live page still says Monitor' ); 17});