Skip to content

Commit 42e7a8e

Browse files
committed
test: improve v-for key val syntax test
1 parent 588d66f commit 42e7a8e

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

test/unit/specs/directives/public/for/for_spec.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -595,15 +595,18 @@ if (_.inBrowser) {
595595
expect(hasWarned(_, 'Duplicate value')).toBe(true)
596596
})
597597

598-
it('key val syntax with object', function () {
599-
new Vue({
598+
it('key val syntax with object', function (done) {
599+
var vm = new Vue({
600600
el: el,
601-
template: '<div v-for="(key,val) in items">{{key}} {{val}}</div>',
601+
template: '<div v-for="(key,val) in items">{{$index}} {{key}} {{val.a}}</div>',
602602
data: {
603-
items: {'a': 'x'}
603+
items: {
604+
a: {a: 1},
605+
b: {a: 2}
606+
}
604607
}
605608
})
606-
expect(el.innerHTML).toBe('<div>a x</div>')
609+
assertObjectMutations(vm, el, done)
607610
})
608611

609612
it('key val syntax with array', function () {

0 commit comments

Comments
 (0)