]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
test: `v-cloak` (#32)
authorRizumu Ayaka <rizumu@ayaka.moe>
Tue, 5 Dec 2023 14:36:46 +0000 (22:36 +0800)
committerGitHub <noreply@github.com>
Tue, 5 Dec 2023 14:36:46 +0000 (22:36 +0800)
packages/compiler-vapor/__tests__/__snapshots__/compile.test.ts.snap
packages/compiler-vapor/__tests__/compile.test.ts

index 72bb2fa7aaa0e1cbac6dff559b43e69aa2c48157..62201cc17bfea5fc4702859cb4042b8878dfc4e2 100644 (file)
@@ -30,6 +30,16 @@ export function render(_ctx) {
 }"
 `;
 
+exports[`compile > directives > v-cloak > basic 1`] = `
+"import { template as _template } from 'vue/vapor';
+
+export function render(_ctx) {
+  const t0 = _template(\\"<div>test</div>\\")
+  const n0 = t0()
+  return n0
+}"
+`;
+
 exports[`compile > directives > v-html > should raise error and ignore children when v-html is present 1`] = `
 "import { template as _template, children as _children, effect as _effect, setHtml as _setHtml } from 'vue/vapor';
 
index 71ab30379744a1b09fe4c10fe0fb69677d14f2f0..4e72e85083cc527ab26c66b01c0bd2e6872c3947 100644 (file)
@@ -273,5 +273,13 @@ describe('compile', () => {
         // Waiting for TODO, There should be more here.
       })
     })
+
+    describe('v-cloak', () => {
+      test('basic', async () => {
+        const code = await compile(`<div v-cloak>test</div>`)
+        expect(code).toMatchSnapshot()
+        expect(code).not.contains('v-cloak')
+      })
+    })
   })
 })