Skip to content
This repository was archived by the owner on Jul 19, 2025. It is now read-only.

Commit 1a3d51c

Browse files
committed
test: complete the unit tests
1 parent ae512ef commit 1a3d51c

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

packages/compiler-vapor/__tests__/transforms/__snapshots__/vBind.spec.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export function render(_ctx) {
88
const n0 = t0()
99
const { 0: [n1],} = _children(n0)
1010
_effect(() => {
11-
_setAttr(n1, "foo-bar", undefined, _ctx.id)
11+
_setAttr(n1, "fooBar", undefined, _ctx.id)
1212
})
1313
return n0
1414
}"

packages/compiler-vapor/__tests__/transforms/vBind.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,9 @@ describe('compiler: transform v-bind', () => {
165165
})
166166
})
167167

168-
test.fails('.camel modifier', () => {
168+
test('.camel modifier', () => {
169169
const node = parseWithVBind(`<div v-bind:foo-bar.camel="id"/>`)
170+
console.log('node.effect[0].operations[0]', node.effect[0].operations[0])
170171
expect(node.effect[0].operations[0]).toMatchObject({
171172
key: {
172173
content: `fooBar`,
@@ -179,7 +180,7 @@ describe('compiler: transform v-bind', () => {
179180
})
180181
})
181182

182-
test.fails('.camel modifier w/ no expression', () => {
183+
test('.camel modifier w/ no expression', () => {
183184
const node = parseWithVBind(`<div v-bind:foo-bar.camel />`)
184185
expect(node.effect[0].operations[0]).toMatchObject({
185186
key: {
@@ -193,13 +194,13 @@ describe('compiler: transform v-bind', () => {
193194
})
194195
})
195196

196-
test.fails('.camel modifier w/ dynamic arg', () => {
197+
test('.camel modifier w/ dynamic arg', () => {
197198
const node = parseWithVBind(`<div v-bind:[foo].camel="id"/>`)
198199
expect(node.effect[0].operations[0]).toMatchObject({
200+
runtimeCamelize: true,
199201
key: {
200202
content: `foo`,
201203
isStatic: false,
202-
somethingShouldBeTrue: true,
203204
},
204205
value: {
205206
content: `id`,
@@ -289,8 +290,7 @@ describe('compiler: codegen v-bind', () => {
289290
expect(code).contains('_setAttr(n1, _ctx.id, undefined, _ctx.id)')
290291
})
291292

292-
// TODO: camel modifier for v-bind
293-
test.fails('.camel modifier', () => {
293+
test('.camel modifier', () => {
294294
const code = compile(`<div v-bind:foo-bar.camel="id"/>`)
295295

296296
expect(code).matchSnapshot()

0 commit comments

Comments
 (0)