mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-12 04:23:04 +00:00
fix self links in mocks
This commit is contained in:
@@ -115,13 +115,13 @@ describe('ObjectCacheService', () => {
|
||||
|
||||
describe('getList', () => {
|
||||
it('should return an observable of the array of cached objects with the specified self link and type', () => {
|
||||
const item = new NormalizedItem();
|
||||
item.self = selfLink;
|
||||
const item = new Item();
|
||||
item._links.self = { href: selfLink };
|
||||
spyOn(service, 'getObjectBySelfLink').and.returnValue(observableOf(item));
|
||||
|
||||
service.getList([selfLink, selfLink]).pipe(first()).subscribe((arr) => {
|
||||
expect(arr[0].self).toBe(selfLink);
|
||||
expect(arr[0] instanceof NormalizedItem).toBeTruthy();
|
||||
expect(arr[0] instanceof Item).toBeTruthy();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@@ -48,7 +48,7 @@ describe('ServerSyncBufferEffects', () => {
|
||||
provide: ObjectCacheService, useValue: {
|
||||
getObjectBySelfLink: (link) => {
|
||||
const object = new DSpaceObject();
|
||||
object.self = link;
|
||||
object._links.self = { href: link };
|
||||
return observableOf(object);
|
||||
}
|
||||
}
|
||||
|
@@ -185,11 +185,11 @@ describe('DataService', () => {
|
||||
selfLink = 'https://rest.api/endpoint/1698f1d3-be98-4c51-9fd8-6bfedcbd59b7';
|
||||
|
||||
dso = new DSpaceObject();
|
||||
dso.self = selfLink;
|
||||
dso._links.self = { href: selfLink };
|
||||
dso.metadata = [{ key: 'dc.title', value: name1 }];
|
||||
|
||||
dso2 = new DSpaceObject();
|
||||
dso2.self = selfLink;
|
||||
dso2._link.self = { href: selfLink };
|
||||
dso2.metadata = [{ key: 'dc.title', value: name2 }];
|
||||
|
||||
spyOn(service, 'findByHref').and.returnValue(createSuccessfulRemoteDataObject$(dso));
|
||||
|
@@ -9,7 +9,11 @@ export const EPersonMock: EPerson = Object.assign(new EPerson(),{
|
||||
email: 'test@test.com',
|
||||
requireCertificate: false,
|
||||
selfRegistered: false,
|
||||
self: 'https://dspace.4science.it/dspace-spring-rest/api/eperson/epersons/testid',
|
||||
_links: {
|
||||
self: {
|
||||
href: 'https://dspace.4science.it/dspace-spring-rest/api/eperson/epersons/testid',
|
||||
}
|
||||
},
|
||||
id: 'testid',
|
||||
uuid: 'testid',
|
||||
type: 'eperson',
|
||||
|
Reference in New Issue
Block a user