@@ -36,7 +36,7 @@ class FakeViewportRuler {
36
36
}
37
37
}
38
38
39
- describe ( 'MdSelect' , ( ) => {
39
+ fdescribe ( 'MdSelect' , ( ) => {
40
40
let overlayContainerElement : HTMLElement ;
41
41
let dir : { value : 'ltr' | 'rtl' } ;
42
42
let fakeViewportRuler = new FakeViewportRuler ( ) ;
@@ -932,68 +932,64 @@ describe('MdSelect', () => {
932
932
} ) ;
933
933
934
934
describe ( 'limited space to open horizontally' , ( ) => {
935
- beforeEach ( async ( ( ) => {
935
+ beforeEach ( ( ) => {
936
936
select . style . position = 'absolute' ;
937
937
select . style . top = '200px' ;
938
- } ) ) ;
938
+ } ) ;
939
939
940
- it ( 'should stay within the viewport when overflowing on the left in ltr' , async ( ( ) => {
940
+ it ( 'should stay within the viewport when overflowing on the left in ltr' , fakeAsync ( ( ) => {
941
941
select . style . left = '-100px' ;
942
942
trigger . click ( ) ;
943
+ tick ( 400 ) ;
943
944
fixture . detectChanges ( ) ;
944
945
945
- fixture . whenStable ( ) . then ( ( ) => {
946
- const panelLeft = document . querySelector ( '.mat-select-panel' )
947
- . getBoundingClientRect ( ) . left ;
948
- expect ( panelLeft ) . toBeGreaterThan ( 0 ,
949
- `Expected select panel to be inside the viewport in ltr.` ) ;
950
- } ) ;
946
+ const panelLeft = document . querySelector ( '.mat-select-panel' )
947
+ . getBoundingClientRect ( ) . left ;
948
+ expect ( panelLeft ) . toBeGreaterThan ( 0 ,
949
+ `Expected select panel to be inside the viewport in ltr.` ) ;
951
950
} ) ) ;
952
951
953
- it ( 'should stay within the viewport when overflowing on the right in rtl' , async ( ( ) => {
952
+ it ( 'should stay within the viewport when overflowing on the left in rtl' , fakeAsync ( ( ) => {
954
953
dir . value = 'rtl' ;
955
954
select . style . left = '-100px' ;
956
955
trigger . click ( ) ;
956
+ tick ( 400 ) ;
957
957
fixture . detectChanges ( ) ;
958
958
959
- fixture . whenStable ( ) . then ( ( ) => {
960
- const panelLeft = document . querySelector ( '.mat-select-panel' )
961
- . getBoundingClientRect ( ) . left ;
959
+ const panelLeft = document . querySelector ( '.mat-select-panel' )
960
+ . getBoundingClientRect ( ) . left ;
962
961
963
- expect ( panelLeft ) . toBeGreaterThan ( 0 ,
964
- `Expected select panel to be inside the viewport in rtl.` ) ;
965
- } ) ;
962
+ expect ( panelLeft ) . toBeGreaterThan ( 0 ,
963
+ `Expected select panel to be inside the viewport in rtl.` ) ;
966
964
} ) ) ;
967
965
968
- it ( 'should stay within the viewport when overflowing on the right in ltr' , async ( ( ) => {
966
+ it ( 'should stay within the viewport when overflowing on the right in ltr' , fakeAsync ( ( ) => {
969
967
select . style . right = '-100px' ;
970
968
trigger . click ( ) ;
969
+ tick ( 400 ) ;
971
970
fixture . detectChanges ( ) ;
972
971
973
- fixture . whenStable ( ) . then ( ( ) => {
974
- const viewportRect = fakeViewportRuler . getViewportRect ( ) . right ;
975
- const panelRight = document . querySelector ( '.mat-select-panel' )
976
- . getBoundingClientRect ( ) . right ;
972
+ const viewportRect = fakeViewportRuler . getViewportRect ( ) . right ;
973
+ const panelRight = document . querySelector ( '.mat-select-panel' )
974
+ . getBoundingClientRect ( ) . right ;
977
975
978
- expect ( viewportRect - panelRight ) . toBeGreaterThan ( 0 ,
979
- `Expected select panel to be inside the viewport in ltr.` ) ;
980
- } ) ;
976
+ expect ( viewportRect - panelRight ) . toBeGreaterThan ( 0 ,
977
+ `Expected select panel to be inside the viewport in ltr.` ) ;
981
978
} ) ) ;
982
979
983
- it ( 'should stay within the viewport when overflowing on the right in rtl' , async ( ( ) => {
980
+ it ( 'should stay within the viewport when overflowing on the right in rtl' , fakeAsync ( ( ) => {
984
981
dir . value = 'rtl' ;
985
982
select . style . right = '-100px' ;
986
983
trigger . click ( ) ;
984
+ tick ( 400 ) ;
987
985
fixture . detectChanges ( ) ;
988
986
989
- fixture . whenStable ( ) . then ( ( ) => {
990
- const viewportRect = fakeViewportRuler . getViewportRect ( ) . right ;
991
- const panelRight = document . querySelector ( '.mat-select-panel' )
992
- . getBoundingClientRect ( ) . right ;
987
+ const viewportRect = fakeViewportRuler . getViewportRect ( ) . right ;
988
+ const panelRight = document . querySelector ( '.mat-select-panel' )
989
+ . getBoundingClientRect ( ) . right ;
993
990
994
- expect ( viewportRect - panelRight ) . toBeGreaterThan ( 0 ,
995
- `Expected select panel to be inside the viewport in rtl.` ) ;
996
- } ) ;
991
+ expect ( viewportRect - panelRight ) . toBeGreaterThan ( 0 ,
992
+ `Expected select panel to be inside the viewport in rtl.` ) ;
997
993
} ) ) ;
998
994
999
995
it ( 'should keep the position within the viewport on repeat openings' , async ( ( ) => {
@@ -1017,6 +1013,7 @@ describe('MdSelect', () => {
1017
1013
`Expected select panel continue being inside the viewport.` ) ;
1018
1014
} ) ;
1019
1015
} ) ) ;
1016
+
1020
1017
} ) ;
1021
1018
1022
1019
describe ( 'when scrolled' , ( ) => {
0 commit comments