@@ -848,24 +848,30 @@ fdescribe('MdMenu', () => {
848
848
expect ( Math . round ( triggerRect . top ) ) . toBe ( Math . round ( panelRect . top ) + MENU_PANEL_TOP_PADDING ) ;
849
849
} ) ;
850
850
851
- it ( 'should fall back to aligning to the right edge of the trigger in rtl' , ( ) => {
851
+ fit ( 'should fall back to aligning to the right edge of the trigger in rtl' , fakeAsync ( ( ) => {
852
852
dir = 'rtl' ;
853
853
compileTestComponent ( ) ;
854
854
instance . rootTriggerEl . nativeElement . style . position = 'fixed' ;
855
855
instance . rootTriggerEl . nativeElement . style . left = '10px' ;
856
856
instance . rootTriggerEl . nativeElement . style . top = '50%' ;
857
857
instance . rootTrigger . openMenu ( ) ;
858
858
fixture . detectChanges ( ) ;
859
+ tick ( 1000 ) ;
859
860
860
861
instance . levelOneTrigger . openMenu ( ) ;
861
862
fixture . detectChanges ( ) ;
863
+ tick ( 1000 ) ;
864
+
865
+
866
+ fixture . detectChanges ( ) ;
867
+ tick ( 1000 ) ;
862
868
863
869
const triggerRect = overlay . querySelector ( '#level-one-trigger' ) ! . getBoundingClientRect ( ) ;
864
870
const panelRect = overlay . querySelectorAll ( '.mat-menu-panel' ) [ 1 ] . getBoundingClientRect ( ) ;
865
871
866
872
expect ( Math . round ( triggerRect . right ) ) . toBe ( Math . round ( panelRect . left ) ) ;
867
873
expect ( Math . round ( triggerRect . top ) ) . toBe ( Math . round ( panelRect . top ) + MENU_PANEL_TOP_PADDING ) ;
868
- } ) ;
874
+ } ) ) ;
869
875
870
876
it ( 'should close all of the menus when an item is clicked' , fakeAsync ( ( ) => {
871
877
compileTestComponent ( ) ;
@@ -974,7 +980,7 @@ fdescribe('MdMenu', () => {
974
980
. not . toContain ( 'mat-elevation-z3' , 'Expected no stacked elevation.' ) ;
975
981
} ) ;
976
982
977
- it ( 'should close all of the menus when the root is closed programmatically' , ( ) => {
983
+ it ( 'should close all of the menus when the root is closed programmatically' , fakeAsync ( ( ) => {
978
984
compileTestComponent ( ) ;
979
985
instance . rootTrigger . openMenu ( ) ;
980
986
fixture . detectChanges ( ) ;
@@ -991,9 +997,10 @@ fdescribe('MdMenu', () => {
991
997
992
998
instance . rootTrigger . closeMenu ( ) ;
993
999
fixture . detectChanges ( ) ;
1000
+ tick ( 500 ) ;
994
1001
995
1002
expect ( overlay . querySelectorAll ( '.mat-menu-panel' ) . length ) . toBe ( 0 , 'Expected no open menus' ) ;
996
- } ) ;
1003
+ } ) ) ;
997
1004
998
1005
it ( 'should toggle a nested menu when its trigger is added after init' , fakeAsync ( ( ) => {
999
1006
compileTestComponent ( ) ;
0 commit comments