Skip to content

Commit

Permalink
test(windowCount): add test against breaking unsubscription chain
Browse files Browse the repository at this point in the history
For issue ReactiveX#875.
  • Loading branch information
staltz committed Dec 8, 2015
1 parent d5adbd4 commit d1bf2be
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions spec/operators/windowCount-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,22 @@ describe('Observable.prototype.windowCount', function () {

expectObservable(result, unsub).toBe(expected, values);
});

it('should not break unsubscription chains when result is unsubscribed explicitly', function () {
var source = hot('^-a--b--c--d--|');
var expected = 'w-x--y--z- ';
var w = cold( '--a--(b|) ');
var x = cold( '---b--(c|) ');
var y = cold( '---c- ');
var z = cold( '-- ');
var unsub = ' ! ';
var values = { w: w, x: x, y: y, z: z };

var result = source
.mergeMap(function (x) { return Observable.of(x); })
.windowCount(2, 1)
.mergeMap(function (x) { return Observable.of(x); });

expectObservable(result, unsub).toBe(expected, values);
});
});

0 comments on commit d1bf2be

Please sign in to comment.