- Timestamp:
- 07/28/2026 07:58:26 PM (6 weeks ago)
- Branches:
- main
- Children:
- 6c152a5
- Parents:
- 70677e96
- File:
-
- 1 edited
-
test/guardian-panel.test.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
test/guardian-panel.test.js
r70677e96 r742ba7e 39 39 }); 40 40 41 test('releasing a ward is two steps, not a browser confirm', () => { 42 // Robins besluit: letting a child go is a decision. window.confirm hides a 43 // long explanation behind an OK button people press to make it go away. 44 // A call, not the word: the comment above the release button names it too. 45 assert.ok(!/window\.confirm\s*\(/.test(client), 'the release must ask in the panel, with its own yes and no'); 46 assert.match(client, /release-check/, 'and it first asks the server what releasing this ward actually does'); 47 for (const k of ['release_last', 'release_step_down', 'release_unknown']) { 48 assert.ok(client.includes(k), `the warning must cover the ${k} case`); 49 } 50 assert.match(route, /not_my_ward/, 'and the check refuses a ward that is not yours'); 51 }); 52 53 test('every CSS variable the PWA uses is one it defines', () => { 54 // The dashboard is standalone: it never inherits the site theme, so an 55 // undefined var silently renders as nothing. --danger did exactly that: the 56 // warning box lost its border and the confirm button its background. 57 const css = read('../src/assets/css/guardian.css'); 58 const root = (css.match(/:root\s*\{([\s\S]*?)\}/) || [])[1] || ''; 59 const defined = new Set([...root.matchAll(/(--[a-z0-9-]+)\s*:/g)].map((m) => m[1])); 60 const used = [...new Set([...css.matchAll(/var\((--[a-z0-9-]+)(\s*,)?/g)] 61 .filter((m) => !m[2]) // one with a fallback is fine 62 .map((m) => m[1]))]; 63 const missing = used.filter((v) => !defined.has(v)); 64 assert.deepEqual(missing, [], `guardian.css uses ${missing.join(', ')} without defining it`); 65 }); 66 41 67 test('the labels the panel renders are all served to it', () => { 42 68 // uiStrings() picks the keys by hand, so a label used in the client but not
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)