import { BrowserDynamicTestingModule , platformBrowserDynamicTesting , } from '@angular/platform-browser-dynamic/testing' ; import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core' ; import { ComponentFixture , TestBed } from '@angular/core/testing' ; import { FormsModule } from '@angular/forms' ; import { TranslateModule } from '@ngx-translate/core' ; import { HsLayoutService } from '../layout/layout.service' ; import { HsLayoutServiceMock } from '../layout/layout.service.mock' ; import { HsMapService } from '../map/map.service' ; import { HsMapServiceMock } from '../map/map.service.mock' ; import { HsMeasureComponent } from './measure.component' ; import { HsMeasureService } from './measure.service' ; import { HsUtilsService } from '../utils/utils.service' ; import { HsUtilsServiceMock } from '../utils/utils.service.mock' ; describe ( 'HsMeasure' , ( ) => { beforeAll ( ( ) => { TestBed . resetTestEnvironment ( ) ; TestBed . initTestEnvironment ( BrowserDynamicTestingModule , platformBrowserDynamicTesting ( ) , { teardown : { destroyAfterEach : false } , } ) ; } ) ; let fixture ; let component ; let service ; beforeEach ( ( ) => { TestBed . configureTestingModule ( { schemas : [ CUSTOM_ELEMENTS_SCHEMA ] , imports : [ FormsModule , TranslateModule . forRoot ( ) ] , declarations : [ HsMeasureComponent ] , providers : [ HsMeasureService , { provide : HsLayoutService , useValue : new HsLayoutServiceMock ( ) } , { provide : HsMapService , useValue : new HsMapServiceMock ( ) } , { provide : HsUtilsService , useValue : new HsUtilsServiceMock ( ) } , ] , } ) ; fixture = TestBed . createComponent ( HsMeasureComponent ) ; service = TestBed . inject ( HsMeasureService ) ; component = fixture . componentInstance ; fixture . detectChanges ( ) ; } ) ; } ) ;