@@ -286,6 +286,34 @@ describe('ssr: components', () => {
286
286
` )
287
287
} )
288
288
289
+ // #7644
290
+ test ( 'slot content with v-once' , ( ) => {
291
+ const { code } = compile ( `<foo><bar v-once /></foo>` )
292
+ expect ( code ) . not . toMatch ( `_cache` )
293
+ expect ( compile ( `<foo><bar v-once /></foo>` ) . code ) . toMatchInlineSnapshot ( `
294
+ "const { resolveComponent: _resolveComponent, withCtx: _withCtx, createVNode: _createVNode } = require(\\"vue\\")
295
+ const { ssrRenderComponent: _ssrRenderComponent } = require(\\"vue/server-renderer\\")
296
+
297
+ return function ssrRender(_ctx, _push, _parent, _attrs) {
298
+ const _component_foo = _resolveComponent(\\"foo\\")
299
+ const _component_bar = _resolveComponent(\\"bar\\")
300
+
301
+ _push(_ssrRenderComponent(_component_foo, _attrs, {
302
+ default: _withCtx((_, _push, _parent, _scopeId) => {
303
+ if (_push) {
304
+ _push(_ssrRenderComponent(_component_bar, null, null, _parent, _scopeId))
305
+ } else {
306
+ return [
307
+ _createVNode(_component_bar)
308
+ ]
309
+ }
310
+ }),
311
+ _: 1 /* STABLE */
312
+ }, _parent))
313
+ }"
314
+ ` )
315
+ } )
316
+
289
317
describe ( 'built-in fallthroughs' , ( ) => {
290
318
test ( 'transition' , ( ) => {
291
319
expect ( compile ( `<transition><div/></transition>` ) . code )
0 commit comments