@@ -145,7 +145,7 @@ describe('ObjectCacheService', () => {
145145 describe ( 'add' , ( ) => {
146146 it ( 'should dispatch an ADD action with the object to add, the time to live, and the current timestamp' , ( ) => {
147147 service . add ( objectToCache , msToLive , requestUUID , alternativeLink ) ;
148- expect ( store . dispatch ) . toHaveBeenCalledWith ( new AddToObjectCacheAction ( objectToCache , timestamp , msToLive , requestUUID , alternativeLink ) ) ;
148+ expect ( store . dispatch as jasmine . Spy ) . toHaveBeenCalledWith ( new AddToObjectCacheAction ( objectToCache , timestamp , msToLive , requestUUID , alternativeLink ) ) ;
149149 expect ( linkServiceStub . removeResolvedLinks ) . toHaveBeenCalledWith ( objectToCache ) ;
150150 } ) ;
151151 } ) ;
@@ -157,20 +157,20 @@ describe('ObjectCacheService', () => {
157157
158158 it ( 'should dispatch a REMOVE action with the self link of the object to remove' , ( ) => {
159159 service . remove ( selfLink ) ;
160- expect ( store . dispatch ) . toHaveBeenCalledWith ( new RemoveFromObjectCacheAction ( selfLink ) ) ;
160+ expect ( store . dispatch as jasmine . Spy ) . toHaveBeenCalledWith ( new RemoveFromObjectCacheAction ( selfLink ) ) ;
161161 } ) ;
162162
163163 it ( 'should dispatch a REMOVE_BY_SUBSTRING action on the index state for each alternativeLink in the object' , ( ) => {
164164 service . remove ( selfLink ) ;
165165 cacheEntry . alternativeLinks . forEach (
166- ( link : string ) => expect ( store . dispatch ) . toHaveBeenCalledWith ( new RemoveFromIndexBySubstringAction ( IndexName . ALTERNATIVE_OBJECT_LINK , link ) ) ) ;
166+ ( link : string ) => expect ( store . dispatch as jasmine . Spy ) . toHaveBeenCalledWith ( new RemoveFromIndexBySubstringAction ( IndexName . ALTERNATIVE_OBJECT_LINK , link ) ) ) ;
167167 } ) ;
168168
169169 it ( 'should dispatch a REMOVE_BY_SUBSTRING action on the index state for each _links in the object, except the self link' , ( ) => {
170170 service . remove ( selfLink ) ;
171171 Object . entries ( objectToCache . _links ) . forEach ( ( [ key , value ] : [ string , HALLink ] ) => {
172172 if ( key !== 'self' ) {
173- expect ( store . dispatch ) . toHaveBeenCalledWith ( new RemoveFromIndexBySubstringAction ( IndexName . ALTERNATIVE_OBJECT_LINK , value . href ) ) ;
173+ expect ( store . dispatch as jasmine . Spy ) . toHaveBeenCalledWith ( new RemoveFromIndexBySubstringAction ( IndexName . ALTERNATIVE_OBJECT_LINK , value . href ) ) ;
174174 }
175175 } ) ;
176176 } ) ;
@@ -339,8 +339,8 @@ describe('ObjectCacheService', () => {
339339 describe ( 'patch methods' , ( ) => {
340340 it ( 'should dispatch the correct actions when addPatch is called' , ( ) => {
341341 service . addPatch ( selfLink , operations ) ;
342- expect ( store . dispatch ) . toHaveBeenCalledWith ( new AddPatchObjectCacheAction ( selfLink , operations ) ) ;
343- expect ( store . dispatch ) . toHaveBeenCalledWith ( new AddToSSBAction ( selfLink , RestRequestMethod . PATCH ) ) ;
342+ expect ( store . dispatch as jasmine . Spy ) . toHaveBeenCalledWith ( new AddPatchObjectCacheAction ( selfLink , operations ) ) ;
343+ expect ( store . dispatch as jasmine . Spy ) . toHaveBeenCalledWith ( new AddToSSBAction ( selfLink , RestRequestMethod . PATCH ) ) ;
344344 } ) ;
345345
346346 it ( 'isDirty should return true when the patches list in the cache entry is not empty' , ( ) => {
@@ -360,7 +360,7 @@ describe('ObjectCacheService', () => {
360360 } ) ;
361361 it ( 'should dispatch the correct actions when applyPatchesToCachedObject is called' , ( ) => {
362362 ( service as any ) . applyPatchesToCachedObject ( selfLink ) ;
363- expect ( store . dispatch ) . toHaveBeenCalledWith ( new ApplyPatchObjectCacheAction ( selfLink ) ) ;
363+ expect ( store . dispatch as jasmine . Spy ) . toHaveBeenCalledWith ( new ApplyPatchObjectCacheAction ( selfLink ) ) ;
364364 } ) ;
365365 } ) ;
366366
@@ -392,12 +392,12 @@ describe('ObjectCacheService', () => {
392392 describe ( 'addDependency' , ( ) => {
393393 it ( 'should dispatch an ADD_DEPENDENTS action' , ( ) => {
394394 service . addDependency ( selfLink , 'objectWithoutDependents' ) ;
395- expect ( store . dispatch ) . toHaveBeenCalledOnceWith ( new AddDependentsObjectCacheAction ( 'objectWithoutDependents' , [ requestUUID ] ) ) ;
395+ expect ( store . dispatch as jasmine . Spy ) . toHaveBeenCalledOnceWith ( new AddDependentsObjectCacheAction ( 'objectWithoutDependents' , [ requestUUID ] ) ) ;
396396 } ) ;
397397
398398 it ( 'should resolve alt links' , ( ) => {
399399 service . addDependency ( anotherLink , 'objectWithoutDependentsAlt' ) ;
400- expect ( store . dispatch ) . toHaveBeenCalledOnceWith ( new AddDependentsObjectCacheAction ( 'objectWithoutDependents' , [ requestUUID ] ) ) ;
400+ expect ( store . dispatch as jasmine . Spy ) . toHaveBeenCalledOnceWith ( new AddDependentsObjectCacheAction ( 'objectWithoutDependents' , [ requestUUID ] ) ) ;
401401 } ) ;
402402
403403 it ( 'should not dispatch if either href cannot be resolved to a cached self link' , ( ) => {
@@ -421,7 +421,7 @@ describe('ObjectCacheService', () => {
421421
422422 it ( 'should work with observable hrefs' , ( ) => {
423423 service . addDependency ( of ( selfLink ) , of ( 'objectWithoutDependents' ) ) ;
424- expect ( store . dispatch ) . toHaveBeenCalledOnceWith ( new AddDependentsObjectCacheAction ( 'objectWithoutDependents' , [ requestUUID ] ) ) ;
424+ expect ( store . dispatch as jasmine . Spy ) . toHaveBeenCalledOnceWith ( new AddDependentsObjectCacheAction ( 'objectWithoutDependents' , [ requestUUID ] ) ) ;
425425 } ) ;
426426
427427 it ( 'should only dispatch once for the first value of either observable href' , ( ) => {
@@ -442,7 +442,7 @@ describe('ObjectCacheService', () => {
442442 service . addDependency ( href$ , dependsOnHref$ ) ;
443443 flush ( ) ;
444444
445- expect ( store . dispatch ) . toHaveBeenCalledOnceWith ( new AddDependentsObjectCacheAction ( 'objectWithoutDependents' , [ requestUUID ] ) ) ;
445+ expect ( store . dispatch as jasmine . Spy ) . toHaveBeenCalledOnceWith ( new AddDependentsObjectCacheAction ( 'objectWithoutDependents' , [ requestUUID ] ) ) ;
446446 } ) ;
447447 } ) ;
448448
@@ -467,12 +467,12 @@ describe('ObjectCacheService', () => {
467467 describe ( 'removeDependents' , ( ) => {
468468 it ( 'should dispatch a REMOVE_DEPENDENTS action' , ( ) => {
469469 service . removeDependents ( 'objectWithDependents' ) ;
470- expect ( store . dispatch ) . toHaveBeenCalledOnceWith ( new RemoveDependentsObjectCacheAction ( 'objectWithDependents' ) ) ;
470+ expect ( store . dispatch as jasmine . Spy ) . toHaveBeenCalledOnceWith ( new RemoveDependentsObjectCacheAction ( 'objectWithDependents' ) ) ;
471471 } ) ;
472472
473473 it ( 'should resolve alt links' , ( ) => {
474474 service . removeDependents ( 'objectWithDependentsAlt' ) ;
475- expect ( store . dispatch ) . toHaveBeenCalledOnceWith ( new RemoveDependentsObjectCacheAction ( 'objectWithDependents' ) ) ;
475+ expect ( store . dispatch as jasmine . Spy ) . toHaveBeenCalledOnceWith ( new RemoveDependentsObjectCacheAction ( 'objectWithDependents' ) ) ;
476476 } ) ;
477477
478478 it ( 'should not dispatch if the href cannot be resolved to a cached self link' , ( ) => {
0 commit comments