MCPcopy Create free account
hub / github.com/angular/components / createComponent

Function createComponent

src/cdk/menu/menu-item.spec.ts:92–98  ·  view source on GitHub ↗

* Build a component for testing and render it. * @param componentClass the component to create

(componentClass: Type<T>)

Source from the content-addressed store, hash-verified

90 * @param componentClass the component to create
91 */
92 function createComponent<T>(componentClass: Type<T>) {
93 const fixture = TestBed.createComponent(componentClass);
94 fixture.detectChanges();
95
96 menuItem = fixture.debugElement.query(By.directive(CdkMenuItem)).injector.get(CdkMenuItem);
97 return fixture;
98 }
99
100 it('should get the text for a simple menu item with no nested or wrapped elements', () => {
101 createComponent(SingleMenuItem);

Callers 4

menu-item.spec.tsFile · 0.70
loadMethod · 0.50
attachComponentPortalMethod · 0.50
portal.spec.tsFile · 0.50

Calls 1

getMethod · 0.65

Tested by

no test coverage detected