Merg listview.controller.js
This commit is contained in:
@@ -7,7 +7,7 @@ module.exports = function(karma) {
|
||||
|
||||
// list of files / patterns to load in the browser
|
||||
files: [
|
||||
'lib/jquery/jquery-1.8.2.min.js',
|
||||
'lib/jquery/jquery-2.0.3.min.js',
|
||||
'lib/angular/angular.min.js',
|
||||
'lib/angular/angular-cookies.min.js',
|
||||
'lib/underscore/underscore.js',
|
||||
|
||||
@@ -6,7 +6,7 @@ files = [
|
||||
JASMINE,
|
||||
JASMINE_ADAPTER,
|
||||
|
||||
'lib/jquery/jquery-1.8.2.min.js',
|
||||
'lib/jquery/jquery-2.0.3.min.js',
|
||||
'lib/angular/angular.min.js',
|
||||
'lib/angular/angular-cookies.min.js',
|
||||
'test/lib/angular/angular-mocks.js',
|
||||
|
||||
@@ -41,17 +41,26 @@ describe('content factory tests', function () {
|
||||
});
|
||||
|
||||
|
||||
it('should return a content children collection given an id', function () {
|
||||
var collection = contentFactory.getChildren(1234, undefined);
|
||||
$rootScope.$digest();
|
||||
$httpBackend.flush();
|
||||
expect(collection.resultSet.length).toBe(10);
|
||||
it('should return a all children collection given an id', function () {
|
||||
|
||||
collection = contentFactory.getChildren(1234,{take: 5, offset: 1, filter: ""});
|
||||
var collection;
|
||||
contentFactory.getChildren(1234, undefined).then(function (data) {
|
||||
collection = data;
|
||||
});
|
||||
$rootScope.$digest();
|
||||
$httpBackend.flush();
|
||||
expect(collection.items.length).toBe(56);
|
||||
});
|
||||
|
||||
it('should return paged children collection given an id', function () {
|
||||
|
||||
var collection;
|
||||
contentFactory.getChildren(1234, { pageSize: 5, pageNumber: 1, filter: "" }).then(function (data) {
|
||||
collection = data;
|
||||
});
|
||||
$rootScope.$digest();
|
||||
$httpBackend.flush();
|
||||
|
||||
expect(collection.resultSet.length).toBe(5);
|
||||
});
|
||||
expect(collection.items.length).toBe(5);
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user