import { ComponentFixture , TestBed } from '@angular/core/testing' ; import { DropdownComponent } from './dropdown.component' ; import { MenuService } from '../menu.service' ; import Editor from '../../../Editor' ; describe ( 'DropdownComponent' , ( ) => { let component ; let fixture ; let menuService ; let editor ; beforeEach ( async ( ) => { await TestBed . configureTestingModule ( { declarations : [ DropdownComponent ] , providers : [ MenuService ] } ) . compileComponents ( ) ; } ) ; beforeEach ( ( ) => { fixture = TestBed . createComponent ( DropdownComponent ) ; component = fixture . componentInstance ; menuService = fixture . debugElement . injector . get ( MenuService ) ; editor = new Editor ( ) ; menuService . editor = editor ; component . group = 'heading' ; component . items = [ 'h1' , 'h2' ] ; fixture . detectChanges ( ) ; } ) ; afterEach ( ( ) => { editor . destroy ( ) ; } ) ; it ( 'should create' , ( ) => { expect ( component ) . toBeTruthy ( ) ; } ) ; } ) ;