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

Function createTestComponent

src/material/core/ripple/ripple.spec.ts:487–507  ·  view source on GitHub ↗
(
      rippleConfig: RippleGlobalOptions,
      testComponent: any = BasicRippleContainer,
      extraProviders: Provider[] = [],
    )

Source from the content-addressed store, hash-verified

485 let rippleDirective: MatRipple;
486
487 function createTestComponent(
488 rippleConfig: RippleGlobalOptions,
489 testComponent: any = BasicRippleContainer,
490 extraProviders: Provider[] = [],
491 ) {
492 // Reset the previously configured testing module to be able set new providers.
493 // The testing module has been initialized in the root describe group for the ripples.
494 TestBed.resetTestingModule();
495 TestBed.configureTestingModule({
496 providers: [
497 {provide: MAT_RIPPLE_GLOBAL_OPTIONS, useValue: rippleConfig},
498 ...extraProviders,
499 ],
500 });
501
502 fixture = TestBed.createComponent(testComponent);
503 fixture.detectChanges();
504
505 rippleTarget = fixture.nativeElement.querySelector('.mat-ripple');
506 rippleDirective = fixture.componentInstance.ripple;
507 }
508
509 it('should work without having any binding set', () => {
510 createTestComponent({disabled: true}, RippleContainerWithoutBindings);

Callers 1

ripple.spec.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected