Browse Source

add computed property ssr test case

dev
Evan You 8 years ago
parent
commit
6f7ec7f04d
  1. 23
      test/ssr/ssr-string.spec.js

23
test/ssr/ssr-string.spec.js

@ -173,6 +173,29 @@ describe('SSR: renderToString', () => {
})
})
it('computed properties', done => {
renderVmWithOptions({
template: '<div>{{ b }}</div>',
data: {
a: {
b: 1
}
},
computed: {
b () {
return this.a.b + 1
}
},
created () {
this.a.b = 2
expect(this.b).toBe(3)
}
}, result => {
expect(result).toContain('<div server-rendered="true">3</div>')
done()
})
})
it('renders asynchronous component', done => {
renderVmWithOptions({
template: `

Loading…
Cancel
Save