Skip to content

Commit

Permalink
test(dialog): custom class option.
Browse files Browse the repository at this point in the history
Added missing unit test to check if overlay pane has custom panel class.

angular#4718 angular#4012
  • Loading branch information
jbojcic1 committed May 24, 2017
1 parent 9832cad commit 5944616
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/lib/core/overlay/overlay.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,24 @@ describe('Overlay', () => {

});

describe('panelClass', () => {
let config: OverlayState;

beforeEach(() => {
config = new OverlayState();
config.panelClass = 'custom-panel-class';
});

it('should apply a custom overlay pane class', () => {
let overlayRef = overlay.create(config);
overlayRef.attach(componentPortal);
viewContainerFixture.detectChanges();

let pane = overlayContainerElement.querySelector('.cdk-overlay-pane') as HTMLElement;
expect(pane.classList).toContain('custom-panel-class');
});
});

describe('scroll strategy', () => {
let fakeScrollStrategy: FakeScrollStrategy;
let config: OverlayState;
Expand Down

0 comments on commit 5944616

Please sign in to comment.