test: review-batch-2 follow-up coverage (sandbox html-embed, #101 fixes, i18n) #110
Reference in New Issue
Block a user
Delete Branch "test/review-batch-2-followups"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Тест-покрытие, заведённое в ревью PR #101 (смержен) и sandbox-рефактора html-embed. 12 коммитов, по коммиту на issue, всё на актуальном develop (после мержа #101). Тесты/мелкие чистые экстракции, без изменения поведения.
Closes #98, #99, #100, #102, #103, #104, #105, #106, #108, #109
Что покрыто
Sandbox html-embed + trackerHead (#98/#99/#100): оба бага из issues (BUG-1
$&-инъекция trackerHead, BUG-2 height NaN) УЖЕ были починены в sandbox-рефакторе — добавлены тесты, пиннящие инварианты:injectTrackerHead(вынес в чистый хелпер): сниппет с$&/$$/$`вставляется байт-в-байт (падает на старом строковом replacer); empty/whitespace/нет</head>→ без изменений.allow-scripts allow-popups allow-forms(нетallow-same-origin), рендер черезsrcDoc;clampHeight[40,4000];isTrustedHeightMessage(чужой source/тип/NaN/Infinity отвергнуты)."abc"→null — пиннит NaN-guard); mcp htmlEmbed round-trip (source/height); DTO-валидация (@MaxLength(20000),@IsBoolean); CASL-гейт записи trackerHead не-админом; slash-меню гейтинг; no-op аудит-ветка.Тесты на фиксы из #101: #102 movePage cycle-guard (self-move/cycle/legit), #103 non-text part → 400, #104 (resolveShareAiMaxOutputTokens — уже было), #105 export+тест
resolveTrustProxy(вынес из main.ts), #106 reconnect-resync (makeConnectHandler), #108 assistant-name предикат.i18n #109: ru-RU получил недостающие
AI agent/AI agent is typing…(был mixed-language); en-US полный; остальные локали — fallback на en-US (полный перевод — отдельная задача).Проверка
server 10 suites / 77 tests (затронутые) — все зелёные; client 4 files / 40 tests; server+client
tsc --noEmit— чисто. Ветвь от текущего develop, конфликтов нет.🤖 Generated with Claude Code
Extract parse/renderHtmlEmbedHeight and test: '300'->300, absent->null, 'abc'->null (pins the NaN guard), '120px'->120; render 120->data-height, null/0->{}. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>ru-RU had only '{{name}} is typing…' but not 'AI agent' / 'AI agent is typing…', so the Russian typing indicator was mixed-language. Add them (AI-агент / AI-агент печатает…) grouped with the named key. en-US is already complete; other locales intentionally keep the en-US fallback (full translation is a separate effort). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>