File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change 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+ } )
You can’t perform that action at this time.
0 commit comments