Skip to content

Commit aaad733

Browse files
defccyyx990803
authored andcommitted
improve scoped slot test case (#5640)
1 parent e70f191 commit aaad733

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

test/unit/features/component/component-scoped-slot.spec.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,9 @@ describe('Component scoped slot', () => {
392392
<template v-for="n in names" :slot="n" scope="props">
393393
<span>{{ props.msg }}</span>
394394
</template>
395+
<template slot="abc" scope="props">
396+
<span>{{ props.msg }}</span>
397+
</template>
395398
</test>
396399
`,
397400
components: {
@@ -401,16 +404,17 @@ describe('Component scoped slot', () => {
401404
<div>
402405
<slot name="foo" :msg="msg + ' foo'"></slot>
403406
<slot name="bar" :msg="msg + ' bar'"></slot>
407+
<slot name="abc" :msg="msg + ' abc'"></slot>
404408
</div>
405409
`
406410
}
407411
}
408412
}).$mount()
409413

410-
expect(vm.$el.innerHTML).toBe('<span>hello foo</span> <span>hello bar</span>')
414+
expect(vm.$el.innerHTML).toBe('<span>hello foo</span> <span>hello bar</span> <span>hello abc</span>')
411415
vm.$refs.test.msg = 'world'
412416
waitForUpdate(() => {
413-
expect(vm.$el.innerHTML).toBe('<span>world foo</span> <span>world bar</span>')
417+
expect(vm.$el.innerHTML).toBe('<span>world foo</span> <span>world bar</span> <span>world abc</span>')
414418
}).then(done)
415419
})
416420
})

0 commit comments

Comments
 (0)