@@ -864,24 +864,30 @@ describe('MatMenu', () => {
864
864
expect ( Math . round ( triggerRect . top ) ) . toBe ( Math . round ( panelRect . top ) + MENU_PANEL_TOP_PADDING ) ;
865
865
} ) ;
866
866
867
- it ( 'should fall back to aligning to the right edge of the trigger in rtl' , ( ) => {
867
+ fit ( 'should fall back to aligning to the right edge of the trigger in rtl' , fakeAsync ( ( ) => {
868
868
dir = 'rtl' ;
869
869
compileTestComponent ( ) ;
870
870
instance . rootTriggerEl . nativeElement . style . position = 'fixed' ;
871
871
instance . rootTriggerEl . nativeElement . style . left = '10px' ;
872
872
instance . rootTriggerEl . nativeElement . style . top = '50%' ;
873
873
instance . rootTrigger . openMenu ( ) ;
874
874
fixture . detectChanges ( ) ;
875
+ tick ( 1000 ) ;
875
876
876
877
instance . levelOneTrigger . openMenu ( ) ;
877
878
fixture . detectChanges ( ) ;
879
+ tick ( 1000 ) ;
880
+
881
+
882
+ fixture . detectChanges ( ) ;
883
+ tick ( 1000 ) ;
878
884
879
885
const triggerRect = overlay . querySelector ( '#level-one-trigger' ) ! . getBoundingClientRect ( ) ;
880
886
const panelRect = overlay . querySelectorAll ( '.mat-menu-panel' ) [ 1 ] . getBoundingClientRect ( ) ;
881
887
882
888
expect ( Math . round ( triggerRect . right ) ) . toBe ( Math . round ( panelRect . left ) ) ;
883
889
expect ( Math . round ( triggerRect . top ) ) . toBe ( Math . round ( panelRect . top ) + MENU_PANEL_TOP_PADDING ) ;
884
- } ) ;
890
+ } ) ) ;
885
891
886
892
it ( 'should close all of the menus when an item is clicked' , fakeAsync ( ( ) => {
887
893
compileTestComponent ( ) ;
@@ -990,7 +996,7 @@ describe('MatMenu', () => {
990
996
. not . toContain ( 'mat-elevation-z3' , 'Expected no stacked elevation.' ) ;
991
997
} ) ;
992
998
993
- it ( 'should close all of the menus when the root is closed programmatically' , ( ) => {
999
+ it ( 'should close all of the menus when the root is closed programmatically' , fakeAsync ( ( ) => {
994
1000
compileTestComponent ( ) ;
995
1001
instance . rootTrigger . openMenu ( ) ;
996
1002
fixture . detectChanges ( ) ;
@@ -1007,9 +1013,10 @@ describe('MatMenu', () => {
1007
1013
1008
1014
instance . rootTrigger . closeMenu ( ) ;
1009
1015
fixture . detectChanges ( ) ;
1016
+ tick ( 500 ) ;
1010
1017
1011
1018
expect ( overlay . querySelectorAll ( '.mat-menu-panel' ) . length ) . toBe ( 0 , 'Expected no open menus' ) ;
1012
- } ) ;
1019
+ } ) ) ;
1013
1020
1014
1021
it ( 'should toggle a nested menu when its trigger is added after init' , fakeAsync ( ( ) => {
1015
1022
compileTestComponent ( ) ;
0 commit comments