@@ -111,26 +111,106 @@ describe('ssr: slot', () => {
111111 } )
112112
113113 test ( 'transition slot' , async ( ) => {
114+ const ReusableTransition = {
115+ template : `<transition><slot/></transition>` ,
116+ }
117+
118+ const ReusableTransitionWithAppear = {
119+ template : `<transition appear><slot/></transition>` ,
120+ }
121+
114122 expect (
115123 await renderToString (
116124 createApp ( {
117125 components : {
118- one : {
119- template : `<transition><slot/></transition>` ,
120- } ,
126+ one : ReusableTransition ,
121127 } ,
122128 template : `<one><div v-if="false">foo</div></one>` ,
123129 } ) ,
124130 ) ,
125131 ) . toBe ( `<!---->` )
126132
133+ expect ( await renderToString ( createApp ( ReusableTransition ) ) ) . toBe ( `<!---->` )
134+
135+ expect ( await renderToString ( createApp ( ReusableTransitionWithAppear ) ) ) . toBe (
136+ `<template><!----></template>` ,
137+ )
138+
127139 expect (
128140 await renderToString (
129141 createApp ( {
130142 components : {
131- one : {
132- template : `<transition><slot/></transition>` ,
133- } ,
143+ one : ReusableTransition ,
144+ } ,
145+ template : `<one><slot/></one>` ,
146+ } ) ,
147+ ) ,
148+ ) . toBe ( `<!---->` )
149+
150+ expect (
151+ await renderToString (
152+ createApp ( {
153+ components : {
154+ one : ReusableTransitionWithAppear ,
155+ } ,
156+ template : `<one><slot/></one>` ,
157+ } ) ,
158+ ) ,
159+ ) . toBe ( `<template><!----></template>` )
160+
161+ expect (
162+ await renderToString (
163+ createApp ( {
164+ render ( ) {
165+ return h ( ReusableTransition , null , {
166+ default : ( ) => null ,
167+ } )
168+ } ,
169+ } ) ,
170+ ) ,
171+ ) . toBe ( `<!---->` )
172+
173+ expect (
174+ await renderToString (
175+ createApp ( {
176+ render ( ) {
177+ return h ( ReusableTransitionWithAppear , null , {
178+ default : ( ) => null ,
179+ } )
180+ } ,
181+ } ) ,
182+ ) ,
183+ ) . toBe ( `<template><!----></template>` )
184+
185+ expect (
186+ await renderToString (
187+ createApp ( {
188+ render ( ) {
189+ return h ( ReusableTransitionWithAppear , null , {
190+ default : ( ) => [ ] ,
191+ } )
192+ } ,
193+ } ) ,
194+ ) ,
195+ ) . toBe ( `<template><!----></template>` )
196+
197+ expect (
198+ await renderToString (
199+ createApp ( {
200+ render ( ) {
201+ return h ( ReusableTransition , null , {
202+ default : ( ) => [ ] ,
203+ } )
204+ } ,
205+ } ) ,
206+ ) ,
207+ ) . toBe ( `<!---->` )
208+
209+ expect (
210+ await renderToString (
211+ createApp ( {
212+ components : {
213+ one : ReusableTransition ,
134214 } ,
135215 template : `<one><div v-if="true">foo</div></one>` ,
136216 } ) ,
0 commit comments