@@ -102,7 +102,7 @@ describe('MdSelect', () => {
102102 fixture . whenStable ( ) . then ( ( ) => {
103103 trigger . click ( ) ;
104104 fixture . detectChanges ( ) ;
105- const pane = overlayContainerElement . children [ 0 ] as HTMLElement ;
105+ const pane = overlayContainerElement . querySelector ( '.md-overlay-pane' ) as HTMLElement ;
106106 expect ( pane . style . minWidth ) . toBe ( '200px' ) ;
107107 } ) ;
108108 } ) ) ;
@@ -559,7 +559,7 @@ describe('MdSelect', () => {
559559 * @param index The index of the option.
560560 */
561561 function checkTriggerAlignedWithOption ( index : number ) : void {
562- const overlayPane = overlayContainerElement . children [ 0 ] as HTMLElement ;
562+ const overlayPane = overlayContainerElement . querySelector ( '.md-overlay-pane' ) as HTMLElement ;
563563
564564 // We need to set the position to absolute, because the top/left positioning won't work
565565 // since the component CSS isn't included in the tests.
@@ -597,7 +597,8 @@ describe('MdSelect', () => {
597597 trigger . click ( ) ;
598598 fixture . detectChanges ( ) ;
599599
600- const overlayPane = overlayContainerElement . children [ 0 ] as HTMLElement ;
600+ const overlayPane =
601+ overlayContainerElement . querySelector ( '.md-overlay-pane' ) as HTMLElement ;
601602 const scrollContainer = overlayPane . querySelector ( '.md-select-panel' ) ;
602603
603604 // The panel should be scrolled to 0 because centering the option is not possible.
@@ -614,7 +615,8 @@ describe('MdSelect', () => {
614615 trigger . click ( ) ;
615616 fixture . detectChanges ( ) ;
616617
617- const overlayPane = overlayContainerElement . children [ 0 ] as HTMLElement ;
618+ const overlayPane =
619+ overlayContainerElement . querySelector ( '.md-overlay-pane' ) as HTMLElement ;
618620 const scrollContainer = overlayPane . querySelector ( '.md-select-panel' ) ;
619621
620622 // The panel should be scrolled to 0 because centering the option is not possible.
@@ -631,7 +633,8 @@ describe('MdSelect', () => {
631633 trigger . click ( ) ;
632634 fixture . detectChanges ( ) ;
633635
634- const overlayPane = overlayContainerElement . children [ 0 ] as HTMLElement ;
636+ const overlayPane =
637+ overlayContainerElement . querySelector ( '.md-overlay-pane' ) as HTMLElement ;
635638 const scrollContainer = overlayPane . querySelector ( '.md-select-panel' ) ;
636639
637640 // The selected option should be scrolled to the center of the panel.
@@ -652,7 +655,8 @@ describe('MdSelect', () => {
652655 trigger . click ( ) ;
653656 fixture . detectChanges ( ) ;
654657
655- const overlayPane = overlayContainerElement . children [ 0 ] as HTMLElement ;
658+ const overlayPane =
659+ overlayContainerElement . querySelector ( '.md-overlay-pane' ) as HTMLElement ;
656660 const scrollContainer = overlayPane . querySelector ( '.md-select-panel' ) ;
657661
658662 // The selected option should be scrolled to the max scroll position.
@@ -685,7 +689,8 @@ describe('MdSelect', () => {
685689 trigger . click ( ) ;
686690 fixture . detectChanges ( ) ;
687691
688- const overlayPane = overlayContainerElement . children [ 0 ] as HTMLElement ;
692+ const overlayPane =
693+ overlayContainerElement . querySelector ( '.md-overlay-pane' ) as HTMLElement ;
689694 const scrollContainer = overlayPane . querySelector ( '.md-select-panel' ) ;
690695
691696 // Scroll should adjust by the difference between the top space available (85px + 8px
@@ -709,7 +714,8 @@ describe('MdSelect', () => {
709714 trigger . click ( ) ;
710715 fixture . detectChanges ( ) ;
711716
712- const overlayPane = overlayContainerElement . children [ 0 ] as HTMLElement ;
717+ const overlayPane =
718+ overlayContainerElement . querySelector ( '.md-overlay-pane' ) as HTMLElement ;
713719 const scrollContainer = overlayPane . querySelector ( '.md-select-panel' ) ;
714720
715721 // Scroll should adjust by the difference between the bottom space available
@@ -734,7 +740,8 @@ describe('MdSelect', () => {
734740 trigger . click ( ) ;
735741 fixture . detectChanges ( ) ;
736742
737- const overlayPane = overlayContainerElement . children [ 0 ] as HTMLElement ;
743+ const overlayPane =
744+ overlayContainerElement . querySelector ( '.md-overlay-pane' ) as HTMLElement ;
738745
739746 // We need to set the position to absolute, because the top/left positioning won't work
740747 // since the component CSS isn't included in the tests.
@@ -766,7 +773,8 @@ describe('MdSelect', () => {
766773 trigger . click ( ) ;
767774 fixture . detectChanges ( ) ;
768775
769- const overlayPane = overlayContainerElement . children [ 0 ] as HTMLElement ;
776+ const overlayPane =
777+ overlayContainerElement . querySelector ( '.md-overlay-pane' ) as HTMLElement ;
770778
771779 // We need to set the position to absolute, because the top/left positioning won't work
772780 // since the component CSS isn't included in the tests.
@@ -855,7 +863,8 @@ describe('MdSelect', () => {
855863 fixture . detectChanges ( ) ;
856864
857865 // 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 ;
859868 overlayPane . style . position = 'absolute' ;
860869
861870 const triggerBottom = trigger . getBoundingClientRect ( ) . bottom ;
@@ -882,7 +891,8 @@ describe('MdSelect', () => {
882891 fixture . detectChanges ( ) ;
883892
884893 // 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 ;
886896 overlayPane . style . position = 'absolute' ;
887897
888898 const triggerTop = trigger . getBoundingClientRect ( ) . top ;
@@ -904,7 +914,8 @@ describe('MdSelect', () => {
904914 trigger . click ( ) ;
905915 fixture . detectChanges ( ) ;
906916
907- const overlayPane = overlayContainerElement . children [ 0 ] as HTMLElement ;
917+ const overlayPane =
918+ overlayContainerElement . querySelector ( '.md-overlay-pane' ) as HTMLElement ;
908919
909920 // We need to set the position to absolute, because the top/left positioning won't work
910921 // since the component CSS isn't included in the tests.
@@ -927,7 +938,8 @@ describe('MdSelect', () => {
927938 trigger . click ( ) ;
928939 fixture . detectChanges ( ) ;
929940
930- const overlayPane = overlayContainerElement . children [ 0 ] as HTMLElement ;
941+ const overlayPane =
942+ overlayContainerElement . querySelector ( '.md-overlay-pane' ) as HTMLElement ;
931943
932944 // We need to set the position to absolute, because the top/left positioning won't work
933945 // since the component CSS isn't included in the tests.
@@ -1168,7 +1180,7 @@ describe('MdSelect', () => {
11681180 trigger . click ( ) ;
11691181 fixture . detectChanges ( ) ;
11701182
1171- const pane = overlayContainerElement . children [ 0 ] as HTMLElement ;
1183+ const pane = overlayContainerElement . querySelector ( '.md-overlay-pane' ) as HTMLElement ;
11721184 expect ( pane . style . minWidth ) . toEqual ( '300px' ) ;
11731185
11741186 expect ( fixture . componentInstance . select . panelOpen ) . toBe ( true ) ;
0 commit comments