From 47f93ba5549c167d9a2171bdf3003d5a7cc5cae4 Mon Sep 17 00:00:00 2001 From: Farnabaz Date: Tue, 7 Jun 2022 01:38:21 +0200 Subject: [PATCH] test: add heading tests --- test/features/parser-markdown.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/features/parser-markdown.ts b/test/features/parser-markdown.ts index 39bd03e32..d73a54234 100644 --- a/test/features/parser-markdown.ts +++ b/test/features/parser-markdown.ts @@ -68,5 +68,19 @@ export const testMarkdownParser = () => { expect(parsed.body).toHaveProperty('children') expect(parsed.body.children.length).toEqual(0) }) + + test('h1 tags', async () => { + const parsed = await $fetch('/api/parse', { + method: 'POST', + body: { + id: 'content:index.md', + content: '

Hello

' + } + }) + + expect(parsed.body).toHaveProperty('children') + expect(parsed.body.children.length).toEqual(1) + expect(parsed.body.children[0].tag).toEqual('h1') + }) }) }