Skip to content

Commit

Permalink
test(concat): add test against breaking unsubscription chain
Browse files Browse the repository at this point in the history
Relates to #875.
  • Loading branch information
luisgabriel authored and benlesh committed Dec 8, 2015
1 parent 70266d0 commit 2220faa
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion spec/operators/concat-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,4 +281,22 @@ describe('Observable.prototype.concat()', function () {
expectObservable(e1.concat()).toBe(expected);
expectSubscriptions(e1.subscriptions).toBe(e1subs);
});
});

it('should not break unsubscription chain when unsubscribed explicitly', function () {
var e1 = cold('---a-a--a| ');
var e1subs = '^ ! ';
var e2 = cold( '-----b-b--b-|');
var e2subs = ' ^ ! ';
var unsub = ' ! ';
var expected = '---a-a--a-----b-b ';

var r = e1
.mergeMap(function (x) { return Observable.of(x); })
.concat(e2)
.mergeMap(function (x) { return Observable.of(x); });

expectObservable(r, unsub).toBe(expected);
expectSubscriptions(e1.subscriptions).toBe(e1subs);
expectSubscriptions(e2.subscriptions).toBe(e2subs);
});
});

0 comments on commit 2220faa

Please sign in to comment.