Last active
March 3, 2022 10:12
-
-
Save GerritRiesch94/a3db36126cf1bbccdb9a871297194d9b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {extractIdsOfSolvedCases} from './rxjs-operators'; | |
import {marbles} from 'rxjs-marbles'; | |
import {Report} from './reports.service'; | |
describe('rxjs-operators', () => { | |
describe('extractIdsOfSolvedCases', () => { | |
it('should extract all ids of solved cases', marbles((context) => { | |
const source = context.cold('abc|', { | |
a: {id: 1, case: {id: 'The Pontiac Bandit'}, detectives: [], solved: false } as Report, | |
b: {id: 2, case: {id: 'The Disco Strangler'}, detectives: [], solved: true } as Report, | |
c: {id: 3, case: {id: 'Maximum Security'}, detectives: [], solved: true } as Report, | |
}) | |
const destination = source.pipe( | |
extractIdsOfSolvedCases() | |
); | |
context.expect(destination).toBeObservable('---(d|)', { | |
d: [2, 3] | |
}) | |
})); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment