Skip to content

Commit

Permalink
rebase on sync overlay
Browse files Browse the repository at this point in the history
  • Loading branch information
jelbourn committed Aug 24, 2016
1 parent 3a5bc2c commit 7924997
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions src/lib/core/overlay/overlay.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {NgModule, Component, ViewChild, ViewContainerRef} from '@angular/core';
import {TemplatePortalDirective, PortalModule} from '../portal/portal-directives';
import {TemplatePortal, ComponentPortal} from '../portal/portal';
import {Overlay} from './overlay';
import {OverlayRef} from './overlay-ref';
import {OverlayContainer} from './overlay-container';
import {OverlayState} from './overlay-state';
import {PositionStrategy} from './position/position-strategy';
Expand Down Expand Up @@ -38,6 +37,7 @@ describe('Overlay', () => {
fixture.detectChanges();
templatePortal = fixture.componentInstance.templatePortal;
componentPortal = new ComponentPortal(PizzaMsg, fixture.componentInstance.viewContainerRef);
viewContainerFixture = fixture;
}));

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

let overlayRef = overlay.create(config).attach(componentPortal);
let overlayRef = overlay.create(config);
overlayRef.attach(componentPortal);

viewContainerFixture.whenStable().then(() => {
viewContainerFixture.detectChanges();
let backdrop = <HTMLElement> overlayContainerElement.querySelector('.md-overlay-backdrop');
expect(backdrop).toBeTruthy();
expect(backdrop.classList).not.toContain('.md-overlay-backdrop-showing');
viewContainerFixture.detectChanges();
let backdrop = <HTMLElement> overlayContainerElement.querySelector('.md-overlay-backdrop');
expect(backdrop).toBeTruthy();
expect(backdrop.classList).not.toContain('.md-overlay-backdrop-showing');

let backdropClickHandler = jasmine.createSpy('backdropClickHander');
overlayRef.backdropClick().subscribe(backdropClickHandler);
let backdropClickHandler = jasmine.createSpy('backdropClickHander');
overlayRef.backdropClick().subscribe(backdropClickHandler);

backdrop.click();
expect(backdropClickHandler).toHaveBeenCalled();
});
backdrop.click();
expect(backdropClickHandler).toHaveBeenCalled();
});
});
});
Expand Down

0 comments on commit 7924997

Please sign in to comment.