Skip to content

Commit b52e725

Browse files
jelbourncrisbeto
authored andcommitted
wip debugging
1 parent 3e30763 commit b52e725

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/lib/menu/menu.spec.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -864,24 +864,30 @@ describe('MatMenu', () => {
864864
expect(Math.round(triggerRect.top)).toBe(Math.round(panelRect.top) + MENU_PANEL_TOP_PADDING);
865865
});
866866

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(() => {
868868
dir = 'rtl';
869869
compileTestComponent();
870870
instance.rootTriggerEl.nativeElement.style.position = 'fixed';
871871
instance.rootTriggerEl.nativeElement.style.left = '10px';
872872
instance.rootTriggerEl.nativeElement.style.top = '50%';
873873
instance.rootTrigger.openMenu();
874874
fixture.detectChanges();
875+
tick(1000);
875876

876877
instance.levelOneTrigger.openMenu();
877878
fixture.detectChanges();
879+
tick(1000);
880+
881+
882+
fixture.detectChanges();
883+
tick(1000);
878884

879885
const triggerRect = overlay.querySelector('#level-one-trigger')!.getBoundingClientRect();
880886
const panelRect = overlay.querySelectorAll('.mat-menu-panel')[1].getBoundingClientRect();
881887

882888
expect(Math.round(triggerRect.right)).toBe(Math.round(panelRect.left));
883889
expect(Math.round(triggerRect.top)).toBe(Math.round(panelRect.top) + MENU_PANEL_TOP_PADDING);
884-
});
890+
}));
885891

886892
it('should close all of the menus when an item is clicked', fakeAsync(() => {
887893
compileTestComponent();
@@ -990,7 +996,7 @@ describe('MatMenu', () => {
990996
.not.toContain('mat-elevation-z3', 'Expected no stacked elevation.');
991997
});
992998

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(() => {
9941000
compileTestComponent();
9951001
instance.rootTrigger.openMenu();
9961002
fixture.detectChanges();
@@ -1007,9 +1013,10 @@ describe('MatMenu', () => {
10071013

10081014
instance.rootTrigger.closeMenu();
10091015
fixture.detectChanges();
1016+
tick(500);
10101017

10111018
expect(overlay.querySelectorAll('.mat-menu-panel').length).toBe(0, 'Expected no open menus');
1012-
});
1019+
}));
10131020

10141021
it('should toggle a nested menu when its trigger is added after init', fakeAsync(() => {
10151022
compileTestComponent();

0 commit comments

Comments
 (0)