@@ -991,22 +991,24 @@ describe('MdSelect', () => {
991
991
`Expected trigger to align with the selected option on the x-axis in LTR.` ) ;
992
992
} ) ;
993
993
994
- it ( 'should align the trigger and the selected option on the x-axis in rtl' , ( ) => {
994
+ it ( 'should align the trigger and the selected option on the x-axis in rtl' , async ( ( ) => {
995
995
dir . value = 'rtl' ;
996
996
997
997
trigger . click ( ) ;
998
998
fixture . detectChanges ( ) ;
999
999
1000
- const triggerRight = trigger . getBoundingClientRect ( ) . right ;
1001
- const firstOptionRight =
1002
- document . querySelector ( '.cdk-overlay-pane md-option' ) . getBoundingClientRect ( ) . right ;
1003
-
1004
- // Each option is 32px wider than the trigger, so it must be adjusted 16px
1005
- // to ensure the text overlaps correctly.
1006
- expect ( firstOptionRight . toFixed ( 2 ) )
1007
- . toEqual ( ( triggerRight + 16 ) . toFixed ( 2 ) ,
1008
- `Expected trigger to align with the selected option on the x-axis in RTL.` ) ;
1009
- } ) ;
1000
+ fixture . whenStable ( ) . then ( ( ) => {
1001
+ const triggerRight = trigger . getBoundingClientRect ( ) . right ;
1002
+ const firstOptionRight =
1003
+ document . querySelector ( '.cdk-overlay-pane md-option' ) . getBoundingClientRect ( ) . right ;
1004
+
1005
+ // Each option is 32px wider than the trigger, so it must be adjusted 16px
1006
+ // to ensure the text overlaps correctly.
1007
+ expect ( firstOptionRight . toFixed ( 2 ) )
1008
+ . toEqual ( ( triggerRight + 16 ) . toFixed ( 2 ) ,
1009
+ `Expected trigger to align with the selected option on the x-axis in RTL.` ) ;
1010
+ } ) ;
1011
+ } ) ) ;
1010
1012
} ) ;
1011
1013
1012
1014
} ) ;
0 commit comments