@@ -151,7 +151,7 @@ describe('ObjectCacheService', () => {
151151 describe ( 'add' , ( ) => {
152152 it ( 'should dispatch an ADD action with the object to add, the time to live, and the current timestamp' , ( ) => {
153153 service . add ( objectToCache , msToLive , requestUUID , alternativeLink ) ;
154- expect ( store . dispatch ) . toHaveBeenCalledWith ( new AddToObjectCacheAction ( objectToCache , timestamp , msToLive , requestUUID , alternativeLink ) ) ;
154+ expect ( store . dispatch as jasmine . Spy ) . toHaveBeenCalledWith ( new AddToObjectCacheAction ( objectToCache , timestamp , msToLive , requestUUID , alternativeLink ) ) ;
155155 expect ( linkServiceStub . removeResolvedLinks ) . toHaveBeenCalledWith ( objectToCache ) ;
156156 } ) ;
157157 } ) ;
@@ -163,20 +163,20 @@ describe('ObjectCacheService', () => {
163163
164164 it ( 'should dispatch a REMOVE action with the self link of the object to remove' , ( ) => {
165165 service . remove ( selfLink ) ;
166- expect ( store . dispatch ) . toHaveBeenCalledWith ( new RemoveFromObjectCacheAction ( selfLink ) ) ;
166+ expect ( store . dispatch as jasmine . Spy ) . toHaveBeenCalledWith ( new RemoveFromObjectCacheAction ( selfLink ) ) ;
167167 } ) ;
168168
169169 it ( 'should dispatch a REMOVE_BY_SUBSTRING action on the index state for each alternativeLink in the object' , ( ) => {
170170 service . remove ( selfLink ) ;
171171 cacheEntry . alternativeLinks . forEach (
172- ( link : string ) => expect ( store . dispatch ) . toHaveBeenCalledWith ( new RemoveFromIndexBySubstringAction ( IndexName . ALTERNATIVE_OBJECT_LINK , link ) ) ) ;
172+ ( link : string ) => expect ( store . dispatch as jasmine . Spy ) . toHaveBeenCalledWith ( new RemoveFromIndexBySubstringAction ( IndexName . ALTERNATIVE_OBJECT_LINK , link ) ) ) ;
173173 } ) ;
174174
175175 it ( 'should dispatch a REMOVE_BY_SUBSTRING action on the index state for each _links in the object, except the self link' , ( ) => {
176176 service . remove ( selfLink ) ;
177177 Object . entries ( objectToCache . _links ) . forEach ( ( [ key , value ] : [ string , HALLink ] ) => {
178178 if ( key !== 'self' ) {
179- expect ( store . dispatch ) . toHaveBeenCalledWith ( new RemoveFromIndexBySubstringAction ( IndexName . ALTERNATIVE_OBJECT_LINK , value . href ) ) ;
179+ expect ( store . dispatch as jasmine . Spy ) . toHaveBeenCalledWith ( new RemoveFromIndexBySubstringAction ( IndexName . ALTERNATIVE_OBJECT_LINK , value . href ) ) ;
180180 }
181181 } ) ;
182182 } ) ;
@@ -345,8 +345,8 @@ describe('ObjectCacheService', () => {
345345 describe ( 'patch methods' , ( ) => {
346346 it ( 'should dispatch the correct actions when addPatch is called' , ( ) => {
347347 service . addPatch ( selfLink , operations ) ;
348- expect ( store . dispatch ) . toHaveBeenCalledWith ( new AddPatchObjectCacheAction ( selfLink , operations ) ) ;
349- expect ( store . dispatch ) . toHaveBeenCalledWith ( new AddToSSBAction ( selfLink , RestRequestMethod . PATCH ) ) ;
348+ expect ( store . dispatch as jasmine . Spy ) . toHaveBeenCalledWith ( new AddPatchObjectCacheAction ( selfLink , operations ) ) ;
349+ expect ( store . dispatch as jasmine . Spy ) . toHaveBeenCalledWith ( new AddToSSBAction ( selfLink , RestRequestMethod . PATCH ) ) ;
350350 } ) ;
351351
352352 it ( 'isDirty should return true when the patches list in the cache entry is not empty' , ( ) => {
@@ -366,7 +366,7 @@ describe('ObjectCacheService', () => {
366366 } ) ;
367367 it ( 'should dispatch the correct actions when applyPatchesToCachedObject is called' , ( ) => {
368368 ( service as any ) . applyPatchesToCachedObject ( selfLink ) ;
369- expect ( store . dispatch ) . toHaveBeenCalledWith ( new ApplyPatchObjectCacheAction ( selfLink ) ) ;
369+ expect ( store . dispatch as jasmine . Spy ) . toHaveBeenCalledWith ( new ApplyPatchObjectCacheAction ( selfLink ) ) ;
370370 } ) ;
371371 } ) ;
372372
@@ -398,12 +398,12 @@ describe('ObjectCacheService', () => {
398398 describe ( 'addDependency' , ( ) => {
399399 it ( 'should dispatch an ADD_DEPENDENTS action' , ( ) => {
400400 service . addDependency ( selfLink , 'objectWithoutDependents' ) ;
401- expect ( store . dispatch ) . toHaveBeenCalledOnceWith ( new AddDependentsObjectCacheAction ( 'objectWithoutDependents' , [ requestUUID ] ) ) ;
401+ expect ( store . dispatch as jasmine . Spy ) . toHaveBeenCalledOnceWith ( new AddDependentsObjectCacheAction ( 'objectWithoutDependents' , [ requestUUID ] ) ) ;
402402 } ) ;
403403
404404 it ( 'should resolve alt links' , ( ) => {
405405 service . addDependency ( anotherLink , 'objectWithoutDependentsAlt' ) ;
406- expect ( store . dispatch ) . toHaveBeenCalledOnceWith ( new AddDependentsObjectCacheAction ( 'objectWithoutDependents' , [ requestUUID ] ) ) ;
406+ expect ( store . dispatch as jasmine . Spy ) . toHaveBeenCalledOnceWith ( new AddDependentsObjectCacheAction ( 'objectWithoutDependents' , [ requestUUID ] ) ) ;
407407 } ) ;
408408
409409 it ( 'should not dispatch if either href cannot be resolved to a cached self link' , ( ) => {
@@ -427,7 +427,7 @@ describe('ObjectCacheService', () => {
427427
428428 it ( 'should work with observable hrefs' , ( ) => {
429429 service . addDependency ( of ( selfLink ) , of ( 'objectWithoutDependents' ) ) ;
430- expect ( store . dispatch ) . toHaveBeenCalledOnceWith ( new AddDependentsObjectCacheAction ( 'objectWithoutDependents' , [ requestUUID ] ) ) ;
430+ expect ( store . dispatch as jasmine . Spy ) . toHaveBeenCalledOnceWith ( new AddDependentsObjectCacheAction ( 'objectWithoutDependents' , [ requestUUID ] ) ) ;
431431 } ) ;
432432
433433 it ( 'should only dispatch once for the first value of either observable href' , ( ) => {
@@ -448,7 +448,7 @@ describe('ObjectCacheService', () => {
448448 service . addDependency ( href$ , dependsOnHref$ ) ;
449449 flush ( ) ;
450450
451- expect ( store . dispatch ) . toHaveBeenCalledOnceWith ( new AddDependentsObjectCacheAction ( 'objectWithoutDependents' , [ requestUUID ] ) ) ;
451+ expect ( store . dispatch as jasmine . Spy ) . toHaveBeenCalledOnceWith ( new AddDependentsObjectCacheAction ( 'objectWithoutDependents' , [ requestUUID ] ) ) ;
452452 } ) ;
453453 } ) ;
454454
@@ -473,12 +473,12 @@ describe('ObjectCacheService', () => {
473473 describe ( 'removeDependents' , ( ) => {
474474 it ( 'should dispatch a REMOVE_DEPENDENTS action' , ( ) => {
475475 service . removeDependents ( 'objectWithDependents' ) ;
476- expect ( store . dispatch ) . toHaveBeenCalledOnceWith ( new RemoveDependentsObjectCacheAction ( 'objectWithDependents' ) ) ;
476+ expect ( store . dispatch as jasmine . Spy ) . toHaveBeenCalledOnceWith ( new RemoveDependentsObjectCacheAction ( 'objectWithDependents' ) ) ;
477477 } ) ;
478478
479479 it ( 'should resolve alt links' , ( ) => {
480480 service . removeDependents ( 'objectWithDependentsAlt' ) ;
481- expect ( store . dispatch ) . toHaveBeenCalledOnceWith ( new RemoveDependentsObjectCacheAction ( 'objectWithDependents' ) ) ;
481+ expect ( store . dispatch as jasmine . Spy ) . toHaveBeenCalledOnceWith ( new RemoveDependentsObjectCacheAction ( 'objectWithDependents' ) ) ;
482482 } ) ;
483483
484484 it ( 'should not dispatch if the href cannot be resolved to a cached self link' , ( ) => {
0 commit comments