diff --git a/packages/compiler-ssr/__tests__/ssrFallthroughAttrs.spec.ts b/packages/compiler-ssr/__tests__/ssrFallthroughAttrs.spec.ts index 7b3d1962c3e..3adfe6480d6 100644 --- a/packages/compiler-ssr/__tests__/ssrFallthroughAttrs.spec.ts +++ b/packages/compiler-ssr/__tests__/ssrFallthroughAttrs.spec.ts @@ -48,6 +48,31 @@ describe('ssr: attrs fallthrough', () => { `) }) + //#8072 + test(`fallthrough component content (with whitespace: 'preserve')`, () => { + expect( + compile( + ` + Foo + Bar + `, + { + whitespace: 'preserve', + }, + ).code, + ).toMatchInlineSnapshot(` + "const { ssrRenderAttrs: _ssrRenderAttrs } = require("vue/server-renderer") + + return function ssrRender(_ctx, _push, _parent, _attrs) { + if (_ctx.to) { + _push(\`Foo\`) + } else { + _push(\`Bar\`) + } + }" + `) + }) + test('should not inject to fallthrough component content if not root', () => { expect(compile(`