From e84c2235fe29b70cee8f3231a8f19e62cd08638e Mon Sep 17 00:00:00 2001 From: Ahad Birang Date: Thu, 27 Oct 2022 11:41:12 +0200 Subject: [PATCH] fix: tests --- test/features/parser-markdown.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/test/features/parser-markdown.ts b/test/features/parser-markdown.ts index 4857af068..d8e5e4cc8 100644 --- a/test/features/parser-markdown.ts +++ b/test/features/parser-markdown.ts @@ -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 @@ -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 () => {