Skip to content

Commit

Permalink
test(zip): 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 kwonoj committed Dec 8, 2015
1 parent d4b02fc commit 4f02090
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions spec/operators/zip-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -570,4 +570,22 @@ describe('zip', function () {
expect(vals).toDeepEqual(r[i++]);
}, null, done);
});

it('should not break unsubscription chain when unsubscribed explicitly', function () {
var a = hot('---1---2---3---|');
var unsub = ' !';
var asubs = '^ !';
var b = hot('--4--5--6--7--8--|');
var bsubs = '^ !';
var expected = '---x---y--';

var r = a
.mergeMap(function (x) { return Observable.of(x); })
.zip(b)
.mergeMap(function (x) { return Observable.of(x); });

expectObservable(r, unsub).toBe(expected, { x: ['1', '4'], y: ['2', '5']});
expectSubscriptions(a.subscriptions).toBe(asubs);
expectSubscriptions(b.subscriptions).toBe(bsubs);
});
});

0 comments on commit 4f02090

Please sign in to comment.