Skip to content

test: combine with transform and codegen tests for v-bind #45

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Dec 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`compiler: codegen v-bind > .camel modifier 1`] = `
exports[`compiler v-bind > .camel modifier 1`] = `
"import { template as _template, children as _children, effect as _effect, setAttr as _setAttr } from 'vue/vapor';

export function render(_ctx) {
Expand All @@ -14,35 +14,35 @@ export function render(_ctx) {
}"
`;

exports[`compiler: codegen v-bind > dynamic arg 1`] = `
"import { template as _template, children as _children, effect as _effect, setAttr as _setAttr } from 'vue/vapor';
exports[`compiler v-bind > .camel modifier w/ dynamic arg 1`] = `
"import { camelize as _camelize } from 'vue';

export function render(_ctx) {
const t0 = _template("<div></div>")
const n0 = t0()
const { 0: [n1],} = _children(n0)
_effect(() => {
_setAttr(n1, _ctx.id, undefined, _ctx.id)
_setAttr(n1, _camelize(_ctx.foo), undefined, _ctx.id)
})
return n0
}"
`;

exports[`compiler: codegen v-bind > no expression (shorthand) 1`] = `
exports[`compiler v-bind > .camel modifier w/ no expression 1`] = `
"import { template as _template, children as _children, effect as _effect, setAttr as _setAttr } from 'vue/vapor';

export function render(_ctx) {
const t0 = _template("<div></div>")
const n0 = t0()
const { 0: [n1],} = _children(n0)
_effect(() => {
_setAttr(n1, "camel-case", undefined, _ctx.camelCase)
_setAttr(n1, "fooBar", undefined, _ctx.fooBar)
})
return n0
}"
`;

exports[`compiler: codegen v-bind > no expression 1`] = `
exports[`compiler v-bind > basic 1`] = `
"import { template as _template, children as _children, effect as _effect, setAttr as _setAttr } from 'vue/vapor';

export function render(_ctx) {
Expand All @@ -56,17 +56,35 @@ export function render(_ctx) {
}"
`;

exports[`compiler: codegen v-bind > should error if no expression 1`] = `
"import { template as _template } from 'vue/vapor';
exports[`compiler v-bind > dynamic arg 1`] = `
"import { template as _template, children as _children, effect as _effect, setAttr as _setAttr } from 'vue/vapor';

export function render(_ctx) {
const t0 = _template("<div arg=\\"\\"></div>")
const t0 = _template("<div></div>")
const n0 = t0()
const { 0: [n1],} = _children(n0)
_effect(() => {
_setAttr(n1, _ctx.id, undefined, _ctx.id)
})
return n0
}"
`;

exports[`compiler: codegen v-bind > simple expression 1`] = `
exports[`compiler v-bind > no expression (shorthand) 1`] = `
"import { template as _template, children as _children, effect as _effect, setAttr as _setAttr } from 'vue/vapor';

export function render(_ctx) {
const t0 = _template("<div></div>")
const n0 = t0()
const { 0: [n1],} = _children(n0)
_effect(() => {
_setAttr(n1, "camel-case", undefined, _ctx.camelCase)
})
return n0
}"
`;

exports[`compiler v-bind > no expression 1`] = `
"import { template as _template, children as _children, effect as _effect, setAttr as _setAttr } from 'vue/vapor';

export function render(_ctx) {
Expand All @@ -79,3 +97,13 @@ export function render(_ctx) {
return n0
}"
`;

exports[`compiler v-bind > should error if empty expression 1`] = `
"import { template as _template } from 'vue/vapor';

export function render(_ctx) {
const t0 = _template("<div arg=\\"\\"></div>")
const n0 = t0()
return n0
}"
`;
Loading