@@ -1196,7 +1196,7 @@ describe('PolylitMixin', () => {
1196
1196
}
1197
1197
1198
1198
render ( ) {
1199
- return html `Teleported ` ;
1199
+ return html `< slot > </ slot > ` ;
1200
1200
}
1201
1201
} ,
1202
1202
) ;
@@ -1206,7 +1206,10 @@ describe('PolylitMixin', () => {
1206
1206
render ( ) {
1207
1207
return html `
1208
1208
< div id ="title "> Title</ div >
1209
- < ${ unsafeStatic ( teleportedTag ) } id ="teleported" />
1209
+
1210
+ < ${ unsafeStatic ( teleportedTag ) } id ="teleported">
1211
+ < div id ="teleportedContent "> Teleported content</ div >
1212
+ </ ${ unsafeStatic ( teleportedTag ) } >
1210
1213
` ;
1211
1214
}
1212
1215
} ,
@@ -1223,12 +1226,17 @@ describe('PolylitMixin', () => {
1223
1226
1224
1227
it ( 'should register elements with id' , ( ) => {
1225
1228
expect ( element . $ . title ) . to . be . instanceOf ( HTMLDivElement ) ;
1226
- expect ( element . $ . title . id ) . to . equal ( 'title ' ) ;
1229
+ expect ( element . $ . title . textContent . trim ( ) ) . to . equal ( 'Title ' ) ;
1227
1230
} ) ;
1228
1231
1229
1232
it ( 'should register teleported elements with id' , ( ) => {
1230
1233
expect ( element . $ . teleported ) . to . be . instanceOf ( HTMLElement ) ;
1231
- expect ( element . $ . teleported . id ) . to . equal ( 'teleported' ) ;
1234
+ expect ( element . $ . teleported . textContent . trim ( ) ) . to . equal ( 'Teleported content' ) ;
1235
+ } ) ;
1236
+
1237
+ it ( 'should register children with id whose parent was teleported' , ( ) => {
1238
+ expect ( element . $ . teleportedContent ) . to . be . instanceOf ( HTMLElement ) ;
1239
+ expect ( element . $ . teleportedContent . textContent . trim ( ) ) . to . equal ( 'Teleported content' ) ;
1232
1240
} ) ;
1233
1241
} ) ;
1234
1242
0 commit comments