mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-15 22:13:02 +00:00
refactored resource type and type mapping
This commit is contained in:
12
src/app/core/cache/object-cache.reducer.spec.ts
vendored
12
src/app/core/cache/object-cache.reducer.spec.ts
vendored
@@ -9,7 +9,7 @@ import {
|
||||
ResetObjectCacheTimestampsAction
|
||||
} from './object-cache.actions';
|
||||
import { Operation } from 'fast-json-patch';
|
||||
import { ResourceType } from '../shared/resource-type';
|
||||
import { Item } from '../shared/item.model';
|
||||
|
||||
class NullAction extends RemoveFromObjectCacheAction {
|
||||
type = null;
|
||||
@@ -29,7 +29,7 @@ describe('objectCacheReducer', () => {
|
||||
const testState = {
|
||||
[selfLink1]: {
|
||||
data: {
|
||||
type: ResourceType.Item,
|
||||
type: Item.type,
|
||||
self: selfLink1,
|
||||
foo: 'bar'
|
||||
},
|
||||
@@ -41,7 +41,7 @@ describe('objectCacheReducer', () => {
|
||||
},
|
||||
[selfLink2]: {
|
||||
data: {
|
||||
type: ResourceType.Item,
|
||||
type: Item.type,
|
||||
self: requestUUID2,
|
||||
foo: 'baz'
|
||||
},
|
||||
@@ -70,7 +70,7 @@ describe('objectCacheReducer', () => {
|
||||
|
||||
it('should add the payload to the cache in response to an ADD action', () => {
|
||||
const state = Object.create(null);
|
||||
const objectToCache = { self: selfLink1, type: ResourceType.Item };
|
||||
const objectToCache = { self: selfLink1, type: Item.type };
|
||||
const timeAdded = new Date().getTime();
|
||||
const msToLive = 900000;
|
||||
const requestUUID = requestUUID1;
|
||||
@@ -87,7 +87,7 @@ describe('objectCacheReducer', () => {
|
||||
self: selfLink1,
|
||||
foo: 'baz',
|
||||
somethingElse: true,
|
||||
type: ResourceType.Item
|
||||
type: Item.type
|
||||
};
|
||||
const timeAdded = new Date().getTime();
|
||||
const msToLive = 900000;
|
||||
@@ -103,7 +103,7 @@ describe('objectCacheReducer', () => {
|
||||
|
||||
it('should perform the ADD action without affecting the previous state', () => {
|
||||
const state = Object.create(null);
|
||||
const objectToCache = { self: selfLink1, type: ResourceType.Item };
|
||||
const objectToCache = { self: selfLink1, type: Item.type };
|
||||
const timeAdded = new Date().getTime();
|
||||
const msToLive = 900000;
|
||||
const requestUUID = requestUUID1;
|
||||
|
Reference in New Issue
Block a user