mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
fixed some tests
This commit is contained in:
@@ -13,6 +13,7 @@ import { CommunityDataService } from './community-data.service';
|
||||
import { FindByIDRequest } from './request.models';
|
||||
import { RequestService } from './request.service';
|
||||
import { NormalizedObject } from '../cache/models/normalized-object.model';
|
||||
import { HALEndpointService } from '../shared/hal-endpoint.service';
|
||||
|
||||
const LINK_NAME = 'test';
|
||||
|
||||
@@ -21,7 +22,6 @@ class NormalizedTestObject extends NormalizedObject {
|
||||
}
|
||||
|
||||
class TestService extends ComColDataService<NormalizedTestObject, any> {
|
||||
protected linkPath = LINK_NAME;
|
||||
|
||||
constructor(
|
||||
protected responseCache: ResponseCacheService,
|
||||
@@ -30,7 +30,9 @@ class TestService extends ComColDataService<NormalizedTestObject, any> {
|
||||
protected store: Store<CoreState>,
|
||||
protected EnvConfig: GlobalConfig,
|
||||
protected cds: CommunityDataService,
|
||||
protected objectCache: ObjectCacheService
|
||||
protected objectCache: ObjectCacheService,
|
||||
protected halService: HALEndpointService,
|
||||
protected linkPath: string
|
||||
) {
|
||||
super();
|
||||
}
|
||||
@@ -44,6 +46,7 @@ describe('ComColDataService', () => {
|
||||
let requestService: RequestService;
|
||||
let cds: CommunityDataService;
|
||||
let objectCache: ObjectCacheService;
|
||||
const halService: any = {};
|
||||
|
||||
const rdbService = {} as RemoteDataBuildService;
|
||||
const store = {} as Store<CoreState>;
|
||||
@@ -90,7 +93,9 @@ describe('ComColDataService', () => {
|
||||
store,
|
||||
EnvConfig,
|
||||
cds,
|
||||
objectCache
|
||||
objectCache,
|
||||
halService,
|
||||
LINK_NAME
|
||||
);
|
||||
}
|
||||
|
||||
@@ -154,24 +159,5 @@ describe('ComColDataService', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('if the scope is not specified', () => {
|
||||
beforeEach(() => {
|
||||
cds = initMockCommunityDataService();
|
||||
requestService = getMockRequestService();
|
||||
objectCache = initMockObjectCacheService();
|
||||
responseCache = initMockResponseCacheService(true);
|
||||
service = initTestService();
|
||||
});
|
||||
|
||||
it('should return this.getEndpoint()', () => {
|
||||
spyOn(service, 'getEndpoint').and.returnValue(cold('--e-', { e: serviceEndpoint }));
|
||||
|
||||
const result = service.getScopedEndpoint(undefined);
|
||||
const expected = cold('--f-', { f: serviceEndpoint });
|
||||
|
||||
expect(result).toBeObservable(expected);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user