From fbdaf8bbef166c894350c67ef112e28fd020c17c Mon Sep 17 00:00:00 2001
From: Anthony Fu [(\`number string) (\`tag string)]
-
- <a href="javascript:alert(1)">click me</a>
-
-
-"
-`;
-
-exports[`content-rich > block with injected html, with an unknown language 1`] = `
-"
-
- <a href="javascript:alert(1)">click me</a>
-
-
-"
-`;
-
-exports[`content-rich > block with injected html, without language 1`] = `
-"
-
- <a href="javascript:alert(1)">click me</a>
-
-
-"
-`;
-
-exports[`content-rich > code frame 1`] = `
-"Testing code block
import { useMouse, usePreferredDark } from '@vueuse/core' -// tracks mouse position -const { x, y } = useMouse() -// is the user prefers dark theme -const isDark = usePreferredDark()" -`; - -exports[`content-rich > code frame 2 1`] = ` -"
const a = hello- -" -`; - -exports[`content-rich > code frame empty 1`] = `"
hello world
Does the following formatting come through accurately for you?
- -
- HTML block code:
-
-<span class="icon--noto icon--noto--1st-place-medal"></span> -<span class="icon--noto icon--noto--2nd-place-medal-medal"></span>- -" -`; - -exports[`content-rich > inline code with link 1`] = ` -"
- Inline code with link:
- https://api.iconify.design/noto.css?icons=1st-place-medal,2nd-place-medal
-
- Happy - - weβre now using - - (migrated from chai+mocha) - https://github.com/ayoayco/astro-reactive-library/pull/203 -
-" -`; - -exports[`content-rich > plain text 1`] = ` -"hello there -" -`; - -exports[`editor > transform mentions 1`] = ` -" -@elk Hello" -`; diff --git a/tests/__snapshots__/html-parse.test.ts.snap b/tests/__snapshots__/html-parse.test.ts.snap deleted file mode 100644 index d7f36a0d..00000000 --- a/tests/__snapshots__/html-parse.test.ts.snap +++ /dev/null @@ -1,144 +0,0 @@ -// Vitest Snapshot v1 - -exports[`html-parse > code frame > html 1`] = ` -"Testing code block
import { useMouse, usePreferredDark } from '@vueuse/core'
-// tracks mouse position
-const { x, y } = useMouse()
-// is the user prefers dark theme
-const isDark = usePreferredDark()
"
-`;
-
-exports[`html-parse > code frame > text 1`] = `
-"Testing code block
-
-
-\`\`\`ts
-import { useMouse, usePreferredDark } from '@vueuse/core'
-// tracks mouse position
-const { x, y } = useMouse()
-// is the user prefers dark theme
-const isDark = usePreferredDark()
-\`\`\`"
-`;
-
-exports[`html-parse > code frame 2 > html 1`] = `
-"
- @antfu
- Testing
-
const a = hello
-
-"
-`;
-
-exports[`html-parse > code frame 2 > text 1`] = `
-"@antfu Testing
-
-\`\`\`ts
-const a = hello
-\`\`\`"
-`;
-
-exports[`html-parse > custom emoji > html 1`] = `
-"Daniel Roe
-
-"
-`;
-
-exports[`html-parse > custom emoji > text 1`] = `"Daniel Roe :nuxt:"`;
-
-exports[`html-parse > emojis > html 1`] = `
-"
-
-
-"
-`;
-
-exports[`html-parse > emojis > text 1`] = `"π«π· π¨βπ©βπ¦ π©βππ§π½βπ"`;
-
-exports[`html-parse > empty > html 1`] = `""`;
-
-exports[`html-parse > empty > text 1`] = `""`;
-
-exports[`html-parse > html entities > html 1`] = `
-"Hello <World />.
-" -`; - -exports[`html-parse > html entities > text 1`] = `"Hellotext code
bold italic del
code block
"`;
-
-exports[`html-parse > inline markdown > text 1`] = `
-"text \`code\` **bold** *italic* ~~del~~
-
-
-\`\`\`js
-code block
-\`\`\`"
-`;
-
-exports[`html-parse > link + mention > html 1`] = `
-"- Happy - - weβre now using - @vitest - (migrated from chai+mocha) - https://github.com/ayoayco/astro-reactive-library/pull/203 -
-" -`; - -exports[`html-parse > link + mention > text 1`] = `"Happy π€ weβre now using @vitest (migrated from chai+mocha) https://github.com/ayoayco/astro-reactive-library/pull/203"`; diff --git a/tests/nuxt/content-rich.test.ts b/tests/nuxt/content-rich.test.ts index 9d32b592..d21bc30e 100644 --- a/tests/nuxt/content-rich.test.ts +++ b/tests/nuxt/content-rich.test.ts @@ -287,15 +287,10 @@ vi.mock('shiki-es', async (importOriginal) => { } }) -vi.mock('~/components/content/ContentMentionGroup.vue', async () => { - const { defineComponent, h } = await import('vue') - return { - default: defineComponent({ - setup(props, { slots }) { - return () => h('mention-group', null, { default: () => slots?.default?.() }) - }, - }), - } +mockComponent('ContentMentionGroup', { + setup(props, { slots }) { + return () => h('mention-group', null, { default: () => slots?.default?.() }) + }, }) mockComponent('AccountHoverWrapper', {