(providers: Provider[] = [])
| 42 | let mockLocation: SpyLocation; |
| 43 | |
| 44 | function setup(providers: Provider[] = []) { |
| 45 | dir = signal<Direction>('ltr'); |
| 46 | TestBed.configureTestingModule({ |
| 47 | providers: [ |
| 48 | provideFakeDirectionality(dir), |
| 49 | { |
| 50 | provide: Location, |
| 51 | useClass: SpyLocation, |
| 52 | }, |
| 53 | ...providers, |
| 54 | ], |
| 55 | }); |
| 56 | |
| 57 | injector = TestBed.inject(Injector); |
| 58 | overlayContainer = TestBed.inject(OverlayContainer); |
| 59 | overlayContainerElement = overlayContainer.getContainerElement(); |
| 60 | |
| 61 | const fixture = TestBed.createComponent(TestComponentWithTemplatePortals); |
| 62 | fixture.detectChanges(); |
| 63 | templatePortal = fixture.componentInstance.templatePortal; |
| 64 | componentPortal = new ComponentPortal(PizzaMsg, fixture.componentInstance.viewContainerRef); |
| 65 | viewContainerFixture = fixture; |
| 66 | mockLocation = TestBed.inject(Location) as SpyLocation; |
| 67 | } |
| 68 | |
| 69 | function cleanup() { |
| 70 | overlayContainer.ngOnDestroy(); |
no test coverage detected