@@ -1040,34 +1040,38 @@ describe('MdSelect', () => {
1040
1040
select . style . marginRight = '20px' ;
1041
1041
} ) ;
1042
1042
1043
- it ( 'should adjust for the checkbox in ltr' , ( ) => {
1043
+ it ( 'should adjust for the checkbox in ltr' , async ( ( ) => {
1044
1044
trigger . click ( ) ;
1045
1045
multiFixture . detectChanges ( ) ;
1046
1046
1047
- const triggerLeft = trigger . getBoundingClientRect ( ) . left ;
1048
- const firstOptionLeft =
1049
- document . querySelector ( '.cdk-overlay-pane md-option' ) . getBoundingClientRect ( ) . left ;
1047
+ multiFixture . whenStable ( ) . then ( ( ) => {
1048
+ const triggerLeft = trigger . getBoundingClientRect ( ) . left ;
1049
+ const firstOptionLeft =
1050
+ document . querySelector ( '.cdk-overlay-pane md-option' ) . getBoundingClientRect ( ) . left ;
1050
1051
1051
- // 48px accounts for the checkbox size, margin and the panel's padding.
1052
- expect ( firstOptionLeft . toFixed ( 2 ) )
1053
- . toEqual ( ( triggerLeft - 48 ) . toFixed ( 2 ) ,
1054
- `Expected trigger label to align along x-axis, accounting for the checkbox.` ) ;
1055
- } ) ;
1052
+ // 48px accounts for the checkbox size, margin and the panel's padding.
1053
+ expect ( firstOptionLeft . toFixed ( 2 ) )
1054
+ . toEqual ( ( triggerLeft - 48 ) . toFixed ( 2 ) ,
1055
+ `Expected trigger label to align along x-axis, accounting for the checkbox.` ) ;
1056
+ } ) ;
1057
+ } ) ) ;
1056
1058
1057
- it ( 'should adjust for the checkbox in rtl' , ( ) => {
1059
+ it ( 'should adjust for the checkbox in rtl' , async ( ( ) => {
1058
1060
dir . value = 'rtl' ;
1059
1061
trigger . click ( ) ;
1060
1062
multiFixture . detectChanges ( ) ;
1061
1063
1062
- const triggerRight = trigger . getBoundingClientRect ( ) . right ;
1063
- const firstOptionRight =
1064
- document . querySelector ( '.cdk-overlay-pane md-option' ) . getBoundingClientRect ( ) . right ;
1064
+ multiFixture . whenStable ( ) . then ( ( ) => {
1065
+ const triggerRight = trigger . getBoundingClientRect ( ) . right ;
1066
+ const firstOptionRight =
1067
+ document . querySelector ( '.cdk-overlay-pane md-option' ) . getBoundingClientRect ( ) . right ;
1065
1068
1066
- // 48px accounts for the checkbox size, margin and the panel's padding.
1067
- expect ( firstOptionRight . toFixed ( 2 ) )
1068
- . toEqual ( ( triggerRight + 48 ) . toFixed ( 2 ) ,
1069
- `Expected trigger label to align along x-axis, accounting for the checkbox.` ) ;
1070
- } ) ;
1069
+ // 48px accounts for the checkbox size, margin and the panel's padding.
1070
+ expect ( firstOptionRight . toFixed ( 2 ) )
1071
+ . toEqual ( ( triggerRight + 48 ) . toFixed ( 2 ) ,
1072
+ `Expected trigger label to align along x-axis, accounting for the checkbox.` ) ;
1073
+ } ) ;
1074
+ } ) ) ;
1071
1075
} ) ;
1072
1076
1073
1077
} ) ;
0 commit comments