Skip to content

Commit 7924997

Browse files
committed
rebase on sync overlay
1 parent 3a5bc2c commit 7924997

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

src/lib/core/overlay/overlay.spec.ts

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import {NgModule, Component, ViewChild, ViewContainerRef} from '@angular/core';
33
import {TemplatePortalDirective, PortalModule} from '../portal/portal-directives';
44
import {TemplatePortal, ComponentPortal} from '../portal/portal';
55
import {Overlay} from './overlay';
6-
import {OverlayRef} from './overlay-ref';
76
import {OverlayContainer} from './overlay-container';
87
import {OverlayState} from './overlay-state';
98
import {PositionStrategy} from './position/position-strategy';
@@ -38,6 +37,7 @@ describe('Overlay', () => {
3837
fixture.detectChanges();
3938
templatePortal = fixture.componentInstance.templatePortal;
4039
componentPortal = new ComponentPortal(PizzaMsg, fixture.componentInstance.viewContainerRef);
40+
viewContainerFixture = fixture;
4141
}));
4242

4343
it('should load a component into an overlay', () => {
@@ -103,20 +103,19 @@ describe('Overlay', () => {
103103
let config = new OverlayState();
104104
config.hasBackdrop = true;
105105

106-
let overlayRef = overlay.create(config).attach(componentPortal);
106+
let overlayRef = overlay.create(config);
107+
overlayRef.attach(componentPortal);
107108

108-
viewContainerFixture.whenStable().then(() => {
109-
viewContainerFixture.detectChanges();
110-
let backdrop = <HTMLElement> overlayContainerElement.querySelector('.md-overlay-backdrop');
111-
expect(backdrop).toBeTruthy();
112-
expect(backdrop.classList).not.toContain('.md-overlay-backdrop-showing');
109+
viewContainerFixture.detectChanges();
110+
let backdrop = <HTMLElement> overlayContainerElement.querySelector('.md-overlay-backdrop');
111+
expect(backdrop).toBeTruthy();
112+
expect(backdrop.classList).not.toContain('.md-overlay-backdrop-showing');
113113

114-
let backdropClickHandler = jasmine.createSpy('backdropClickHander');
115-
overlayRef.backdropClick().subscribe(backdropClickHandler);
114+
let backdropClickHandler = jasmine.createSpy('backdropClickHander');
115+
overlayRef.backdropClick().subscribe(backdropClickHandler);
116116

117-
backdrop.click();
118-
expect(backdropClickHandler).toHaveBeenCalled();
119-
});
117+
backdrop.click();
118+
expect(backdropClickHandler).toHaveBeenCalled();
120119
});
121120
});
122121
});

0 commit comments

Comments
 (0)