1
1
import { Location } from '@angular/common' ;
2
2
import { SpyLocation } from '@angular/common/testing' ;
3
3
import {
4
+ ANIMATION_MODULE_TYPE ,
4
5
Component ,
5
6
ErrorHandler ,
6
7
EventEmitter ,
7
8
Injectable ,
8
9
Injector ,
9
- Type ,
10
+ Provider ,
10
11
ViewChild ,
11
12
ViewContainerRef ,
12
13
WritableSignal ,
@@ -21,7 +22,6 @@ import {
21
22
tick ,
22
23
waitForAsync ,
23
24
} from '@angular/core/testing' ;
24
- import { NoopAnimationsModule } from '@angular/platform-browser/animations' ;
25
25
import { Direction , Directionality } from '../bidi' ;
26
26
import { CdkPortal , ComponentPortal , TemplatePortal } from '../portal' ;
27
27
import { dispatchFakeEvent } from '../testing/private' ;
@@ -47,16 +47,16 @@ describe('Overlay', () => {
47
47
let dir : WritableSignal < Direction > ;
48
48
let mockLocation : SpyLocation ;
49
49
50
- function setup ( imports : Type < unknown > [ ] = [ ] ) {
50
+ function setup ( providers : Provider [ ] = [ ] ) {
51
51
dir = signal < Direction > ( 'ltr' ) ;
52
52
TestBed . configureTestingModule ( {
53
- imports,
54
53
providers : [
55
54
provideFakeDirectionality ( dir ) ,
56
55
{
57
56
provide : Location ,
58
57
useClass : SpyLocation ,
59
58
} ,
59
+ ...providers ,
60
60
] ,
61
61
} ) ;
62
62
@@ -892,7 +892,12 @@ describe('Overlay', () => {
892
892
it ( 'should set a class on the backdrop when animations are disabled' , ( ) => {
893
893
cleanup ( ) ;
894
894
TestBed . resetTestingModule ( ) ;
895
- setup ( [ NoopAnimationsModule ] ) ;
895
+ setup ( [
896
+ {
897
+ provide : ANIMATION_MODULE_TYPE ,
898
+ useValue : 'NoopAnimations' ,
899
+ } ,
900
+ ] ) ;
896
901
897
902
let overlayRef = createOverlayRef ( injector , config ) ;
898
903
overlayRef . attach ( componentPortal ) ;
0 commit comments