Тест: строка нормы при переработке

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Alex Cube
2026-10-26 01:30:59 +03:00
co-authored by Claude Opus 5.5
parent c701f07483
commit 7b9e56bd89
+6
View File
@@ -42,4 +42,10 @@ const must = ['>10:00<', '>4:55<', '>14:55<', 'осталось <b>5:05</b>', 'T
for (const s of must) if (!html.includes(s)) throw new Error('missing ' + s + '\n' + html); for (const s of must) if (!html.includes(s)) throw new Error('missing ' + s + '\n' + html);
if (html.includes('#3')) throw new Error('September record counted'); if (html.includes('#3')) throw new Error('September record counted');
if (calls.filter(c => c === 'task.elapseditem.getlist').length !== 3) throw new Error('pages: ' + calls); if (calls.filter(c => c === 'task.elapseditem.getlist').length !== 3) throw new Error('pages: ' + calls);
// норма превышена: 14:55 при норме 10 ч
globalThis.myTimeConfig = { norm: 10 };
eval(fs.readFileSync(new URL('../extension/mytime.js', import.meta.url), 'utf8'));
await new Promise(r => setTimeout(r, 50));
if (!els['mytime-out'].innerHTML.includes('Норма 10 ч выполнена, сверх нормы 4:55')) throw new Error('over norm\n' + els['mytime-out'].innerHTML);
console.log('ok'); console.log('ok');