const assert = require('node:assert/strict'); const fs = require('node:fs'); const path = require('node:path'); const applicationSource = fs.readFileSync(path.join(__dirname, '..', 'assets', 'app.js'), 'utf8') .replace(/\s*bootstrap\(\);\s*$/, ''); const runtimeTests = String.raw` render=()=>{}; for (const mode of ['box', 'sku']) { state.relabelMode=mode; const view=relabelView(); assert.doesNotMatch(view,/class="list-title"/, mode+' relabel cards must not show a repeated mode title'); assert.match(view,/class="list-grid relabel-list-grid"/, mode+' relabel cards must keep their field grid'); assert.match(view,/openRelabelWork/, mode+' relabel cards must keep the start-work action'); } `; const documentStub = { getElementById: () => null }; const windowStub = { scrollTo: () => {}, requestAnimationFrame: callback => callback() }; const run = new Function('assert', 'localStorage', 'document', 'window', applicationSource + '\n' + runtimeTests); run(assert, { getItem: () => null, setItem: () => {} }, documentStub, windowStub); process.stdout.write('PASS: relabel cards hide repeated mode titles\n');