1
1
import { MatDialogRef } from '@angular/material/dialog' ;
2
+ import { NoopAnimationsModule } from '@angular/platform-browser/animations' ;
2
3
import { render , screen } from '@testing-library/angular' ;
3
4
import userEvent from '@testing-library/user-event' ;
4
5
@@ -9,6 +10,7 @@ test('dialog closes', async () => {
9
10
10
11
const closeFn = jest . fn ( ) ;
11
12
await render ( DialogContentComponent , {
13
+ imports : [ NoopAnimationsModule ] ,
12
14
providers : [
13
15
{
14
16
provide : MatDialogRef ,
@@ -28,7 +30,9 @@ test('dialog closes', async () => {
28
30
test ( 'closes the dialog via the backdrop' , async ( ) => {
29
31
const user = userEvent . setup ( ) ;
30
32
31
- await render ( DialogComponent ) ;
33
+ await render ( DialogComponent , {
34
+ imports : [ NoopAnimationsModule ] ,
35
+ } ) ;
32
36
33
37
const openDialogButton = await screen . findByRole ( 'button' , { name : / o p e n d i a l o g / i } ) ;
34
38
await user . click ( openDialogButton ) ;
@@ -50,7 +54,9 @@ test('closes the dialog via the backdrop', async () => {
50
54
test ( 'opens and closes the dialog with buttons' , async ( ) => {
51
55
const user = userEvent . setup ( ) ;
52
56
53
- await render ( DialogComponent ) ;
57
+ await render ( DialogComponent , {
58
+ imports : [ NoopAnimationsModule ] ,
59
+ } ) ;
54
60
55
61
const openDialogButton = await screen . findByRole ( 'button' , { name : / o p e n d i a l o g / i } ) ;
56
62
await user . click ( openDialogButton ) ;
0 commit comments