Fix findSuccessfulAccordingTo no expectation tests

- The isWithdrawn was set twice to mockItem1
- The expected observable was not correctly compared
This commit is contained in:
Alexandre Vryghem
2023-07-01 15:22:13 +02:00
parent b83a0b3f9b
commit b4a3882dcf

View File

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