Skip to content

Commit

Permalink
fix coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Oct 11, 2016
1 parent 484e538 commit cc4c066
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 5 deletions.
7 changes: 3 additions & 4 deletions src/core/util/props.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,15 +162,14 @@ function getType (fn) {
}

function isBooleanType (fn) {
const isBoolean = (fnItem) => getType(fnItem) === 'Boolean'

if (!Array.isArray(fn)) {
return isBoolean(fn)
return getType(fn) === 'Boolean'
}
for (let i = 0, len = fn.length; i < len; i++) {
if (isBoolean(fn[i])) {
if (getType(fn[i]) === 'Boolean') {
return true
}
}
/* istanbul ignore next */
return false
}
5 changes: 4 additions & 1 deletion test/unit/features/component/component-slot.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,10 @@ describe('Component slot', () => {
template: `<div><slot name="a"></slot><slot></slot></div>`
},
child: {
template: '<div><slot></slot></div>'
functional: true,
render (h, { slots }) {
return h('div', slots().default)
}
}
}
}).$mount()
Expand Down
24 changes: 24 additions & 0 deletions test/unit/features/directives/for.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -404,4 +404,28 @@ describe('Directive v-for', () => {
expect(vm.$el.innerHTML).toContain('<div>Two!</div><p>One!</p>')
}).then(done)
})

it('multi nested array reactivity', done => {
const vm = new Vue({
data: {
list: [[['foo']]]
},
template: `
<div>
<div v-for="i in list">
<div v-for="j in i">
<div v-for="k in j">
{{ k }}
</div>
</div>
</div>
</div>
`
}).$mount()
expect(vm.$el.textContent).toMatch(/\s+foo\s+/)
vm.list[0][0].push('bar')
waitForUpdate(() => {
expect(vm.$el.textContent).toMatch(/\s+foo\s+bar\s+/)
}).then(done)
})
})

0 comments on commit cc4c066

Please sign in to comment.