mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-15 22:13:02 +00:00
finished tests and docs
This commit is contained in:
17
src/app/core/cache/object-cache.reducer.spec.ts
vendored
17
src/app/core/cache/object-cache.reducer.spec.ts
vendored
@@ -2,8 +2,11 @@ import * as deepFreeze from 'deep-freeze';
|
||||
|
||||
import { objectCacheReducer } from './object-cache.reducer';
|
||||
import {
|
||||
AddPatchObjectCacheAction,
|
||||
AddToObjectCacheAction,
|
||||
RemoveFromObjectCacheAction, ResetObjectCacheTimestampsAction
|
||||
ApplyPatchObjectCacheAction,
|
||||
RemoveFromObjectCacheAction,
|
||||
ResetObjectCacheTimestampsAction
|
||||
} from './object-cache.actions';
|
||||
|
||||
class NullAction extends RemoveFromObjectCacheAction {
|
||||
@@ -136,4 +139,16 @@ describe('objectCacheReducer', () => {
|
||||
objectCacheReducer(testState, action);
|
||||
});
|
||||
|
||||
it('should perform the ADD_PATCH action without affecting the previous state', () => {
|
||||
const action = new AddPatchObjectCacheAction(selfLink1, [{ op: 'replace', path: '/name', value: 'random string' }]);
|
||||
// testState has already been frozen above
|
||||
objectCacheReducer(testState, action);
|
||||
});
|
||||
|
||||
it('should perform the APPLY_PATCH action without affecting the previous state', () => {
|
||||
const action = new ApplyPatchObjectCacheAction(selfLink1);
|
||||
// testState has already been frozen above
|
||||
objectCacheReducer(testState, action);
|
||||
});
|
||||
|
||||
});
|
||||
|
Reference in New Issue
Block a user