Skip to content

Commit

Permalink
Add Trackable unit tests for preservation of totalLength
Browse files Browse the repository at this point in the history
  • Loading branch information
kfranqueiro authored and kriszyp committed Mar 20, 2015
1 parent fd3d734 commit 380e1eb
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/Trackable.js
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,22 @@ define([
lastEvent = null;
store.put({ id: 12, name: 'item-12', order: 12 });
assert.isNull(lastEvent);
},

'fetch preserves totalLength API': function () {
var store = createStore({ data: [] }, Memory);
var trackedCollection = store.track();
var results = trackedCollection.fetch();

assert.isDefined(results.totalLength, 'totalLength should be defined on fetch results');
},

'fetchRange preserves totalLength API': function () {
var store = createStore({ data: [] }, Memory);
var trackedCollection = store.track();
var results = trackedCollection.fetchRange({ start: 0, end: 10 });

assert.isDefined(results.totalLength, 'totalLength should be defined on fetch results');
}
};
}
Expand Down

0 comments on commit 380e1eb

Please sign in to comment.