import { ChangeDetectorRef , Component , DebugElement , NO_ERRORS_SCHEMA } from '@angular/core' ; import { ComponentFixture , TestBed } from '@angular/core/testing' ; import { NoopAnimationsModule } from '@angular/platform-browser/animations' ; import { NavigationService } from '@modules/navigation/services' ; import { NavigationServiceStub } from '@testing/stubs' ; import { LayoutDashboardComponent } from './layout-dashboard.component' ; @ Component ( { template : `
        <sb-layout-dashboard
            [someInput]="someInput"
            (someFunction)="someFunction($event)"
        ></sb-layout-dashboard>
    ` , } ) class TestHostComponent { } describe ( 'LayoutDashboardComponent' , ( ) => { let fixture ; let hostComponent ; let hostComponentDE ; let hostComponentNE ; let component ; let componentDE ; let componentNE ; let navigationService ; beforeEach ( ( ) => { TestBed . configureTestingModule ( { declarations : [ TestHostComponent , LayoutDashboardComponent ] , imports : [ NoopAnimationsModule ] , providers : [ { provide : NavigationService , useValue : NavigationServiceStub } , ChangeDetectorRef , ] , schemas : [ NO_ERRORS_SCHEMA ] , } ) . compileComponents ( ) ; fixture = TestBed . createComponent ( TestHostComponent ) ; hostComponent = fixture . componentInstance ; hostComponentDE = fixture . debugElement ; hostComponentNE = hostComponentDE . nativeElement ; componentDE = hostComponentDE . children [ 0 ] ; component = componentDE . componentInstance ; componentNE = componentDE . nativeElement ; navigationService = TestBed . inject ( NavigationService ) ; fixture . detectChanges ( ) ; } ) ; it ( 'should display the component' , ( ) => { expect ( hostComponentNE . querySelector ( 'sb-layout-dashboard' ) ) . toEqual ( jasmine . anything ( ) ) ; } ) ; } ) ;