okami.mom/strata

git clone https://git.nkp.pet/okami.mom/strata

Niko1221Merge f-split-int (a3024ed10) into f-split-qa1: qa2's s3237-s3238 kept, my 21 strings renumbered s3260-s32808667a3dbf

main
1.1 KiB17 linesraw
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 () => {
9  const source = await read('../src/screens/Monitor.tsx');
10  const header = /\{tr\(frozen \? <header className="section-toolbar">(.*?)<\/header> : null\)\}/s.exec(source)?.[1];
11  assert.ok(header, 'the picture has its own header (it only exists while the picture is taken)');
12  assert.match(header, /<Brand variant="lockup"/);
13  assert.doesNotMatch(header, /<h1/);
14  assert.doesNotMatch(header, /tr\("Monitor"\)/);
15  assert.match(header, /frozen\.modelLabel/, 'the model and time line stays');
16  assert.match(source, /<Screen width="wide" plainHeader title=\{tr\("Monitor"\)\}/, 'the live page still says Monitor');
17});