From b0aac9fbad963b010cdff48e8245e3da53061e2f Mon Sep 17 00:00:00 2001 From: Chinesezjc Date: Fri, 18 Sep 2026 14:25:53 +0800 Subject: [PATCH] test(web): assert the surviving formula in the bare-percent case --- packages/client/ui-primitives/tests/markdown.client.spec.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/client/ui-primitives/tests/markdown.client.spec.tsx b/packages/client/ui-primitives/tests/markdown.client.spec.tsx index 4b2ec27adb..47f0ecc5b6 100644 --- a/packages/client/ui-primitives/tests/markdown.client.spec.tsx +++ b/packages/client/ui-primitives/tests/markdown.client.spec.tsx @@ -592,10 +592,11 @@ describe('MarkdownText', () => { for (const source of ['$$\\text{acc} =\n95%$$', '$$\\text{acc} =\n95 %$$']) { const rendered = render() + const annotation = rendered.container.querySelector('.katex-display annotation')?.textContent ?? '' expect(rendered.container.querySelectorAll('.katex-display')).toHaveLength(1) expect(rendered.container.querySelector('.katex-error')).toBeNull() - expect(rendered.container.querySelector('.katex-display annotation')?.textContent) - .toContain('95') + expect(annotation).toContain('95') + expect(annotation).toMatch(/^\\text\{acc\} =/) rendered.unmount() } })