MCPcopy
hub / github.com/angular/angular / executeTest

Function executeTest

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

Source from the content-addressed store, hash-verified

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

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

Used in the wild real call sites across dependent graphs

searching dependent graphs…