Skip to content

Commit 6f7ec7f

Browse files
committed
add computed property ssr test case
1 parent e6871a3 commit 6f7ec7f

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

test/ssr/ssr-string.spec.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,29 @@ describe('SSR: renderToString', () => {
173173
})
174174
})
175175

176+
it('computed properties', done => {
177+
renderVmWithOptions({
178+
template: '<div>{{ b }}</div>',
179+
data: {
180+
a: {
181+
b: 1
182+
}
183+
},
184+
computed: {
185+
b () {
186+
return this.a.b + 1
187+
}
188+
},
189+
created () {
190+
this.a.b = 2
191+
expect(this.b).toBe(3)
192+
}
193+
}, result => {
194+
expect(result).toContain('<div server-rendered="true">3</div>')
195+
done()
196+
})
197+
})
198+
176199
it('renders asynchronous component', done => {
177200
renderVmWithOptions({
178201
template: `

0 commit comments

Comments
 (0)