import { compile } from '../src' describe('ssr: v-if', () => { test('basic', () => { expect(compile(`
`).code).toMatchInlineSnapshot(` "const { ssrRenderAttrs: _ssrRenderAttrs } = require(\\"vue/server-renderer\\") return function ssrRender(_ctx, _push, _parent, _attrs) { if (_ctx.foo) { _push(\`\`) } else { _push(\`\`) } }" `) }) test('with nested content', () => { expect(compile(`
hellook
`).code) .toMatchInlineSnapshot(` "const { ssrRenderAttrs: _ssrRenderAttrs } = require(\\"vue/server-renderer\\") return function ssrRender(_ctx, _push, _parent, _attrs) { if (_ctx.foo) { _push(\`hellook\`) } else { _push(\`\`) } }" `) }) test('v-if + v-else', () => { expect(compile(`
`).code) .toMatchInlineSnapshot(` "const { ssrRenderAttrs: _ssrRenderAttrs } = require(\\"vue/server-renderer\\") return function ssrRender(_ctx, _push, _parent, _attrs) { if (_ctx.foo) { _push(\`
\`) } else { _push(\`\`) } }" `) }) test('v-if + v-else-if', () => { expect(compile(`
`).code) .toMatchInlineSnapshot(` "const { ssrRenderAttrs: _ssrRenderAttrs } = require(\\"vue/server-renderer\\") return function ssrRender(_ctx, _push, _parent, _attrs) { if (_ctx.foo) { _push(\`
\`) } else if (_ctx.bar) { _push(\`\`) } else { _push(\`\`) } }" `) }) test('v-if + v-else-if + v-else', () => { expect(compile(`

`).code) .toMatchInlineSnapshot(` "const { ssrRenderAttrs: _ssrRenderAttrs } = require(\\"vue/server-renderer\\") return function ssrRender(_ctx, _push, _parent, _attrs) { if (_ctx.foo) { _push(\`

\`) } else if (_ctx.bar) { _push(\`\`) } else { _push(\`

\`) } }" `) }) test('