@@ -187,20 +187,6 @@ describe('insert/remove', () => {
187187 expect ( fixture . nativeElement ) . toHaveText ( 'projected foo' ) ;
188188 } ) ) ;
189189
190- it ( 'should resolve components from other modules, if supplied as an NgModuleFactory' , waitForAsync ( ( ) => {
191- const compiler = TestBed . inject ( Compiler ) ;
192- let fixture = TestBed . createComponent ( TestComponent ) ;
193-
194- fixture . detectChanges ( ) ;
195- expect ( fixture . nativeElement ) . toHaveText ( '' ) ;
196-
197- fixture . componentInstance . ngModuleFactory = compiler . compileModuleSync ( TestModule2 ) ;
198- fixture . componentInstance . currentComponent = Module2InjectedComponent ;
199-
200- fixture . detectChanges ( ) ;
201- expect ( fixture . nativeElement ) . toHaveText ( 'baz' ) ;
202- } ) ) ;
203-
204190 it ( 'should resolve components from other modules, if supplied as an NgModule class reference' , waitForAsync ( ( ) => {
205191 let fixture = TestBed . createComponent ( TestComponent ) ;
206192
@@ -214,21 +200,6 @@ describe('insert/remove', () => {
214200 expect ( fixture . nativeElement ) . toHaveText ( 'baz' ) ;
215201 } ) ) ;
216202
217- it ( 'should clean up moduleRef, if supplied as an NgModuleFactory' , waitForAsync ( ( ) => {
218- const compiler = TestBed . inject ( Compiler ) ;
219- const fixture = TestBed . createComponent ( TestComponent ) ;
220- fixture . componentInstance . ngModuleFactory = compiler . compileModuleSync ( TestModule2 ) ;
221- fixture . componentInstance . currentComponent = Module2InjectedComponent ;
222- fixture . detectChanges ( ) ;
223-
224- const moduleRef = fixture . componentInstance . ngComponentOutlet ?. [ '_moduleRef' ] ! ;
225- spyOn ( moduleRef , 'destroy' ) . and . callThrough ( ) ;
226-
227- expect ( moduleRef . destroy ) . not . toHaveBeenCalled ( ) ;
228- fixture . destroy ( ) ;
229- expect ( moduleRef . destroy ) . toHaveBeenCalled ( ) ;
230- } ) ) ;
231-
232203 it ( 'should clean up moduleRef, if supplied as an NgModule class reference' , waitForAsync ( ( ) => {
233204 const fixture = TestBed . createComponent ( TestComponent ) ;
234205 fixture . componentInstance . ngModule = TestModule2 ;
@@ -243,39 +214,6 @@ describe('insert/remove', () => {
243214 expect ( moduleRef . destroy ) . toHaveBeenCalled ( ) ;
244215 } ) ) ;
245216
246- it ( "should not re-create moduleRef when it didn't actually change" , waitForAsync ( ( ) => {
247- const compiler = TestBed . inject ( Compiler ) ;
248- const fixture = TestBed . createComponent ( TestComponent ) ;
249-
250- fixture . componentInstance . ngModuleFactory = compiler . compileModuleSync ( TestModule2 ) ;
251- fixture . componentInstance . currentComponent = Module2InjectedComponent ;
252- fixture . detectChanges ( ) ;
253- expect ( fixture . nativeElement ) . toHaveText ( 'baz' ) ;
254- const moduleRef = fixture . componentInstance . ngComponentOutlet ?. [ '_moduleRef' ] ;
255-
256- fixture . componentInstance . currentComponent = Module2InjectedComponent2 ;
257- fixture . detectChanges ( ) ;
258-
259- expect ( fixture . nativeElement ) . toHaveText ( 'baz2' ) ;
260- expect ( moduleRef ) . toBe ( fixture . componentInstance . ngComponentOutlet ?. [ '_moduleRef' ] ) ;
261- } ) ) ;
262-
263- it ( 'should re-create moduleRef when changed (NgModuleFactory)' , waitForAsync ( ( ) => {
264- const compiler = TestBed . inject ( Compiler ) ;
265- const fixture = TestBed . createComponent ( TestComponent ) ;
266- fixture . componentInstance . ngModuleFactory = compiler . compileModuleSync ( TestModule2 ) ;
267- fixture . componentInstance . currentComponent = Module2InjectedComponent ;
268- fixture . detectChanges ( ) ;
269-
270- expect ( fixture . nativeElement ) . toHaveText ( 'baz' ) ;
271-
272- fixture . componentInstance . ngModuleFactory = compiler . compileModuleSync ( TestModule3 ) ;
273- fixture . componentInstance . currentComponent = Module3InjectedComponent ;
274- fixture . detectChanges ( ) ;
275-
276- expect ( fixture . nativeElement ) . toHaveText ( 'bat' ) ;
277- } ) ) ;
278-
279217 it ( 'should re-create moduleRef when changed (NgModule class reference)' , waitForAsync ( ( ) => {
280218 const fixture = TestBed . createComponent ( TestComponent ) ;
281219 fixture . componentInstance . ngModule = TestModule2 ;
@@ -438,7 +376,6 @@ const TEST_CMP_TEMPLATE = `<ng-template *ngComponentOutlet="
438376 inputs: inputs;
439377 content: projectables;
440378 ngModule: ngModule;
441- ngModuleFactory: ngModuleFactory;
442379 "></ng-template>` ;
443380@Component ( {
444381 selector : 'test-cmp' ,
@@ -452,7 +389,6 @@ class TestComponent {
452389 inputs ?: Record < string , unknown > ;
453390 projectables ?: any [ ] [ ] ;
454391 ngModule ?: Type < unknown > ;
455- ngModuleFactory ?: NgModuleFactory < unknown > ;
456392
457393 get cmpRef ( ) : ComponentRef < any > | undefined {
458394 return this . ngComponentOutlet ?. [ '_componentRef' ] ;
0 commit comments