@@ -104,7 +104,7 @@ describe('MdSelect', () => {
104
104
fixture . whenStable ( ) . then ( ( ) => {
105
105
trigger . click ( ) ;
106
106
fixture . detectChanges ( ) ;
107
- const pane = overlayContainerElement . children [ 0 ] as HTMLElement ;
107
+ const pane = overlayContainerElement . querySelector ( '.cdk-overlay-pane' ) as HTMLElement ;
108
108
expect ( pane . style . minWidth ) . toBe ( '200px' ) ;
109
109
} ) ;
110
110
} ) ) ;
@@ -561,7 +561,7 @@ describe('MdSelect', () => {
561
561
* @param index The index of the option.
562
562
*/
563
563
function checkTriggerAlignedWithOption ( index : number ) : void {
564
- const overlayPane = overlayContainerElement . children [ 0 ] as HTMLElement ;
564
+ const overlayPane = overlayContainerElement . querySelector ( '.cdk-overlay-pane' ) as HTMLElement ;
565
565
566
566
// We need to set the position to absolute, because the top/left positioning won't work
567
567
// since the component CSS isn't included in the tests.
@@ -599,7 +599,8 @@ describe('MdSelect', () => {
599
599
trigger . click ( ) ;
600
600
fixture . detectChanges ( ) ;
601
601
602
- const overlayPane = overlayContainerElement . children [ 0 ] as HTMLElement ;
602
+ const overlayPane =
603
+ overlayContainerElement . querySelector ( '.cdk-overlay-pane' ) as HTMLElement ;
603
604
const scrollContainer = overlayPane . querySelector ( '.md-select-panel' ) ;
604
605
605
606
// The panel should be scrolled to 0 because centering the option is not possible.
@@ -616,7 +617,8 @@ describe('MdSelect', () => {
616
617
trigger . click ( ) ;
617
618
fixture . detectChanges ( ) ;
618
619
619
- const overlayPane = overlayContainerElement . children [ 0 ] as HTMLElement ;
620
+ const overlayPane =
621
+ overlayContainerElement . querySelector ( '.cdk-overlay-pane' ) as HTMLElement ;
620
622
const scrollContainer = overlayPane . querySelector ( '.md-select-panel' ) ;
621
623
622
624
// The panel should be scrolled to 0 because centering the option is not possible.
@@ -633,7 +635,8 @@ describe('MdSelect', () => {
633
635
trigger . click ( ) ;
634
636
fixture . detectChanges ( ) ;
635
637
636
- const overlayPane = overlayContainerElement . children [ 0 ] as HTMLElement ;
638
+ const overlayPane =
639
+ overlayContainerElement . querySelector ( '.cdk-overlay-pane' ) as HTMLElement ;
637
640
const scrollContainer = overlayPane . querySelector ( '.md-select-panel' ) ;
638
641
639
642
// The selected option should be scrolled to the center of the panel.
@@ -654,7 +657,8 @@ describe('MdSelect', () => {
654
657
trigger . click ( ) ;
655
658
fixture . detectChanges ( ) ;
656
659
657
- const overlayPane = overlayContainerElement . children [ 0 ] as HTMLElement ;
660
+ const overlayPane =
661
+ overlayContainerElement . querySelector ( '.cdk-overlay-pane' ) as HTMLElement ;
658
662
const scrollContainer = overlayPane . querySelector ( '.md-select-panel' ) ;
659
663
660
664
// The selected option should be scrolled to the max scroll position.
@@ -687,7 +691,8 @@ describe('MdSelect', () => {
687
691
trigger . click ( ) ;
688
692
fixture . detectChanges ( ) ;
689
693
690
- const overlayPane = overlayContainerElement . children [ 0 ] as HTMLElement ;
694
+ const overlayPane =
695
+ overlayContainerElement . querySelector ( '.cdk-overlay-pane' ) as HTMLElement ;
691
696
const scrollContainer = overlayPane . querySelector ( '.md-select-panel' ) ;
692
697
693
698
// Scroll should adjust by the difference between the top space available (85px + 8px
@@ -711,7 +716,8 @@ describe('MdSelect', () => {
711
716
trigger . click ( ) ;
712
717
fixture . detectChanges ( ) ;
713
718
714
- const overlayPane = overlayContainerElement . children [ 0 ] as HTMLElement ;
719
+ const overlayPane =
720
+ overlayContainerElement . querySelector ( '.cdk-overlay-pane' ) as HTMLElement ;
715
721
const scrollContainer = overlayPane . querySelector ( '.md-select-panel' ) ;
716
722
717
723
// Scroll should adjust by the difference between the bottom space available
@@ -736,7 +742,8 @@ describe('MdSelect', () => {
736
742
trigger . click ( ) ;
737
743
fixture . detectChanges ( ) ;
738
744
739
- const overlayPane = overlayContainerElement . children [ 0 ] as HTMLElement ;
745
+ const overlayPane =
746
+ overlayContainerElement . querySelector ( '.cdk-overlay-pane' ) as HTMLElement ;
740
747
741
748
// We need to set the position to absolute, because the top/left positioning won't work
742
749
// since the component CSS isn't included in the tests.
@@ -768,7 +775,8 @@ describe('MdSelect', () => {
768
775
trigger . click ( ) ;
769
776
fixture . detectChanges ( ) ;
770
777
771
- const overlayPane = overlayContainerElement . children [ 0 ] as HTMLElement ;
778
+ const overlayPane =
779
+ overlayContainerElement . querySelector ( '.cdk-overlay-pane' ) as HTMLElement ;
772
780
773
781
// We need to set the position to absolute, because the top/left positioning won't work
774
782
// since the component CSS isn't included in the tests.
@@ -857,7 +865,8 @@ describe('MdSelect', () => {
857
865
fixture . detectChanges ( ) ;
858
866
859
867
// CSS styles aren't in the tests, so position must be absolute to reflect top/left
860
- const overlayPane = overlayContainerElement . children [ 0 ] as HTMLElement ;
868
+ const overlayPane =
869
+ overlayContainerElement . querySelector ( '.cdk-overlay-pane' ) as HTMLElement ;
861
870
overlayPane . style . position = 'absolute' ;
862
871
863
872
const triggerBottom = trigger . getBoundingClientRect ( ) . bottom ;
@@ -884,7 +893,8 @@ describe('MdSelect', () => {
884
893
fixture . detectChanges ( ) ;
885
894
886
895
// CSS styles aren't in the tests, so position must be absolute to reflect top/left
887
- const overlayPane = overlayContainerElement . children [ 0 ] as HTMLElement ;
896
+ const overlayPane =
897
+ overlayContainerElement . querySelector ( '.cdk-overlay-pane' ) as HTMLElement ;
888
898
overlayPane . style . position = 'absolute' ;
889
899
890
900
const triggerTop = trigger . getBoundingClientRect ( ) . top ;
@@ -906,7 +916,8 @@ describe('MdSelect', () => {
906
916
trigger . click ( ) ;
907
917
fixture . detectChanges ( ) ;
908
918
909
- const overlayPane = overlayContainerElement . children [ 0 ] as HTMLElement ;
919
+ const overlayPane =
920
+ overlayContainerElement . querySelector ( '.cdk-overlay-pane' ) as HTMLElement ;
910
921
911
922
// We need to set the position to absolute, because the top/left positioning won't work
912
923
// since the component CSS isn't included in the tests.
@@ -929,7 +940,8 @@ describe('MdSelect', () => {
929
940
trigger . click ( ) ;
930
941
fixture . detectChanges ( ) ;
931
942
932
- const overlayPane = overlayContainerElement . children [ 0 ] as HTMLElement ;
943
+ const overlayPane =
944
+ overlayContainerElement . querySelector ( '.cdk-overlay-pane' ) as HTMLElement ;
933
945
934
946
// We need to set the position to absolute, because the top/left positioning won't work
935
947
// since the component CSS isn't included in the tests.
@@ -1170,7 +1182,7 @@ describe('MdSelect', () => {
1170
1182
trigger . click ( ) ;
1171
1183
fixture . detectChanges ( ) ;
1172
1184
1173
- const pane = overlayContainerElement . children [ 0 ] as HTMLElement ;
1185
+ const pane = overlayContainerElement . querySelector ( '.cdk-overlay-pane' ) as HTMLElement ;
1174
1186
expect ( pane . style . minWidth ) . toEqual ( '300px' ) ;
1175
1187
1176
1188
expect ( fixture . componentInstance . select . panelOpen ) . toBe ( true ) ;
0 commit comments