Skip to content

Commit 90b1d84

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

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/**
2+
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
3+
* SPDX-License-Identifier: AGPL-3.0-or-later
4+
*/
5+
6+
import { mount } from '@vue/test-utils'
7+
import { test, expect } from 'vitest'
8+
import RichTextReader from '../../components/RichTextReader.vue'
9+
import { nextTick } from 'vue'
10+
11+
const content = '# Hello world\n\n[this is a link](https://nextcloud.com)'
12+
test('renders markdown', async () => {
13+
const wrapper = mount(RichTextReader, {
14+
propsData: { content },
15+
})
16+
await nextTick()
17+
expect(wrapper.get('h1').text()).toBe('#Hello world') // # is the heading anchor
18+
expect(wrapper.get('a[href="https://nextcloud.com"]').text()).toBe('this is a link')
19+
wrapper.destroy()
20+
})

0 commit comments

Comments
 (0)