Skip to content

Commit

Permalink
chore: update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sandros94 committed Mar 6, 2024
1 parent 980401a commit 5260cc2
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
2 changes: 1 addition & 1 deletion test/basic.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ describe('ssr', async () => {
it('renders markdown content', async () => {
// Get response to a server-rendered page with `$fetch`.
const html = await $fetch('/')
expect(html).toContain('<h1>Markdown!</h1>\n<p>This is a markdown example.</p>')
expect(html).toContain('<h1 id="nuxt-module-playground!" tabindex="-1">Nuxt module playground!</h1><p>Welcome to the example of <a href="https://github.com/sandros94/nuxt-markdown-render" target="_blank">nuxt-markdown-render</a>.</p><div><h1>Test component</h1></div>')
})
})
10 changes: 6 additions & 4 deletions test/fixtures/basic/app.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
<template>
<div>
<NuxtMarkdown :source="md" />
<NuxtMarkdown :source="md" :components="{ TestComponent }" />
</div>
</template>

<script setup>
const md = `
# Markdown!
import { TestComponent } from '#components'
const md = `# Nuxt module playground!
This is a markdown example.`
Welcome to the example of <a href="https://github.com/sandros94/nuxt-markdown-render" target="_blank">nuxt-markdown-render</a>.
<TestComponent/>`
</script>
13 changes: 13 additions & 0 deletions test/fixtures/basic/components/test-component.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<template>
<div>
<h1>Test component</h1>
</div>
</template>

<script setup lang="ts">
</script>

<style scoped>
</style>

0 comments on commit 5260cc2

Please sign in to comment.