@@ -117,9 +117,11 @@ describe('FileDownloadLinkComponent', () => {
117117 component . item = item ;
118118 fixture . detectChanges ( ) ;
119119 } ) ;
120+ it ( 'should return canDownload truthy' , ( ) => {
121+ expect ( component . canDownload$ ) . toBeObservable ( cold ( '-a' , { a : true } ) ) ;
122+ } ) ;
120123 it ( 'should return the bitstreamPath based on the input bitstream' , ( ) => {
121124 expect ( component . bitstreamPath$ ) . toBeObservable ( cold ( '-a' , { a : { routerLink : new URLCombiner ( getBitstreamModuleRoute ( ) , bitstream . uuid , 'download' ) . toString ( ) , queryParams : { } } } ) ) ;
122- expect ( component . canDownload$ ) . toBeObservable ( cold ( '--a' , { a : true } ) ) ;
123125
124126 } ) ;
125127 it ( 'should init the component' , ( ) => {
@@ -151,9 +153,11 @@ describe('FileDownloadLinkComponent', () => {
151153 component . bitstream = bitstream ;
152154 fixture . detectChanges ( ) ;
153155 } ) ;
156+ it ( 'should return canDownload falsy' , ( ) => {
157+ expect ( component . canDownload$ ) . toBeObservable ( cold ( '-a' , { a : false } ) ) ;
158+ } ) ;
154159 it ( 'should return the bitstreamPath based on the input bitstream' , ( ) => {
155- expect ( component . bitstreamPath$ ) . toBeObservable ( cold ( '-a' , { a : { routerLink : new URLCombiner ( getItemModuleRoute ( ) , item . uuid , 'request-a-copy' ) . toString ( ) , queryParams : { bitstream : bitstream . uuid } } } ) ) ;
156- expect ( component . canDownload$ ) . toBeObservable ( cold ( '--a' , { a : false } ) ) ;
160+ expect ( component . bitstreamPath$ ) . toBeObservable ( cold ( '--a' , { a : { routerLink : new URLCombiner ( getItemModuleRoute ( ) , item . uuid , 'request-a-copy' ) . toString ( ) , queryParams : { bitstream : bitstream . uuid } } } ) ) ;
157161
158162 } ) ;
159163 it ( 'should init the component' , ( ) => {
@@ -180,9 +184,11 @@ describe('FileDownloadLinkComponent', () => {
180184 component . item = item ;
181185 fixture . detectChanges ( ) ;
182186 } ) ;
187+ it ( 'should return canDownload falsy' , ( ) => {
188+ expect ( component . canDownload$ ) . toBeObservable ( cold ( '-a' , { a : false } ) ) ;
189+ } ) ;
183190 it ( 'should return the bitstreamPath based on the input bitstream' , ( ) => {
184- expect ( component . bitstreamPath$ ) . toBeObservable ( cold ( '-a' , { a : { routerLink : new URLCombiner ( getBitstreamModuleRoute ( ) , bitstream . uuid , 'download' ) . toString ( ) , queryParams : { } } } ) ) ;
185- expect ( component . canDownload$ ) . toBeObservable ( cold ( '--a' , { a : false } ) ) ;
191+ expect ( component . bitstreamPath$ ) . toBeObservable ( cold ( '--a' , { a : { routerLink : new URLCombiner ( getBitstreamModuleRoute ( ) , bitstream . uuid , 'download' ) . toString ( ) , queryParams : { } } } ) ) ;
186192
187193 } ) ;
188194 it ( 'should init the component and show the locked icon' , ( ) => {
@@ -209,9 +215,11 @@ describe('FileDownloadLinkComponent', () => {
209215 component . item = item ;
210216 fixture . detectChanges ( ) ;
211217 } ) ;
218+ it ( 'should return canDownload falsy' , ( ) => {
219+ expect ( component . canDownload$ ) . toBeObservable ( cold ( '-a' , { a : false } ) ) ;
220+ } ) ;
212221 it ( 'should return the bitstreamPath based on the access token and request-a-copy path' , ( ) => {
213- expect ( component . bitstreamPath$ ) . toBeObservable ( cold ( '-a' , { a : { routerLink : new URLCombiner ( getBitstreamModuleRoute ( ) , bitstream . uuid , 'download' ) . toString ( ) , queryParams : { accessToken : 'abc123' } } } ) ) ;
214- expect ( component . canDownload$ ) . toBeObservable ( cold ( '--a' , { a : false } ) ) ;
222+ expect ( component . bitstreamPath$ ) . toBeObservable ( cold ( '--a' , { a : { routerLink : new URLCombiner ( getBitstreamModuleRoute ( ) , bitstream . uuid , 'download' ) . toString ( ) , queryParams : { accessToken : 'abc123' } } } ) ) ;
215223
216224 } ) ;
217225 it ( 'should init the component and show an open lock' , ( ) => {
0 commit comments