MCPcopy
hub / github.com/angular/components / createComponent

Function createComponent

src/material/chips/chip-grid.spec.ts:1093–1121  ·  view source on GitHub ↗
(
    component: Type<T>,
    direction: Direction = 'ltr',
    additionalImports: Type<unknown>[] = [],
  )

Source from the content-addressed store, hash-verified

1091 });
1092
1093 function createComponent<T>(
1094 component: Type<T>,
1095 direction: Direction = 'ltr',
1096 additionalImports: Type<unknown>[] = [],
1097 ): ComponentFixture<T> {
1098 directionality = signal(direction);
1099
1100 TestBed.configureTestingModule({
1101 imports: additionalImports,
1102 providers: [
1103 provideFakeDirectionality(directionality),
1104 {provide: MATERIAL_ANIMATIONS, useValue: {animationsDisabled: true}},
1105 ],
1106 });
1107
1108 const fixture = TestBed.createComponent<T>(component);
1109 fixture.detectChanges();
1110
1111 chipGridDebugElement = fixture.debugElement.query(By.directive(MatChipGrid))!;
1112 chipGridNativeElement = chipGridDebugElement.nativeElement;
1113 chipGridInstance = chipGridDebugElement.componentInstance;
1114 testComponent = fixture.debugElement.componentInstance;
1115 chips = chipGridInstance._chips;
1116 primaryActions = chipGridNativeElement.querySelectorAll<HTMLElement>(
1117 '.mdc-evolution-chip__action--primary',
1118 );
1119
1120 return fixture;
1121 }
1122});
1123
1124@Component({

Callers 1

chip-grid.spec.tsFile · 0.70

Calls 2

signalFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…