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