补充标题层级回归测试

验证 H4 到 H6 的字号与字重样式
This commit is contained in:
2026-09-04 13:26:07 +08:00
parent 1ce50ab031
commit 8c2a4fea64
@@ -38,6 +38,21 @@ describe('ChatMarkdownMessage', () => {
expect(lists[2]?.className).toContain('pl-4');
});
it('为四到六级标题提供递进的字号与字重', () => {
const { container } = render(
<ChatMarkdownMessage
role="assistant"
text={'#### H4 四级标题\n\n##### H5 五级标题\n\n###### H6 六级标题'}
/>,
);
expect(container.querySelector('h4')?.className).toContain('text-sm');
expect(container.querySelector('h4')?.className).toContain('font-semibold');
expect(container.querySelector('h5')?.className).toContain('font-medium');
expect(container.querySelector('h6')?.className).toContain('text-xs');
expect(container.querySelector('h6')?.className).toContain('tracking-wide');
});
it('有序列表不添加无序列表短横线,列表项段落与文本同行', () => {
const { container } = render(
<ChatMarkdownMessage