Skip to content

Commit

Permalink
Add new test for notifySubscribers cleanup
Browse files Browse the repository at this point in the history
Added a new test which verifies that unsubscribing from an arrayChange
event restores the previous notifySubscribers implementation.
  • Loading branch information
ThomasMichon committed Jan 13, 2016
1 parent fd71d33 commit 756d06e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions spec/observableArrayChangeTrackingBehaviors.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,14 @@ describe('Observable Array change tracking', function() {
expect(source.getSubscriptionsCount()).toBe(0);
});

it('should restore previous subscription notifications', function () {
var source = ko.observableArray();
var notifySubscribers = source.notifySubscribers;
var arrayChange = source.subscribe(function () { }, null, 'arrayChange');
arrayChange.dispose();
expect(source.notifySubscribers).toBe(notifySubscribers);
});

it('Should support tracking of a computed observable using extender', function() {
var myArray = ko.observable(['Alpha', 'Beta', 'Gamma']),
myComputed = ko.computed(function() {
Expand Down

0 comments on commit 756d06e

Please sign in to comment.