Skip to content

Commit

Permalink
test for v-with two way binding
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Dec 15, 2014
1 parent 47107c1 commit 15592f0
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions test/unit/specs/directives/with_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ if (_.inBrowser) {
a: 'A'
}
},
template: '<div v-component="test" v-with="testt:test,bb:b"></div>',
template: '<div v-component="test" v-with="testt:test,bb:b" v-ref="child"></div>',
components: {
test: {
template: '{{testt.a}} {{bb}}'
Expand All @@ -76,7 +76,16 @@ if (_.inBrowser) {
}
_.nextTick(function () {
expect(el.firstChild.textContent).toBe('AAAA BBB')
done()
// test two-way
vm.$.child.bb = 'B'
vm.$.child.testt = { a: 'A' }
_.nextTick(function () {
expect(el.firstChild.textContent).toBe('A B')
expect(vm.test.a).toBe('A')
expect(vm.test).toBe(vm.$.child.testt)
expect(vm.b).toBe('B')
done()
})
})
})
})
Expand Down

0 comments on commit 15592f0

Please sign in to comment.