Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Tests for 698c6a2
  • Loading branch information
Eugene Simakin committed Jan 14, 2014
1 parent 698c6a2 commit 8482319
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions tests/test.js
Expand Up @@ -16,7 +16,7 @@
ok(!pag1.twbsPagination('equals', b, real), "Dirty test");
});

test( "Test 'getPages' method (EVEN visible pages number)", function() {
test("Test 'getPages' method (EVEN visible pages number)", function () {
var expected1 = {currentPage: 1, numeric: [1, 2, 3, 4, 5]};
deepEqual(pag1.twbsPagination('getPages', 1), expected1);
var expected2 = {currentPage: 2, numeric: [1, 2, 3, 4, 5]};
Expand All @@ -41,7 +41,7 @@
deepEqual(pag1.twbsPagination('getPages', 30), expected30);
});

test( "Test 'getPages' method (ODD visible pages number)", function() {
test("Test 'getPages' method (ODD visible pages number)", function () {
pag1.twbsPagination('init', {totalPages: 30, visiblePages: 6});
var expected1 = {currentPage: 1, numeric: [1, 2, 3, 4, 5, 6]};
deepEqual(pag1.twbsPagination('getPages', 1), expected1);
Expand All @@ -67,4 +67,17 @@
deepEqual(pag1.twbsPagination('getPages', 30), expected30);
});

test("Test 'getPages' method (total < visible)", function () {
pag1.twbsPagination('init', {
totalPages: 3,
visiblePages: 5
});
var exp1 = {currentPage: 1, numeric: [1, 2, 3]};
deepEqual(pag1.twbsPagination('getPages', 1), exp1);
var exp2 = {currentPage: 2, numeric: [1, 2, 3]};
deepEqual(pag1.twbsPagination('getPages', 2), exp2);
var exp3 = {currentPage: 3, numeric: [1, 2, 3]};
deepEqual(pag1.twbsPagination('getPages', 3), exp3);
});

})();

0 comments on commit 8482319

Please sign in to comment.