Skip to content

Commit ff4d4ec

Browse files
committed
chore: fix all test cases
1 parent 68416e9 commit ff4d4ec

File tree

6 files changed

+23
-9
lines changed

6 files changed

+23
-9
lines changed

packages/compiler-core/__tests__/transforms/__snapshots__/vFor.spec.ts.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ return function render(_ctx, _cache) {
129129
const { renderList: _renderList, Fragment: _Fragment, openBlock: _openBlock, createBlock: _createBlock, renderSlot: _renderSlot } = _Vue
130130
131131
return (_openBlock(true), _createBlock(_Fragment, null, _renderList(items, (item) => {
132-
return _renderSlot($slots, \\"default\\")
132+
return _renderSlot($slots, \\"default\\", {}, undefined, true)
133133
}), 256 /* UNKEYED_FRAGMENT */))
134134
}
135135
}"
@@ -143,7 +143,7 @@ return function render(_ctx, _cache) {
143143
const { renderList: _renderList, Fragment: _Fragment, openBlock: _openBlock, createBlock: _createBlock, renderSlot: _renderSlot } = _Vue
144144
145145
return (_openBlock(true), _createBlock(_Fragment, null, _renderList(items, (item) => {
146-
return _renderSlot($slots, \\"default\\")
146+
return _renderSlot($slots, \\"default\\", {}, undefined, true)
147147
}), 256 /* UNKEYED_FRAGMENT */))
148148
}
149149
}"

packages/compiler-core/__tests__/transforms/__snapshots__/vIf.spec.ts.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ return function render(_ctx, _cache) {
8080
const { renderSlot: _renderSlot, createCommentVNode: _createCommentVNode } = _Vue
8181
8282
return ok
83-
? _renderSlot($slots, \\"default\\", { key: 0 })
83+
? _renderSlot($slots, \\"default\\", { key: 0 }, undefined, true)
8484
: _createCommentVNode(\\"v-if\\", true)
8585
}
8686
}"
@@ -140,7 +140,7 @@ return function render(_ctx, _cache) {
140140
const { renderSlot: _renderSlot, createCommentVNode: _createCommentVNode } = _Vue
141141
142142
return ok
143-
? _renderSlot($slots, \\"default\\", { key: 0 })
143+
? _renderSlot($slots, \\"default\\", { key: 0 }, undefined, true)
144144
: _createCommentVNode(\\"v-if\\", true)
145145
}
146146
}"

packages/compiler-core/__tests__/transforms/__snapshots__/vOnce.spec.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ return function render(_ctx, _cache) {
6767
return (_openBlock(), _createBlock(\\"div\\", null, [
6868
_cache[1] || (
6969
_setBlockTracking(-1),
70-
_cache[1] = _renderSlot($slots, \\"default\\"),
70+
_cache[1] = _renderSlot($slots, \\"default\\", {}, undefined, true),
7171
_setBlockTracking(1),
7272
_cache[1]
7373
)

packages/compiler-core/__tests__/transforms/transformSlotOutlet.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { transformSlotOutlet } from '../../src/transforms/transformSlotOutlet'
1616
function parseWithSlots(template: string, options: CompilerOptions = {}) {
1717
const ast = parse(template)
1818
transform(ast, {
19+
slotted: false,
1920
nodeTransforms: [
2021
...(options.prefixIdentifiers ? [transformExpression] : []),
2122
transformSlotOutlet,

packages/compiler-core/__tests__/transforms/vIf.spec.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,13 @@ describe('compiler: v-if', () => {
404404
expect(codegenNode.consequent).toMatchObject({
405405
type: NodeTypes.JS_CALL_EXPRESSION,
406406
callee: RENDER_SLOT,
407-
arguments: ['$slots', '"default"', createObjectMatcher({ key: `[0]` })]
407+
arguments: [
408+
'$slots',
409+
'"default"',
410+
createObjectMatcher({ key: `[0]` }),
411+
'undefined',
412+
'true'
413+
]
408414
})
409415
expect(generate(root).code).toMatchSnapshot()
410416
})
@@ -417,7 +423,13 @@ describe('compiler: v-if', () => {
417423
expect(codegenNode.consequent).toMatchObject({
418424
type: NodeTypes.JS_CALL_EXPRESSION,
419425
callee: RENDER_SLOT,
420-
arguments: ['$slots', '"default"', createObjectMatcher({ key: `[0]` })]
426+
arguments: [
427+
'$slots',
428+
'"default"',
429+
createObjectMatcher({ key: `[0]` }),
430+
'undefined',
431+
'true'
432+
]
421433
})
422434
expect(generate(root).code).toMatchSnapshot()
423435
})

packages/runtime-core/__tests__/helpers/renderSlot.spec.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ import {
66
openBlock,
77
createBlock,
88
Fragment,
9-
createCommentVNode
9+
createCommentVNode,
10+
Slot
1011
} from '../../src'
1112
import { PatchFlags } from '@vue/shared'
1213

@@ -38,7 +39,7 @@ describe('renderSlot', () => {
3839
},
3940
// mock instance
4041
{ type: {} } as any
41-
)
42+
) as Slot
4243

4344
// manual invocation should not track
4445
const manual = (openBlock(), createBlock(Fragment, null, slot()))

0 commit comments

Comments
 (0)