Skip to content

Commit

Permalink
test: add heading tests
Browse files Browse the repository at this point in the history
  • Loading branch information
farnabaz committed Jun 6, 2022
1 parent 4587451 commit 47f93ba
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/features/parser-markdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: '<h1>Hello</h1>'
}
})

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

0 comments on commit 47f93ba

Please sign in to comment.