Skip to content

Commit 428bc4f

Browse files
committed
test for wait-for static component
1 parent 7733a65 commit 428bc4f

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

test/unit/specs/directives/component_spec.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,22 @@ if (_.inBrowser) {
263263
expect(el.innerHTML).toBe('<ul><li>1</li><li>2</li></ul>')
264264
})
265265

266-
it('wait-for', function (done) {
266+
it('wait-for for static component', function () {
267+
var vm = new Vue({
268+
el: el,
269+
template: '<view-a wait-for="ok"></view-a>',
270+
components: {
271+
'view-a': {
272+
template: 'AAA'
273+
}
274+
}
275+
})
276+
expect(el.textContent).toBe('')
277+
vm._children[0].$emit('ok')
278+
expect(el.textContent).toBe('AAA')
279+
})
280+
281+
it('wait-for for dynamic components', function (done) {
267282
var vm = new Vue({
268283
el: el,
269284
data: {

0 commit comments

Comments
 (0)