diff --git a/spec/operators/throttleTime-spec.ts b/spec/operators/throttleTime-spec.ts index fef0cd15b3..bbaab5153c 100644 --- a/spec/operators/throttleTime-spec.ts +++ b/spec/operators/throttleTime-spec.ts @@ -152,6 +152,16 @@ describe('throttleTime operator', () => { expectObservable(result).toBe(expected); expectSubscriptions(e1.subscriptions).toBe(e1subs); }); + + it('should emit the first value if only a single one is given', () => { + const e1 = hot('-a--------------------|'); + const t = time('----| '); + const expected = '-a--------------------|'; + + const result = e1.pipe(throttleTime(t, rxTestScheduler, { leading: true, trailing: true })); + + expectObservable(result).toBe(expected); + }); }); describe('throttleTime(fn, { leading: false, trailing: true })', () => { @@ -178,5 +188,15 @@ describe('throttleTime operator', () => { expectObservable(result).toBe(expected); expectSubscriptions(e1.subscriptions).toBe(e1subs); }); + + it('should emit the first value if only a single one is given', () => { + const e1 = hot('-a--------------------|'); + const t = time('----| '); + const expected = '-----a----------------|'; + + const result = e1.pipe(throttleTime(t, rxTestScheduler, { leading: false, trailing: true })); + + expectObservable(result).toBe(expected); + }); }); });