Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
farnabaz committed Oct 27, 2022
1 parent b366bce commit e84c223
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions test/features/parser-markdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ export const testMarkdownParser = () => {
id: 'content:index.md',
content: [
':hello', // valid
':hello-world', // valid but with different name
':hello,', // valid
':hello :hello', // valid
':hello{}-world', // valid
':hello:hello', // invalid
':hello-world', // valid but with different name
':hello:', // invalid
'`:hello`', // code
':rocket:' // emoji
Expand All @@ -95,15 +95,17 @@ export const testMarkdownParser = () => {
})
expect(compComponentCount).toEqual(5)

const paragraph = parsed.body.children[0]
expect(parsed.body.children[0].tag).toEqual('hello')
expect(parsed.body.children[1].tag).toEqual('hello-world')

const paragraph = parsed.body.children[2]
expect(paragraph.children[0].tag).toEqual('hello')
expect(paragraph.children[1].tag).toEqual('hello')
expect(paragraph.children[3].tag).toEqual('hello')
expect(paragraph.children[2].tag).toEqual('hello')
expect(paragraph.children[4].tag).toEqual('hello')
expect(paragraph.children[5].tag).toEqual('hello')
expect(paragraph.children[6].tag).toEqual('hello')

// Check conflict between inline compoenent and emoji
expect(parsed.body.children[0].children.pop().value).toContain('🚀')
expect(paragraph.children.pop().value).toContain('🚀')
})

test('h1 tags', async () => {
Expand Down

0 comments on commit e84c223

Please sign in to comment.