@@ -383,8 +383,8 @@ <h3 slot="description"><a
383383 } , 'Slots: Slots not in a shadow tree, elements only.' ) ;
384384 it ( 'createTestTree$: Slots not in a shadow tree' , ( ) =>
385385 {
386- const slotLight = $ ( test_slot_not_in_shadow ) . parent ( ) . $ ( '.light' ) . slot ( ) ;
387- const slotShadow = $ ( test_slot_not_in_shadow ) . parent ( ) . $ ( '.shadow' ) . slot ( ) ;
386+ const slotLight = $ ( test_slot_not_in_shadow ) . parent ( ) . $ ( '.light' ) . slots ( ) ;
387+ const slotShadow = $ ( test_slot_not_in_shadow ) . parent ( ) . $ ( '.shadow' ) . slots ( ) ;
388388 expect ( slotLight . assignedNodes ( ) . length ) . to . equal ( 0 ) ;
389389 expect ( slotShadow . assignedNodes ( ) . length ) . to . equal ( 0 ) ;
390390 expect ( slotLight . assignedElements ( ) . length ) . to . equal ( 0 ) ;
@@ -445,19 +445,19 @@ <h3 slot="description"><a
445445 {
446446 const shadow = $ ( test_slot_name_matching ) . parent ( ) . $ ( '.shadow' ) ;
447447 const light = $ ( test_slot_name_matching ) . parent ( ) . $ ( '.light' ) ;
448- expect ( shadow . $ ( '#c1' ) . assignedSlot ) . to . equal ( shadow . $ ( '#host' ) . slot ( 'slot1' ) [ 0 ] ) ;
448+ expect ( shadow . $ ( '#c1' ) . assignedSlot ) . to . equal ( shadow . $ ( '#host' ) . slots ( 'slot1' ) [ 0 ] ) ;
449449
450450 // assignedSlot in light DOM is not working, testing content instead
451- // expect(light .$('#c1').assignedSlot).to.equal(light .$('#host').slot ('slot1')[0]);
452- expect ( light . $ ( '#host' ) . slot ( 'slot1' ) . txt ( ) ) . to . equal ( '#c1' ) ;
451+ // expect(light .$('#c1').assignedSlot).to.equal(light .$('#host').slots ('slot1')[0]);
452+ expect ( light . $ ( '#host' ) . slots ( 'slot1' ) . txt ( ) ) . to . equal ( '#c1' ) ;
453453 expect ( light . $ ( '#s1' ) . txt ( ) ) . to . equal ( '#c1' ) ;
454454
455- expect ( shadow . $ ( '#c2' ) . assignedSlot ) . to . equal ( shadow . $ ( '#host' ) . slot ( 'slot2' ) [ 0 ] ) ;
456- expect ( light . $ ( '#host' ) . slot ( 'slot2' ) . txt ( ) ) . to . equal ( '#c2' ) ;
455+ expect ( shadow . $ ( '#c2' ) . assignedSlot ) . to . equal ( shadow . $ ( '#host' ) . slots ( 'slot2' ) [ 0 ] ) ;
456+ expect ( light . $ ( '#host' ) . slots ( 'slot2' ) . txt ( ) ) . to . equal ( '#c2' ) ;
457457 expect ( light . $ ( '#s2' ) . txt ( ) ) . to . equal ( '#c2' ) ;
458458
459459 expect ( shadow . $ ( '#c3' ) . assignedSlot ) . to . equal ( null ) ;
460- expect ( light . $ ( '#host' ) . slot ( 'xxx' ) . txt ( ) ) . to . equal ( '' ) ;
460+ expect ( light . $ ( '#host' ) . slots ( 'xxx' ) . txt ( ) ) . to . equal ( '' ) ;
461461 expect ( light . $ ( '#s3' ) . txt ( ) ) . to . equal ( '' ) ;
462462 } ) ;
463463 test ( ( ) => {
@@ -474,12 +474,12 @@ <h3 slot="description"><a
474474 {
475475 const shadow = $ ( test_no_direct_host_child ) . parent ( ) . $ ( '.shadow' ) ;
476476 const light = $ ( test_no_direct_host_child ) . parent ( ) . $ ( '.light' ) ;
477- expect ( shadow . $ ( '#c1' ) . assignedSlot ) . to . equal ( shadow . $ ( '#host' ) . slot ( 'slot1' ) [ 0 ] ) ;
477+ expect ( shadow . $ ( '#c1' ) . assignedSlot ) . to . equal ( shadow . $ ( '#host' ) . slots ( 'slot1' ) [ 0 ] ) ;
478478
479479 // assignedSlot in light DOM is not working, testing content instead
480- // expect(light .$('#c1').assignedSlot).to.equal(light .$('#host').slot ('slot1')[0]);
481- expect ( shadow . $ ( '#host' ) . slot ( 'slot1' ) . txt ( ) ) . to . equal ( '#c1#c2#s2' ) ;
482- expect ( light . $ ( '#host' ) . slot ( 'slot1' ) . txt ( ) ) . to . equal ( '#c1#c2#s2' ) ;
480+ // expect(light .$('#c1').assignedSlot).to.equal(light .$('#host').slots ('slot1')[0]);
481+ expect ( shadow . $ ( '#host' ) . slots ( 'slot1' ) . txt ( ) ) . to . equal ( '#c1#c2#s2' ) ;
482+ expect ( light . $ ( '#host' ) . slots ( 'slot1' ) . txt ( ) ) . to . equal ( '#c1#c2#s2' ) ;
483483 } ) ;
484484 test ( ( ) => {
485485 let n = createTestTree ( test_default_slot ) ;
@@ -493,14 +493,14 @@ <h3 slot="description"><a
493493 {
494494 const shadow = $ ( test_default_slot ) . parent ( ) . $ ( '.shadow' ) ;
495495 const light = $ ( test_default_slot ) . parent ( ) . $ ( '.light' ) ;
496- expect ( shadow . $ ( '#c1' ) . assignedSlot ) . to . equal ( shadow . $ ( '#host' ) . slot ( '' ) [ 0 ] ) ;
497- expect ( shadow . $ ( '#c2' ) . assignedSlot ) . to . equal ( shadow . $ ( '#host' ) . slot ( '' ) [ 0 ] ) ;
496+ expect ( shadow . $ ( '#c1' ) . assignedSlot ) . to . equal ( shadow . $ ( '#host' ) . slots ( '' ) [ 0 ] ) ;
497+ expect ( shadow . $ ( '#c2' ) . assignedSlot ) . to . equal ( shadow . $ ( '#host' ) . slots ( '' ) [ 0 ] ) ;
498498 expect ( shadow . $ ( '#c3' ) . assignedSlot ) . to . equal ( null ) ;
499499
500500 // assignedSlot in light DOM is not working, testing content instead
501- // expect(light .$('#c1').assignedSlot).to.equal(light .$('#host').slot ('slot1')[0]);
502- expect ( shadow . $ ( '#host' ) . slot ( ) . txt ( ) . replace ( / \s + / g , '' ) ) . to . equal ( '#s1#c1#c2#s3' ) ;
503- expect ( light . $ ( '#host' ) . slot ( ) . txt ( ) . replace ( / \s + / g , '' ) ) . to . equal ( '#s1#c1#c2#s3' ) ;
501+ // expect(light .$('#c1').assignedSlot).to.equal(light .$('#host').slots ('slot1')[0]);
502+ expect ( shadow . $ ( '#host' ) . slots ( ) . txt ( ) . replace ( / \s + / g , '' ) ) . to . equal ( '#s1#c1#c2#s3' ) ;
503+ expect ( light . $ ( '#host' ) . slots ( ) . txt ( ) . replace ( / \s + / g , '' ) ) . to . equal ( '#s1#c1#c2#s3' ) ;
504504 } ) ;
505505 test ( ( ) => {
506506 let n = createTestTree ( test_slot_in_slot ) ;
@@ -513,11 +513,11 @@ <h3 slot="description"><a
513513 {
514514 const shadow = $ ( test_slot_in_slot ) . parent ( ) . $ ( '.shadow' ) ;
515515 const light = $ ( test_slot_in_slot ) . parent ( ) . $ ( '.light' ) ;
516- expect ( shadow . $ ( '#c1' ) . assignedSlot ) . to . equal ( shadow . $ ( '#host' ) . slot ( 'slot2' ) [ 0 ] ) ;
517- expect ( shadow . $ ( '#c2' ) . assignedSlot ) . to . equal ( shadow . $ ( '#host' ) . slot ( 'slot1' ) [ 0 ] ) ;
516+ expect ( shadow . $ ( '#c1' ) . assignedSlot ) . to . equal ( shadow . $ ( '#host' ) . slots ( 'slot2' ) [ 0 ] ) ;
517+ expect ( shadow . $ ( '#c2' ) . assignedSlot ) . to . equal ( shadow . $ ( '#host' ) . slots ( 'slot1' ) [ 0 ] ) ;
518518
519519 // assignedSlot in light DOM is not working, testing content instead
520- // expect(light .$('#c1').assignedSlot).to.equal(light .$('#host').slot ('slot1')[0]);
520+ // expect(light .$('#c1').assignedSlot).to.equal(light .$('#host').slots ('slot1')[0]);
521521 expect ( shadow . $ ( '#host' ) . txt ( ) ) . to . equal ( '#c2' ) ;
522522 expect ( light . $ ( '#host' ) . txt ( ) ) . to . equal ( '#c2' ) ;
523523 } ) ;
@@ -538,11 +538,11 @@ <h3 slot="description"><a
538538 {
539539 const shadow = $ ( test_slot_is_assigned_to_slot ) . parent ( ) . $ ( '.shadow' ) ;
540540 const light = $ ( test_slot_is_assigned_to_slot ) . parent ( ) . $ ( '.light' ) ;
541- expect ( shadow . $ ( '#c1' ) . assignedSlot ) . to . equal ( shadow . $ ( '#host1' ) . slot ( 'slot1' ) [ 0 ] ) ;
542- expect ( shadow . $ ( '#s1' ) . assignedSlot ) . to . equal ( shadow . $ ( '#host1' ) . slot ( 'slot2' ) [ 0 ] ) ;
541+ expect ( shadow . $ ( '#c1' ) . assignedSlot ) . to . equal ( shadow . $ ( '#host1' ) . slots ( 'slot1' ) [ 0 ] ) ;
542+ expect ( shadow . $ ( '#s1' ) . assignedSlot ) . to . equal ( shadow . $ ( '#host1' ) . slots ( 'slot2' ) [ 0 ] ) ;
543543
544544 // assignedSlot in light DOM is not working, testing content instead
545- // expect(light .$('#c1').assignedSlot).to.equal(light .$('#host').slot ('slot1')[0]);
545+ // expect(light .$('#c1').assignedSlot).to.equal(light .$('#host').slots ('slot1')[0]);
546546 expect ( shadow . $ ( '#host1' ) . txt ( ) ) . to . equal ( '#c1' ) ;
547547 expect ( light . $ ( '#host1' ) . txt ( ) ) . to . equal ( '#c1' ) ;
548548 } ) ;
@@ -564,15 +564,15 @@ <h3 slot="description"><a
564564 {
565565 const shadow = $ ( test_open_closed ) . parent ( ) . $ ( '.shadow' ) ;
566566 const light = $ ( test_open_closed ) . parent ( ) . $ ( '.light' ) ;
567- expect ( shadow . $ ( '#c1' ) . assignedSlot ) . to . equal ( shadow . $ ( '#host1' ) . slot ( 'slot1' ) [ 0 ] ) ;
568- expect ( shadow . $ ( '#host1' ) . slot ( 'slot1' ) . assignedSlot ) . to . equal ( null ) ;
567+ expect ( shadow . $ ( '#c1' ) . assignedSlot ) . to . equal ( shadow . $ ( '#host1' ) . slots ( 'slot1' ) [ 0 ] ) ;
568+ expect ( shadow . $ ( '#host1' ) . slots ( 'slot1' ) . assignedSlot ) . to . equal ( null ) ;
569569 expect ( shadow . $ ( '#s1' ) . length ) . to . equal ( 0 ) ; // slot tag is replaced and not available anymore
570570
571571
572- expect ( shadow . $ ( '#host1' ) . slot ( 'slot1' ) . assignedNodes ( ) ) . to . eql ( shadow . $ ( '#c1' ) ) ;
572+ expect ( shadow . $ ( '#host1' ) . slots ( 'slot1' ) . assignedNodes ( ) ) . to . eql ( shadow . $ ( '#c1' ) ) ;
573573 // host2 shadowRoot is closed and children including slots not available.
574- // expect(shadow.$('#host1').$('#host2').slot ('slot2').assignedNodes()).to.eql(shadow.$('#host1').slot ('slot1'));
575- expect ( shadow . $ ( '#host1' ) . slot ( 'slot1' ) . assignedNodes ( { flatten : true } ) ) . to . eql ( shadow . $ ( '#c1' ) ) ;
574+ // expect(shadow.$('#host1').$('#host2').slots ('slot2').assignedNodes()).to.eql(shadow.$('#host1').slots ('slot1'));
575+ expect ( shadow . $ ( '#host1' ) . slots ( 'slot1' ) . assignedNodes ( { flatten : true } ) ) . to . eql ( shadow . $ ( '#c1' ) ) ;
576576
577577 expect ( shadow . $ ( '#host1' ) . txt ( ) ) . to . equal ( '#c1' ) ;
578578 expect ( light . $ ( '#host1' ) . txt ( ) ) . to . equal ( '#c1' ) ;
@@ -673,12 +673,12 @@ <h3 slot="description"><a
673673 assert_equals ( n [ k ] . assignedSlot , s && n [ s ] ) ; // same in prev test
674674 expect ( shadow . $ ( '#' + k ) . assignedSlot || shadow . $ ( '#host1' ) . $ ( '#' + k ) . assignedSlot || null )
675675 . to . equal ( s
676- && ( shadow . $ ( '#host1' ) . slot ( ) . find ( e => e . id === s )
677- || shadow . $ ( '#host1' ) . $ ( '#host2' ) . slot ( ) . find ( e => e . id === s )
676+ && ( shadow . $ ( '#host1' ) . slots ( ) . find ( e => e . id === s )
677+ || shadow . $ ( '#host1' ) . $ ( '#host2' ) . slots ( ) . find ( e => e . id === s )
678678 || null
679679 )
680680 ) ;
681- expect ( light . $ ( '#' + k ) . parentElement || null ) . to . equal ( s && light . $ ( '#host1' ) . slot ( ) . find ( e => e . id === s ) ) ;
681+ expect ( light . $ ( '#' + k ) . parentElement || null ) . to . equal ( s && light . $ ( '#host1' ) . slots ( ) . find ( e => e . id === s ) ) ;
682682 // node.assignedSlot in light DOM equals the parent slot
683683 } ;
684684 const assert_assignedNodes = ( k , arr ) =>
@@ -770,11 +770,11 @@ <h3 slot="description"><a
770770 const light = $ ( test_complex ) . parent ( ) . $ ( '.light' ) ;
771771
772772 shadow . $ ( '#host1' ) . append ( '<div slot="slot1" id="d1">#d1</div>' ) ;
773- expect ( shadow . $ ( '#host1' ) . slot ( 'slot1' ) . assignedNodes ( ) . map ( e => e . id ) ) . to . eql ( [ 'c1' , 'd1' ] ) ;
774- expect ( shadow . $ ( '#d1' ) . assignedSlot ) . to . eql ( shadow . $ ( '#host1' ) . slot ( 'slot1' ) [ 0 ] ) ;
773+ expect ( shadow . $ ( '#host1' ) . slots ( 'slot1' ) . assignedNodes ( ) . map ( e => e . id ) ) . to . eql ( [ 'c1' , 'd1' ] ) ;
774+ expect ( shadow . $ ( '#d1' ) . assignedSlot ) . to . eql ( shadow . $ ( '#host1' ) . slots ( 'slot1' ) [ 0 ] ) ;
775775
776776 assert_array_equals ( n . s5 . assignedNodes ( { flatten : true } ) , [ n . c1 , d1 , n . c5 ] ) ;
777- expect ( shadow . $ ( '#host1' ) . $ ( '#host2' ) . slot ( 'slot5' ) . assignedNodes ( { flatten : true } ) . map ( e => e . id ) ) . to . eql ( [ 'c1' , 'd1' , 'c5' ] ) ;
777+ expect ( shadow . $ ( '#host1' ) . $ ( '#host2' ) . slots ( 'slot5' ) . assignedNodes ( { flatten : true } ) . map ( e => e . id ) ) . to . eql ( [ 'c1' , 'd1' , 'c5' ] ) ;
778778
779779 // there is no mutation to test in light dom as content is replaced by template
780780 // and no ability to get original children for applying template again
@@ -803,7 +803,7 @@ <h3 slot="description"><a
803803
804804 shadow . $ ( '#c1' ) . attr ( 'slot' , 'slot-none' ) ;
805805 assert_array_equals ( n . s1 . assignedNodes ( ) , [ ] ) ;
806- expect ( shadow . $ ( '#host1' ) . slot ( 'slot1' ) . assignedNodes ( ) ) . to . eql ( [ ] ) ;
806+ expect ( shadow . $ ( '#host1' ) . slots ( 'slot1' ) . assignedNodes ( ) ) . to . eql ( [ ] ) ;
807807 assert_equals ( n . c1 . assignedSlot , null ) ;
808808 expect ( shadow . $ ( '#c1' ) . assignedSlot ) . to . eql ( null ) ;
809809
@@ -838,13 +838,13 @@ <h3 slot="description"><a
838838 shadow . $ ( '#c1' ) . attr ( 'slot' , 'slot2' ) ;
839839
840840 assert_array_equals ( n . s1 . assignedNodes ( ) , [ ] ) ;
841- expect ( shadow . $ ( '#host1' ) . slot ( 'slot1' ) . assignedNodes ( ) ) . to . eql ( [ ] ) ;
841+ expect ( shadow . $ ( '#host1' ) . slots ( 'slot1' ) . assignedNodes ( ) ) . to . eql ( [ ] ) ;
842842 assert_array_equals ( n . s2 . assignedNodes ( ) , [ n . c1 , n . c2 ] ) ;
843- expect ( shadow . $ ( '#host1' ) . slot ( 'slot2' ) . assignedNodes ( ) ) . to . eql ( [ n . c1 , n . c2 ] ) ;
844- assert_equals ( shadow . $ ( '#c1' ) . assignedSlot , shadow . $ ( '#host1' ) . slot ( 'slot2' ) [ 0 ] ) ;
843+ expect ( shadow . $ ( '#host1' ) . slots ( 'slot2' ) . assignedNodes ( ) ) . to . eql ( [ n . c1 , n . c2 ] ) ;
844+ assert_equals ( shadow . $ ( '#c1' ) . assignedSlot , shadow . $ ( '#host1' ) . slots ( 'slot2' ) [ 0 ] ) ;
845845
846- assert_array_equals ( shadow . $ ( '#host1' ) . $ ( '#host2' ) . slot ( 'slot5' ) . assignedNodes ( { flatten : true } ) . filter ( e => e . nodeType !== 3 ) , [ n . c5 ] ) ;
847- assert_array_equals ( shadow . $ ( '#host1' ) . $ ( '#host2' ) . slot ( 'slot6' ) . assignedNodes ( { flatten : true } ) , [ n . c1 , n . c2 , n . c6 ] ) ;
846+ assert_array_equals ( shadow . $ ( '#host1' ) . $ ( '#host2' ) . slots ( 'slot5' ) . assignedNodes ( { flatten : true } ) . filter ( e => e . nodeType !== 3 ) , [ n . c5 ] ) ;
847+ assert_array_equals ( shadow . $ ( '#host1' ) . $ ( '#host2' ) . slots ( 'slot6' ) . assignedNodes ( { flatten : true } ) , [ n . c1 , n . c2 , n . c6 ] ) ;
848848
849849 // no mutation test on light dom
850850 } ) ;
0 commit comments