Skip to content

Commit 335d30a

Browse files
committed
test(RichTextReader): basic test
Signed-off-by: Max <max@nextcloud.com>
1 parent 17f0d62 commit 335d30a

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { mount } from '@vue/test-utils'
2+
import { test, expect } from 'vitest'
3+
import RichTextReader from '../../components/RichTextReader.vue'
4+
import { nextTick } from 'vue'
5+
6+
const content = '# Hello world\n\n[this is a link](https://nextcloud.com)'
7+
test('renders markdown', async () => {
8+
const wrapper = mount(RichTextReader, {
9+
propsData: { content },
10+
})
11+
await nextTick()
12+
expect(wrapper.get('h1').text()).toBe('#Hello world') // # is the heading anchor
13+
expect(wrapper.get('a[href="https://nextcloud.com"]').text()).toBe('this is a link')
14+
})

0 commit comments

Comments
 (0)