MCPcopy Create free account
hub / github.com/angular/angular / executeTest

Function executeTest

packages/core/test/acceptance/view_container_ref_spec.ts:653–671  ·  view source on GitHub ↗
(template: string)

Source from the content-addressed store, hash-verified

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(`

Callers 1

Calls 9

toHaveTextMethod · 0.80
overrideTemplateMethod · 0.65
createComponentMethod · 0.65
createMethod · 0.65
destroyMethod · 0.65
detectChangesMethod · 0.45
toArrayMethod · 0.45
forEachMethod · 0.45

Tested by

no test coverage detected