test: snap for KeepAlive

This commit is contained in:
Amour1688 2021-02-06 21:45:53 +08:00
parent f1c9629b88
commit 4c69e3ce71
2 changed files with 30 additions and 0 deletions

View File

@ -97,6 +97,20 @@ _withDirectives(_createVNode(\\"input\\", {
}, null, 8, [\\"onUpdate:modelValue\\"]), [[_vModelText, test]]);"
`;
exports[`named import specifier \`Keep Alive\`: named import specifier \`Keep Alive\` 1`] = `
"import { createVNode as _createVNode, createTextVNode as _createTextVNode } from \\"vue\\";
import { KeepAlive } from 'vue';
_createVNode(KeepAlive, null, [_createTextVNode(\\"123\\")]);"
`;
exports[`namespace specifier \`Keep Alive\`: namespace specifier \`Keep Alive\` 1`] = `
"import { createVNode as _createVNode, createTextVNode as _createTextVNode } from \\"vue\\";
import * as Vue from 'vue';
_createVNode(Vue.KeepAlive, null, [_createTextVNode(\\"123\\")]);"
`;
exports[`override props multiple: multiple 1`] = `
"import { createVNode as _createVNode, resolveComponent as _resolveComponent } from \\"vue\\";

View File

@ -147,6 +147,22 @@ const tests: Test[] = [
name: 'use "model" as the prop name',
from: '<C v-model={[foo, "model"]} />',
},
{
name: 'named import specifier `Keep Alive`',
from: `
import { KeepAlive } from 'vue';
<KeepAlive>123</KeepAlive>
`,
},
{
name: 'namespace specifier `Keep Alive`',
from: `
import * as Vue from 'vue';
<Vue.KeepAlive>123</Vue.KeepAlive>
`,
},
];
tests.forEach((