mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
Fix findSuccessfulAccordingTo no expectation tests
- The isWithdrawn was set twice to mockItem1 - The expected observable was not correctly compared
This commit is contained in:
@@ -18,7 +18,7 @@ describe('findSuccessfulAccordingTo', () => {
|
|||||||
mockItem1.isWithdrawn = true;
|
mockItem1.isWithdrawn = true;
|
||||||
|
|
||||||
mockItem2 = new Item();
|
mockItem2 = new Item();
|
||||||
mockItem1.isWithdrawn = false;
|
mockItem2.isWithdrawn = false;
|
||||||
|
|
||||||
predicate = (rd: RemoteData<Item>) => isNotEmpty(rd.payload) ? rd.payload.isWithdrawn : false;
|
predicate = (rd: RemoteData<Item>) => isNotEmpty(rd.payload) ? rd.payload.isWithdrawn : false;
|
||||||
});
|
});
|
||||||
@@ -34,7 +34,7 @@ describe('findSuccessfulAccordingTo', () => {
|
|||||||
const source = hot('abcde', testRD);
|
const source = hot('abcde', testRD);
|
||||||
const result = source.pipe(findSuccessfulAccordingTo(predicate));
|
const result = source.pipe(findSuccessfulAccordingTo(predicate));
|
||||||
|
|
||||||
result.subscribe((value) => expect(value).toEqual(testRD.d));
|
expect(result).toBeObservable(hot('---(d|)', { d: testRD.d }));
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user