import { ComponentFixture , TestBed } from '@angular/core/testing' ; import { Location } from '@angular/common' ; import { SpyLocation } from '@angular/common/testing' ; import { ContentModule } from '@alfresco/adf-content-services' ; import { ProcessServicesCloudModule } from '@alfresco/adf-process-services-cloud' ; import { CoreModule , AppConfigService , AppConfigServiceMock , TranslateLoaderService } from '@alfresco/adf-core' ; import { DocumentsComponent } from './documents.component' ; import { PreviewService } from '../services/preview.service' ; import { RouterTestingModule } from '@angular/router/testing' ; import { AlfrescoApiServiceMock , AlfrescoApiService } from '@alfresco/adf-core' ; import { TranslateModule , TranslateLoader } from '@ngx-translate/core' ; describe ( 'DocumentsComponent' , ( ) => { let component ; let fixture ; beforeEach ( ( ) => { TestBed . configureTestingModule ( { imports : [ RouterTestingModule , CoreModule . forRoot ( ) , ContentModule . forRoot ( ) , ProcessServicesCloudModule , TranslateModule . forRoot ( { loader : { provide : TranslateLoader , useClass : TranslateLoaderService } } ) ] , declarations : [ DocumentsComponent ] , providers : [ PreviewService , { provide : AlfrescoApiService , useClass : AlfrescoApiServiceMock } , { provide : AppConfigService , useClass : AppConfigServiceMock } , { provide : Location , useClass : SpyLocation } ] } ) ; fixture = TestBed . createComponent ( DocumentsComponent ) ; component = fixture . componentInstance ; } ) ; it ( 'should be created' , ( ) => { fixture . detectChanges ( ) ; expect ( component ) . toBeTruthy ( ) ; } ) ; } ) ;