Skip to content

Commit 34a7797

Browse files
committed
Fix TS errors.
1 parent 67ceb9b commit 34a7797

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/lib/dialog/dialog.spec.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ import {By} from '@angular/platform-browser';
1111
import {NgModule, Component, Directive, ViewChild, ViewContainerRef, Injector} from '@angular/core';
1212
import {MdDialogModule} from './index';
1313
import {MdDialog} from './dialog';
14-
import {OverlayContainer} from '../core';
14+
import {OverlayContainer, ESCAPE} from '../core';
1515
import {MdDialogRef} from './dialog-ref';
1616
import {MdDialogContainer} from './dialog-container';
1717

18+
const FAKE_ESCAPE_KEY = { keyCode: ESCAPE } as KeyboardEvent;
1819

1920
describe('MdDialog', () => {
2021
let dialog: MdDialog;
@@ -128,7 +129,7 @@ describe('MdDialog', () => {
128129
viewContainerFixture.debugElement.query(By.directive(MdDialogContainer)).componentInstance;
129130

130131
// Fake the user pressing the escape key by calling the handler directly.
131-
dialogContainer._handleEscapeKey();
132+
dialogContainer._handleKeydown(FAKE_ESCAPE_KEY);
132133
viewContainerFixture.detectChanges();
133134

134135
viewContainerFixture.whenStable().then(() => {
@@ -347,7 +348,7 @@ describe('MdDialog', () => {
347348
By.directive(MdDialogContainer)).componentInstance;
348349

349350
// Fake the user pressing the escape key by calling the handler directly.
350-
dialogContainer._handleEscapeKey();
351+
dialogContainer._handleKeydown(FAKE_ESCAPE_KEY);
351352

352353
expect(overlayContainerElement.querySelector('md-dialog-container')).toBeTruthy();
353354
});

0 commit comments

Comments
 (0)