@@ -102,7 +102,7 @@ describe('MdSelect', () => {
102
102
fixture . whenStable ( ) . then ( ( ) => {
103
103
trigger . click ( ) ;
104
104
fixture . detectChanges ( ) ;
105
- const pane = overlayContainerElement . children [ 0 ] as HTMLElement ;
105
+ const pane = overlayContainerElement . querySelector ( '.md-overlay-pane' ) as HTMLElement ;
106
106
expect ( pane . style . minWidth ) . toBe ( '200px' ) ;
107
107
} ) ;
108
108
} ) ) ;
@@ -559,7 +559,7 @@ describe('MdSelect', () => {
559
559
* @param index The index of the option.
560
560
*/
561
561
function checkTriggerAlignedWithOption ( index : number ) : void {
562
- const overlayPane = overlayContainerElement . children [ 0 ] as HTMLElement ;
562
+ const overlayPane = overlayContainerElement . querySelector ( '.md-overlay-pane' ) as HTMLElement ;
563
563
564
564
// We need to set the position to absolute, because the top/left positioning won't work
565
565
// since the component CSS isn't included in the tests.
@@ -597,7 +597,8 @@ describe('MdSelect', () => {
597
597
trigger . click ( ) ;
598
598
fixture . detectChanges ( ) ;
599
599
600
- const overlayPane = overlayContainerElement . children [ 0 ] as HTMLElement ;
600
+ const overlayPane =
601
+ overlayContainerElement . querySelector ( '.md-overlay-pane' ) as HTMLElement ;
601
602
const scrollContainer = overlayPane . querySelector ( '.md-select-panel' ) ;
602
603
603
604
// The panel should be scrolled to 0 because centering the option is not possible.
@@ -614,7 +615,8 @@ describe('MdSelect', () => {
614
615
trigger . click ( ) ;
615
616
fixture . detectChanges ( ) ;
616
617
617
- const overlayPane = overlayContainerElement . children [ 0 ] as HTMLElement ;
618
+ const overlayPane =
619
+ overlayContainerElement . querySelector ( '.md-overlay-pane' ) as HTMLElement ;
618
620
const scrollContainer = overlayPane . querySelector ( '.md-select-panel' ) ;
619
621
620
622
// The panel should be scrolled to 0 because centering the option is not possible.
@@ -631,7 +633,8 @@ describe('MdSelect', () => {
631
633
trigger . click ( ) ;
632
634
fixture . detectChanges ( ) ;
633
635
634
- const overlayPane = overlayContainerElement . children [ 0 ] as HTMLElement ;
636
+ const overlayPane =
637
+ overlayContainerElement . querySelector ( '.md-overlay-pane' ) as HTMLElement ;
635
638
const scrollContainer = overlayPane . querySelector ( '.md-select-panel' ) ;
636
639
637
640
// The selected option should be scrolled to the center of the panel.
@@ -652,7 +655,8 @@ describe('MdSelect', () => {
652
655
trigger . click ( ) ;
653
656
fixture . detectChanges ( ) ;
654
657
655
- const overlayPane = overlayContainerElement . children [ 0 ] as HTMLElement ;
658
+ const overlayPane =
659
+ overlayContainerElement . querySelector ( '.md-overlay-pane' ) as HTMLElement ;
656
660
const scrollContainer = overlayPane . querySelector ( '.md-select-panel' ) ;
657
661
658
662
// The selected option should be scrolled to the max scroll position.
@@ -685,7 +689,8 @@ describe('MdSelect', () => {
685
689
trigger . click ( ) ;
686
690
fixture . detectChanges ( ) ;
687
691
688
- const overlayPane = overlayContainerElement . children [ 0 ] as HTMLElement ;
692
+ const overlayPane =
693
+ overlayContainerElement . querySelector ( '.md-overlay-pane' ) as HTMLElement ;
689
694
const scrollContainer = overlayPane . querySelector ( '.md-select-panel' ) ;
690
695
691
696
// Scroll should adjust by the difference between the top space available (85px + 8px
@@ -709,7 +714,8 @@ describe('MdSelect', () => {
709
714
trigger . click ( ) ;
710
715
fixture . detectChanges ( ) ;
711
716
712
- const overlayPane = overlayContainerElement . children [ 0 ] as HTMLElement ;
717
+ const overlayPane =
718
+ overlayContainerElement . querySelector ( '.md-overlay-pane' ) as HTMLElement ;
713
719
const scrollContainer = overlayPane . querySelector ( '.md-select-panel' ) ;
714
720
715
721
// Scroll should adjust by the difference between the bottom space available
@@ -734,7 +740,8 @@ describe('MdSelect', () => {
734
740
trigger . click ( ) ;
735
741
fixture . detectChanges ( ) ;
736
742
737
- const overlayPane = overlayContainerElement . children [ 0 ] as HTMLElement ;
743
+ const overlayPane =
744
+ overlayContainerElement . querySelector ( '.md-overlay-pane' ) as HTMLElement ;
738
745
739
746
// We need to set the position to absolute, because the top/left positioning won't work
740
747
// since the component CSS isn't included in the tests.
@@ -766,7 +773,8 @@ describe('MdSelect', () => {
766
773
trigger . click ( ) ;
767
774
fixture . detectChanges ( ) ;
768
775
769
- const overlayPane = overlayContainerElement . children [ 0 ] as HTMLElement ;
776
+ const overlayPane =
777
+ overlayContainerElement . querySelector ( '.md-overlay-pane' ) as HTMLElement ;
770
778
771
779
// We need to set the position to absolute, because the top/left positioning won't work
772
780
// since the component CSS isn't included in the tests.
@@ -855,7 +863,8 @@ describe('MdSelect', () => {
855
863
fixture . detectChanges ( ) ;
856
864
857
865
// CSS styles aren't in the tests, so position must be absolute to reflect top/left
858
- const overlayPane = overlayContainerElement . children [ 0 ] as HTMLElement ;
866
+ const overlayPane =
867
+ overlayContainerElement . querySelector ( '.md-overlay-pane' ) as HTMLElement ;
859
868
overlayPane . style . position = 'absolute' ;
860
869
861
870
const triggerBottom = trigger . getBoundingClientRect ( ) . bottom ;
@@ -882,7 +891,8 @@ describe('MdSelect', () => {
882
891
fixture . detectChanges ( ) ;
883
892
884
893
// CSS styles aren't in the tests, so position must be absolute to reflect top/left
885
- const overlayPane = overlayContainerElement . children [ 0 ] as HTMLElement ;
894
+ const overlayPane =
895
+ overlayContainerElement . querySelector ( '.md-overlay-pane' ) as HTMLElement ;
886
896
overlayPane . style . position = 'absolute' ;
887
897
888
898
const triggerTop = trigger . getBoundingClientRect ( ) . top ;
@@ -904,7 +914,8 @@ describe('MdSelect', () => {
904
914
trigger . click ( ) ;
905
915
fixture . detectChanges ( ) ;
906
916
907
- const overlayPane = overlayContainerElement . children [ 0 ] as HTMLElement ;
917
+ const overlayPane =
918
+ overlayContainerElement . querySelector ( '.md-overlay-pane' ) as HTMLElement ;
908
919
909
920
// We need to set the position to absolute, because the top/left positioning won't work
910
921
// since the component CSS isn't included in the tests.
@@ -927,7 +938,8 @@ describe('MdSelect', () => {
927
938
trigger . click ( ) ;
928
939
fixture . detectChanges ( ) ;
929
940
930
- const overlayPane = overlayContainerElement . children [ 0 ] as HTMLElement ;
941
+ const overlayPane =
942
+ overlayContainerElement . querySelector ( '.md-overlay-pane' ) as HTMLElement ;
931
943
932
944
// We need to set the position to absolute, because the top/left positioning won't work
933
945
// since the component CSS isn't included in the tests.
@@ -1168,7 +1180,7 @@ describe('MdSelect', () => {
1168
1180
trigger . click ( ) ;
1169
1181
fixture . detectChanges ( ) ;
1170
1182
1171
- const pane = overlayContainerElement . children [ 0 ] as HTMLElement ;
1183
+ const pane = overlayContainerElement . querySelector ( '.md-overlay-pane' ) as HTMLElement ;
1172
1184
expect ( pane . style . minWidth ) . toEqual ( '300px' ) ;
1173
1185
1174
1186
expect ( fixture . componentInstance . select . panelOpen ) . toBe ( true ) ;
0 commit comments