|
1 |
| -import { Component, NgModule } from '@angular/core'; |
| 1 | +import { Component, NgModule, ViewContainerRef } from '@angular/core'; |
2 | 2 | import { ComponentFixture, TestBed } from '@angular/core/testing';
|
3 | 3 | import { Router, Routes } from '@angular/router';
|
4 | 4 | import { RouterTestingModule } from '@angular/router/testing';
|
@@ -65,7 +65,12 @@ export class TestEnv {
|
65 | 65 | deps: [Router],
|
66 | 66 | },
|
67 | 67 | ]
|
68 |
| - : [], |
| 68 | + : [ |
| 69 | + { |
| 70 | + provide: ViewContainerRef, |
| 71 | + useValue: new TestViewContainerRef(), |
| 72 | + }, |
| 73 | + ], |
69 | 74 | });
|
70 | 75 |
|
71 | 76 | const router: Router = TestBed.inject(Router);
|
@@ -94,3 +99,56 @@ export class TestEnv {
|
94 | 99 | jest.clearAllMocks();
|
95 | 100 | }
|
96 | 101 | }
|
| 102 | + |
| 103 | +// create the test class |
| 104 | +export class TestViewContainerRef extends ViewContainerRef { |
| 105 | + get element(): import('@angular/core').ElementRef<any> { |
| 106 | + throw new Error('Method not implemented.'); |
| 107 | + } |
| 108 | + get injector(): import('@angular/core').Injector { |
| 109 | + throw new Error('Method not implemented.'); |
| 110 | + } |
| 111 | + get parentInjector(): import('@angular/core').Injector { |
| 112 | + throw new Error('Method not implemented.'); |
| 113 | + } |
| 114 | + clear(): void { |
| 115 | + throw new Error('Method not implemented.'); |
| 116 | + } |
| 117 | + get(_index: number): import('@angular/core').ViewRef { |
| 118 | + throw new Error('Method not implemented.'); |
| 119 | + } |
| 120 | + get length(): number { |
| 121 | + throw new Error('Method not implemented.'); |
| 122 | + } |
| 123 | + createEmbeddedView<C>( |
| 124 | + _templateRef: import('@angular/core').TemplateRef<C>, |
| 125 | + _context?: C, |
| 126 | + _index?: number, |
| 127 | + ): import('@angular/core').EmbeddedViewRef<C> { |
| 128 | + throw new Error('Method not implemented.'); |
| 129 | + } |
| 130 | + createComponent<C>( |
| 131 | + _componentFactory: import('@angular/core').ComponentFactory<C>, |
| 132 | + _index?: number, |
| 133 | + _injector?: import('@angular/core').Injector, |
| 134 | + _projectableNodes?: any[][], |
| 135 | + _ngModule?: import('@angular/core').NgModuleRef<any>, |
| 136 | + ): import('@angular/core').ComponentRef<C> { |
| 137 | + throw new Error('Method not implemented.'); |
| 138 | + } |
| 139 | + insert(_viewRef: import('@angular/core').ViewRef, _index?: number): import('@angular/core').ViewRef { |
| 140 | + throw new Error('Method not implemented.'); |
| 141 | + } |
| 142 | + move(_viewRef: import('@angular/core').ViewRef, _currentIndex: number): import('@angular/core').ViewRef { |
| 143 | + throw new Error('Method not implemented.'); |
| 144 | + } |
| 145 | + indexOf(_viewRef: import('@angular/core').ViewRef): number { |
| 146 | + throw new Error('Method not implemented.'); |
| 147 | + } |
| 148 | + remove(_index?: number): void { |
| 149 | + throw new Error('Method not implemented.'); |
| 150 | + } |
| 151 | + detach(_index?: number): import('@angular/core').ViewRef { |
| 152 | + throw new Error('Method not implemented.'); |
| 153 | + } |
| 154 | +} |
0 commit comments