8000 improve test for (index,val) syntax · noscripter/vue@9ec5cd3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9ec5cd3

Browse files
committed
improve test for (index,val) syntax
1 parent b57cdf2 commit 9ec5cd3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -609,15 +609,15 @@ if (_.inBrowser) {
609609
assertObjectMutations(vm, el, done)
610610
})
611611

612-
it('key val syntax with array', function () {
613-
new Vue({
612+
it('key val syntax with array', function (done) {
613+
var vm = new Vue({
614614
el: el,
615-
template: '<div v-for="(ind,val) in items">{{ind}} {{val}}</div>',
615+
template: '<div v-for="(i, item) in items">{{i}} {{item.a}}</div>',
616616
data: {
617-
items: ['x', 'y']
617+
items: [{a: 1}, {a: 2}]
618618
}
619619
})
620-
expect(el.innerHTML).toBe('<div>0 x</div><div>1 y</div>')
620+
assertMutations(vm, el, done)
621621
})
622622

623623
it('key val syntax with nested v-for s', function () {

0 commit comments

Comments
 (0)
0