import { TestBed , ComponentFixture } from '@angular/core/testing' ; import { NO_ERRORS_SCHEMA } from '@angular/core' ; import { NodeFavoriteDirective , DataTableComponent , AppConfigModule } from '@alfresco/adf-core' ; import { CustomResourcesService , DocumentListComponent } from '@alfresco/adf-content-services' ; import { SharedFilesComponent } from './shared-files.component' ; import { AppTestingModule } from '../../testing/app-testing.module' ; import { Router } from '@angular/router' ; import { of } from 'rxjs' ; import { By } from '@angular/platform-browser' ; import { SharedLinkPaging } from '@alfresco/js-api' ; describe ( 'SharedFilesComponent' , ( ) => { let fixture ; let page ; beforeEach ( ( ) => { TestBed . configureTestingModule ( { imports : [ AppTestingModule , AppConfigModule ] , declarations : [ DataTableComponent , NodeFavoriteDirective , DocumentListComponent , SharedFilesComponent ] , providers : [ { provide : Router , useValue : { url : 'shared-files' } } ] , schemas : [ NO_ERRORS_SCHEMA ] } ) ; page = { list : { entries : [ { entry : { id : '1' } } , { entry : { id : '2' } } ] , pagination : { count : 2 } } } ; const customResourcesService = TestBed . inject ( CustomResourcesService ) ; spyOn ( customResourcesService , 'loadSharedLinks' ) . and . returnValue ( of ( page ) ) ; fixture = TestBed . createComponent ( SharedFilesComponent ) ; } ) ; it ( '[C280093] should not display pagination for empty data' , async ( ) => { page = { list : { pagination : { totalItems : 0 } , entries : [ ] } } ; fixture . detectChanges ( ) ; await fixture . whenStable ( ) ; const pagination = fixture . debugElement . query ( By . css ( '.adf-pagination' ) ) ; expect ( pagination ) . toBeNull ( ) ; } ) ; } ) ;