8000 test for nested transclusion dirs & props compiled in correct context · TonyXY/vue@375c823 · GitHub
[go: up one dir, main page]

Skip to content

Commit 375c823

Browse files
committed
test for nested transclusion dirs & props compiled in correct context
1 parent 68bfc66 commit 375c823

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

test/unit/specs/element-directives/content_spec.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,33 @@ describe('Content Transclusion', function () {
260260
})
261261
})
262262

263+
it('nested transclusion, container dirs & props', function (done) {
264+
vm = new Vue({
265+
el: el,
266+
template:
267+
'<testa>' +
268+
'<testb v-if="ok" prop="{{msg}}"></testb>' +
269+
'</testa>',
270+
data: {
271+
ok: false,
272+
msg: 'hello'
273+
},
274+
components: {
275+
testa: { template: '<content></content>' },
276+
testb: {
277+
props: ['prop'],
278+
template: '{{prop}}'
279+
}
280+
}
281+
})
282+
expect(el.innerHTML).toBe('<testa></testa>')
283+
vm.ok = true
284+
_.nextTick(function () {
285+
expect(el.innerHTML).toBe('<testa><testb>hello</testb></testa>')
286+
done()
287+
})
288+
})
289+
263290
it('single content outlet with replace: true', function () {
264291
vm = new Vue({
265292
el: el,

0 commit comments

Comments
 (0)
0