11import { MatDialogRef } from '@angular/material/dialog' ;
2+ import { NoopAnimationsModule } from '@angular/platform-browser/animations' ;
23import { render , screen } from '@testing-library/angular' ;
34import userEvent from '@testing-library/user-event' ;
45
@@ -9,6 +10,7 @@ test('dialog closes', async () => {
910
1011 const closeFn = jest . fn ( ) ;
1112 await render ( DialogContentComponent , {
13+ imports : [ NoopAnimationsModule ] ,
1214 providers : [
1315 {
1416 provide : MatDialogRef ,
@@ -28,7 +30,9 @@ test('dialog closes', async () => {
2830test ( 'closes the dialog via the backdrop' , async ( ) => {
2931 const user = userEvent . setup ( ) ;
3032
31- await render ( DialogComponent ) ;
33+ await render ( DialogComponent , {
34+ imports : [ NoopAnimationsModule ] ,
35+ } ) ;
3236
3337 const openDialogButton = await screen . findByRole ( 'button' , { name : / o p e n d i a l o g / i } ) ;
3438 await user . click ( openDialogButton ) ;
@@ -50,7 +54,9 @@ test('closes the dialog via the backdrop', async () => {
5054test ( 'opens and closes the dialog with buttons' , async ( ) => {
5155 const user = userEvent . setup ( ) ;
5256
53- await render ( DialogComponent ) ;
57+ await render ( DialogComponent , {
58+ imports : [ NoopAnimationsModule ] ,
59+ } ) ;
5460
5561 const openDialogButton = await screen . findByRole ( 'button' , { name : / o p e n d i a l o g / i } ) ;
5662 await user . click ( openDialogButton ) ;
0 commit comments