test: only compare markdown part when test markdown renderer

This commit is contained in:
mutoe 2023-09-08 16:45:41 +08:00
parent 1570e38956
commit 1ba77588f1
No known key found for this signature in database
GPG Key ID: FEE78A0836900C9C
3 changed files with 1878 additions and 2373 deletions

View File

@ -17,7 +17,7 @@ describe('# ArticleDetail', () => {
}))
await server.waitForRequest('GET', '/api/articles/markdown')
expect(container).toMatchSnapshot()
expect(container.querySelector('#article-content')).toMatchSnapshot()
})
it('should render markdown (zh-CN) body correctly', async () => {
@ -26,7 +26,7 @@ describe('# ArticleDetail', () => {
}))
await server.waitForRequest('GET', '/api/articles/markdown-cn')
expect(container).toMatchSnapshot()
expect(container.querySelector('#article-content')).toMatchSnapshot()
})
it('should filter the xss content in Markdown body', async () => {
@ -35,6 +35,6 @@ describe('# ArticleDetail', () => {
}))
await server.waitForRequest('GET', '/api/articles/markdown-xss')
expect(container).toMatchSnapshot()
expect(container.querySelector('#article-content')).toMatchSnapshot()
})
})

View File

@ -14,7 +14,7 @@
<div class="container page">
<div class="row article-content">
<!-- eslint-disable vue/no-v-html -->
<div class="col-md-12" v-html="articleHandledBody" />
<div id="article-content" class="col-md-12" v-html="articleHandledBody" />
<!-- eslint-enable vue/no-v-html -->
<!-- TODO: abstract tag list component -->

File diff suppressed because it is too large Load Diff