From 6f7ec7f04db393f6cd962db5efbf2bd252a1602e Mon Sep 17 00:00:00 2001 From: Evan You Date: Fri, 15 Jul 2016 19:19:55 -0400 Subject: [PATCH] add computed property ssr test case --- test/ssr/ssr-string.spec.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/test/ssr/ssr-string.spec.js b/test/ssr/ssr-string.spec.js index 02af372e..b00590a0 100644 --- a/test/ssr/ssr-string.spec.js +++ b/test/ssr/ssr-string.spec.js @@ -173,6 +173,29 @@ describe('SSR: renderToString', () => { }) }) + it('computed properties', done => { + renderVmWithOptions({ + template: '
{{ b }}
', + 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('
3
') + done() + }) + }) + it('renders asynchronous component', done => { renderVmWithOptions({ template: `