@@ -22,6 +22,7 @@ import { APP_CONFIG } from 'src/config/app-config.interface';
2222import { environment } from 'src/environments/environment' ;
2323import { UUIDService } from '../../../../core/shared/uuid.service' ;
2424import { getMockUUIDService } from '../../../../shared/mocks/uuid.service.mock' ;
25+ import { Item } from '../../../../core/shared/item.model' ;
2526import { AuthorizationDataService } from '../../../../core/data/feature-authorization/authorization-data.service' ;
2627
2728describe ( 'FullFileSectionComponent' , ( ) => {
@@ -56,7 +57,7 @@ describe('FullFileSectionComponent', () => {
5657 } ) ;
5758
5859 const bitstreamDataService = jasmine . createSpyObj ( 'bitstreamDataService' , {
59- findAllByItemAndBundleName : createSuccessfulRemoteDataObject$ ( createPaginatedList ( [ mockBitstream , mockBitstream , mockBitstream ] ) )
60+ showableByItem : createSuccessfulRemoteDataObject$ ( createPaginatedList ( [ mockBitstream , mockBitstream , mockBitstream ] ) ) ,
6061 } ) ;
6162
6263 const authorizedDataService = jasmine . createSpyObj ( 'authorizedDataService' , {
@@ -91,6 +92,7 @@ describe('FullFileSectionComponent', () => {
9192 beforeEach ( waitForAsync ( ( ) => {
9293 fixture = TestBed . createComponent ( FullFileSectionComponent ) ;
9394 comp = fixture . componentInstance ;
95+ comp . item = new Item ( ) ;
9496 fixture . detectChanges ( ) ;
9597 } ) ) ;
9698
@@ -109,6 +111,7 @@ describe('FullFileSectionComponent', () => {
109111 authorizedDataService . isAuthorized . and . returnValue ( observableOf ( false ) ) ;
110112 comp . canDownload ( mockBitstream ) . subscribe ( canDownload => expect ( canDownload ) . toBeFalse ( ) ) ;
111113 } ) ) ;
114+
112115 it ( 'canDownload should return an observable with true value, if user is authorized to download bitstream' , waitForAsync ( ( ) => {
113116 authorizedDataService . isAuthorized . and . returnValue ( observableOf ( true ) ) ;
114117 comp . canDownload ( mockBitstream ) . subscribe ( canDownload => expect ( canDownload ) . toBeTrue ( ) ) ;
0 commit comments