(template: string)
| 651 | |
| 652 | describe('destroy should clean the DOM in all cases:', () => { |
| 653 | function executeTest(template: string) { |
| 654 | TestBed.overrideTemplate(DestroyCasesComp, template).configureTestingModule({ |
| 655 | schemas: [NO_ERRORS_SCHEMA], |
| 656 | }); |
| 657 | |
| 658 | const fixture = TestBed.createComponent(DestroyCasesComp); |
| 659 | fixture.detectChanges(); |
| 660 | const initial = fixture.nativeElement.innerHTML; |
| 661 | |
| 662 | const structDirs = fixture.componentInstance.structDirs.toArray(); |
| 663 | |
| 664 | structDirs.forEach((structDir) => structDir.create()); |
| 665 | fixture.detectChanges(); |
| 666 | expect(fixture.nativeElement).toHaveText('Foo'); |
| 667 | |
| 668 | structDirs.forEach((structDir) => structDir.destroy()); |
| 669 | fixture.detectChanges(); |
| 670 | expect(fixture.nativeElement.innerHTML).toEqual(initial); |
| 671 | } |
| 672 | |
| 673 | it('when nested ng-container', () => { |
| 674 | executeTest(` |
no test coverage detected