@@ -1179,6 +1179,59 @@ describe('vapor transition', () => {
11791179 '<div class="">vapor compA</div>' ,
11801180 )
11811181 } )
1182+
1183+ test ( 'apply transition to pre-resolved async component' , async ( ) => {
1184+ const btnSelector = '.async-resolved > button'
1185+ const containerSelector = '.async-resolved #container'
1186+ const hiddenCompSelector = '.async-resolved #hidden-async'
1187+
1188+ // Wait for the hidden AsyncCompResolved to resolve and render
1189+ await waitForInnerHTML (
1190+ hiddenCompSelector ,
1191+ '<div style="display: none;">vapor compA</div>' ,
1192+ )
1193+
1194+ expect ( await html ( containerSelector ) ) . toBe ( '' )
1195+
1196+ await click ( btnSelector )
1197+ expect ( await html ( containerSelector ) ) . toBe (
1198+ '<div class="v-enter-from v-enter-active">vapor compA</div>' ,
1199+ )
1200+ await waitForInnerHTML (
1201+ containerSelector ,
1202+ '<div class="v-enter-active v-enter-to">vapor compA</div>' ,
1203+ )
1204+ await waitForInnerHTML (
1205+ containerSelector ,
1206+ '<div class="">vapor compA</div>' ,
1207+ )
1208+
1209+ // leave
1210+ await click ( btnSelector )
1211+ await nextTick ( )
1212+ expect ( await html ( containerSelector ) ) . toBe (
1213+ '<div class="v-leave-from v-leave-active">vapor compA</div>' ,
1214+ )
1215+ await waitForInnerHTML (
1216+ containerSelector ,
1217+ '<div class="v-leave-active v-leave-to">vapor compA</div>' ,
1218+ )
1219+ await waitForInnerHTML ( containerSelector , '' )
1220+
1221+ // enter again
1222+ await click ( btnSelector )
1223+ expect ( await html ( containerSelector ) ) . toBe (
1224+ '<div class="v-enter-from v-enter-active">vapor compA</div>' ,
1225+ )
1226+ await waitForInnerHTML (
1227+ containerSelector ,
1228+ '<div class="v-enter-active v-enter-to">vapor compA</div>' ,
1229+ )
1230+ await waitForInnerHTML (
1231+ containerSelector ,
1232+ '<div class="">vapor compA</div>' ,
1233+ )
1234+ } )
11821235 } )
11831236
11841237 describe ( 'transition with v-show' , ( ) => {
0 commit comments