Skip to content

Commit 9eff21f

Browse files
committed
fix tests
1 parent d80132a commit 9eff21f

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

src/material/dialog/dialog.spec.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1274,7 +1274,9 @@ describe('MDC-based MatDialog', () => {
12741274
document.body.appendChild(button);
12751275
button.focus();
12761276

1277-
let dialogRef = dialog.open(PizzaMsg, {viewContainerRef: testViewContainerRef});
1277+
const dialogRef = TestBed.inject(NgZone).run(() =>
1278+
dialog.open(PizzaMsg, {viewContainerRef: testViewContainerRef}),
1279+
);
12781280

12791281
viewContainerFixture.detectChanges();
12801282
flush();
@@ -1531,10 +1533,12 @@ describe('MDC-based MatDialog', () => {
15311533
document.body.appendChild(button);
15321534
button.focus();
15331535

1534-
const dialogRef = dialog.open(PizzaMsg, {
1535-
viewContainerRef: testViewContainerRef,
1536-
restoreFocus: false,
1537-
});
1536+
const dialogRef = TestBed.inject(NgZone).run(() =>
1537+
dialog.open(PizzaMsg, {
1538+
viewContainerRef: testViewContainerRef,
1539+
restoreFocus: false,
1540+
}),
1541+
);
15381542

15391543
viewContainerFixture.detectChanges();
15401544
flush();
@@ -1567,7 +1571,9 @@ describe('MDC-based MatDialog', () => {
15671571
body.appendChild(otherButton);
15681572
button.focus();
15691573

1570-
const dialogRef = dialog.open(PizzaMsg, {viewContainerRef: testViewContainerRef});
1574+
const dialogRef = TestBed.inject(NgZone).run(() =>
1575+
dialog.open(PizzaMsg, {viewContainerRef: testViewContainerRef}),
1576+
);
15711577

15721578
viewContainerFixture.detectChanges();
15731579
flush();

0 commit comments

Comments
 (0)