9a076165 by Adam Heath

Remove unused hasNextJumpPage and hasPreviousJumpPage options.

1 parent 7721aa02
......@@ -8,9 +8,9 @@ define(function(require) {
return {
currentPage: 1,
hasNext: false,
hasNextJumpPage: false,
hasNextJump: false,
hasPrevious: false,
hasPreviousJumpPage: false,
hasPreviousJump: false,
nextJumpPage: undefined,
nextPage: undefined,
pages: [],
......
......@@ -17,23 +17,19 @@ define(function(require) {
describe('singleton', function() {
var p;
function checkHas(hasNext, hasNextJump, hasNextJumpPage, hasPrevious, hasPreviousJump, hasPreviousJumpPage) {
function checkHas(hasNext, hasNextJump, hasPrevious, hasPreviousJump) {
var wanted = {
hasNext: hasNext,
hasNextJump: hasNextJump,
hasNextJumpPage: hasNextJumpPage,
hasPrevious: hasPrevious,
hasPreviousJump: hasPreviousJump,
hasPreviousJumpPage: hasPreviousJumpPage,
};
it('has', function() {
var got = {
hasNext: p.get('hasNext'),
hasNextJump: p.get('hasNextJump'),
hasNextJumpPage: p.get('hasNextJumpPage'),
hasPrevious: p.get('hasPrevious'),
hasPreviousJump: p.get('hasPreviousJump'),
hasPreviousJumpPage: p.get('hasPreviousJumpPage'),
};
expect(got).toEqual(wanted);
});
......@@ -63,7 +59,7 @@ define(function(require) {
p = new Pagination();
});
describe('default settings', function() {
checkHas(false, undefined, false, false, undefined, false);
checkHas(false, undefined, false, undefined);
checkPages(0, 0, 1);
});
describe('35 items', function() {
......@@ -71,7 +67,7 @@ define(function(require) {
p.set({totalCount:35});
});
describe('initial settings', function() {
checkHas(true, false, false, false, false, false);
checkHas(true, false, false, false);
checkPages(4, 0, 1);
});
describe('clamping', function() {
......@@ -79,14 +75,14 @@ define(function(require) {
beforeEach(function() {
p.set({currentPage: 5});
});
checkHas(false, false, false, true, false, false);
checkHas(false, false, true, false);
checkPages(4, 0, 4);
});
describe('set currentPage=-1', function() {
beforeEach(function() {
p.set({currentPage: -1});
});
checkHas(true, false, false, false, false, false);
checkHas(true, false, false, false);
checkPages(4, 0, 1);
});
});
......@@ -99,7 +95,7 @@ define(function(require) {
beforeEach(function() {
p.previous();
});
checkHas(true, false, false, false, false, false);
checkHas(true, false, false, false);
checkPages(4, 0, 1);
});
describe('next[2]', function() {
......@@ -107,40 +103,40 @@ define(function(require) {
p.next();
p.next();
});
checkHas(false, false, false, true, false, false);
checkHas(false, false, true, false);
checkPages(4, 0, 4);
describe('next[1] - clamp', function() {
beforeEach(function() {
p.next();
});
checkHas(false, false, false, true, false, false);
checkHas(false, false, true, false);
checkPages(4, 0, 4);
});
describe('page[0].jump', function() {
beforeEach(function() {
p.get('pages')[0].jump();
});
checkHas(true, false, false, false, false, false);
checkHas(true, false, false, false);
checkPages(4, 0, 1);
});
describe('page[3].jump', function() {
beforeEach(function() {
p.get('pages')[3].jump();
});
checkHas(false, false, false, true, false, false);
checkHas(false, false, true, false);
checkPages(4, 0, 4);
});
describe('decrease to 25 items', function() {
beforeEach(function() {
p.set({totalCount:25});
});
checkHas(false, false, false, true, false, false);
checkHas(false, false, true, false);
checkPages(3, 0, 3);
describe('increase to 150 items', function() {
beforeEach(function() {
p.set({totalCount:150});
});
checkHas(true, true, false, true, false, false);
checkHas(true, true, true, false);
checkPages(9, 0, 3);
});
});
......@@ -150,7 +146,7 @@ define(function(require) {
beforeEach(function() {
p.previous();
});
checkHas(true, false, false, false, false, false);
checkHas(true, false, false, false);
checkPages(4, 0, 1);
});
});
......@@ -158,19 +154,19 @@ define(function(require) {
beforeEach(function() {
p.set({totalCount:150});
});
checkHas(true, true, false, false, false, false);
checkHas(true, true, false, false);
checkPages(9, 0, 1);
describe('page[7].jump', function() {
beforeEach(function() {
p.get('pages')[7].jump();
});
checkHas(true, true, false, true, true, false);
checkHas(true, true, true, true);
checkPages(9, 3, 5);
describe('previousJump', function() {
beforeEach(function() {
p.previousJump();
});
checkHas(true, true, false, true, false, false);
checkHas(true, true, true, false);
checkPages(9, 0, 3);
});
});
......@@ -180,7 +176,7 @@ define(function(require) {
p.set({pageJump: false});
p.set({totalCount:150});
});
checkHas(true, false, false, false, false, false);
checkHas(true, false, false, false);
checkPages(9, 0, 1);
});
});
......