Skip to content

Commit cc4c066

Browse files
committed
fix coverage
1 parent 484e538 commit cc4c066

File tree

3 files changed

+31
-5
lines changed

3 files changed

+31
-5
lines changed

Diff for: src/core/util/props.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -162,15 +162,14 @@ function getType (fn) {
162162
}
163163

164164
function isBooleanType (fn) {
165-
const isBoolean = (fnItem) => getType(fnItem) === 'Boolean'
166-
167165
if (!Array.isArray(fn)) {
168-
return isBoolean(fn)
166+
return getType(fn) === 'Boolean'
169167
}
170168
for (let i = 0, len = fn.length; i < len; i++) {
171-
if (isBoolean(fn[i])) {
169+
if (getType(fn[i]) === 'Boolean') {
172170
return true
173171
}
174172
}
173+
/* istanbul ignore next */
175174
return false
176175
}

Diff for: test/unit/features/component/component-slot.spec.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,10 @@ describe('Component slot', () => {
565565
template: `<div><slot name="a"></slot><slot></slot></div>`
566566
},
567567
child: {
568-
template: '<div><slot></slot></div>'
568+
functional: true,
569+
render (h, { slots }) {
570+
return h('div', slots().default)
571+
}
569572
}
570573
}
571574
}).$mount()

Diff for: test/unit/features/directives/for.spec.js

+24
Original file line numberDiff line numberDiff line change
@@ -404,4 +404,28 @@ describe('Directive v-for', () => {
404404
expect(vm.$el.innerHTML).toContain('<div>Two!</div><p>One!</p>')
405405
}).then(done)
406406
})
407+
408+
it('multi nested array reactivity', done => {
409+
const vm = new Vue({
410+
data: {
411+
list: [[['foo']]]
412+
},
413+
template: `
414+
<div>
415+
<div v-for="i in list">
416+
<div v-for="j in i">
417+
<div v-for="k in j">
418+
{{ k }}
419+
</div>
420+
</div>
421+
</div>
422+
</div>
423+
`
424+
}).$mount()
425+
expect(vm.$el.textContent).toMatch(/\s+foo\s+/)
426+
vm.list[0][0].push('bar')
427+
waitForUpdate(() => {
428+
expect(vm.$el.textContent).toMatch(/\s+foo\s+bar\s+/)
429+
}).then(done)
430+
})
407431
})

0 commit comments

Comments
 (0)