import { NO_ERRORS_SCHEMA } from '@angular/core' ; import { TestBed , ComponentFixture } from '@angular/core/testing' ; import { AlfrescoApiService , NodeFavoriteDirective , DataTableComponent , AppConfigModule } from '@alfresco/adf-core' ; import { DocumentListComponent } from '@alfresco/adf-content-services' ; import { TrashcanComponent } from './trashcan.component' ; import { AppTestingModule } from '../../testing/app-testing.module' ; describe ( 'TrashcanComponent' , ( ) => { let fixture ; let component ; let alfrescoApi ; let page ; beforeEach ( ( ) => { page = { list : { entries : [ { entry : { id : 1 } } , { entry : { id : 2 } } ] , pagination : { data : 'data' } } } ; } ) ; beforeEach ( ( ) => { TestBed . configureTestingModule ( { imports : [ AppTestingModule , AppConfigModule ] , declarations : [ DataTableComponent , NodeFavoriteDirective , DocumentListComponent , TrashcanComponent ] , schemas : [ NO_ERRORS_SCHEMA ] } ) ; fixture = TestBed . createComponent ( TrashcanComponent ) ; component = fixture . componentInstance ; alfrescoApi = TestBed . inject ( AlfrescoApiService ) ; alfrescoApi . reset ( ) ; component . documentList = { reload : jasmine . createSpy ( 'reload' ) , resetSelection : jasmine . createSpy ( 'resetSelection' ) } as any ; } ) ; beforeEach ( ( ) => { spyOn ( component [ 'nodesApi' ] , 'getDeletedNodes' ) . and . returnValue ( Promise . resolve ( page ) ) ; } ) ; } ) ;