(template: string)
| 580 | |
| 581 | describe('destroy should clean the DOM in all cases:', () => { |
| 582 | function executeTest(template: string) { |
| 583 | TestBed.overrideTemplate(DestroyCasesComp, template).configureTestingModule({ |
| 584 | schemas: [NO_ERRORS_SCHEMA], |
| 585 | }); |
| 586 | |
| 587 | const fixture = TestBed.createComponent(DestroyCasesComp); |
| 588 | fixture.detectChanges(); |
| 589 | const initial = fixture.nativeElement.innerHTML; |
| 590 | |
| 591 | const structDirs = fixture.componentInstance.structDirs.toArray(); |
| 592 | |
| 593 | structDirs.forEach((structDir) => structDir.create()); |
| 594 | fixture.detectChanges(); |
| 595 | expect(fixture.nativeElement).toHaveText('Foo'); |
| 596 | |
| 597 | structDirs.forEach((structDir) => structDir.destroy()); |
| 598 | fixture.detectChanges(); |
| 599 | expect(fixture.nativeElement.innerHTML).toEqual(initial); |
| 600 | } |
| 601 | |
| 602 | it('when nested ng-container', () => { |
| 603 | executeTest(` |
no test coverage detected