import { Component , DebugElement , NO_ERRORS_SCHEMA } from '@angular/core' ; import { ComponentFixture , TestBed } from '@angular/core/testing' ; import { NoopAnimationsModule } from '@angular/platform-browser/animations' ; import { MockSideNavItem } from '@testing/mocks/navigation' ; import { SideNavItemComponent } from './side-nav-item.component' ; const mockSideNavItem = new MockSideNavItem ( ) ; @ Component ( { template : `
        <sb-side-nav-item [sideNavItem]="sideNavItem"></sb-side-nav-item>
    ` , } ) class TestHostComponent { sideNavItem = mockSideNavItem ; } describe ( 'SideNavItemComponent' , ( ) => { let fixture ; let hostComponent ; let hostComponentDE ; let hostComponentNE ; let component ; let componentDE ; let componentNE ; beforeEach ( ( ) => { TestBed . configureTestingModule ( { declarations : [ TestHostComponent , SideNavItemComponent ] , imports : [ NoopAnimationsModule ] , providers : [ ] , 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 ; fixture . detectChanges ( ) ; } ) ; it ( 'should display the component' , ( ) => { expect ( hostComponentNE . querySelector ( 'sb-side-nav-item' ) ) . toEqual ( jasmine . anything ( ) ) ; } ) ; } ) ;