fix self links in mocks

This commit is contained in:
Art Lowel
2020-02-13 10:07:33 +01:00
parent 07998a8c08
commit e6c1069e19
4 changed files with 11 additions and 7 deletions

View File

@@ -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();
});
});
});