9a076165 by Adam Heath

Remove unused hasNextJumpPage and hasPreviousJumpPage options.

1 parent 7721aa02
...@@ -8,9 +8,9 @@ define(function(require) { ...@@ -8,9 +8,9 @@ define(function(require) {
8 return { 8 return {
9 currentPage: 1, 9 currentPage: 1,
10 hasNext: false, 10 hasNext: false,
11 hasNextJumpPage: false, 11 hasNextJump: false,
12 hasPrevious: false, 12 hasPrevious: false,
13 hasPreviousJumpPage: false, 13 hasPreviousJump: false,
14 nextJumpPage: undefined, 14 nextJumpPage: undefined,
15 nextPage: undefined, 15 nextPage: undefined,
16 pages: [], 16 pages: [],
......
...@@ -17,23 +17,19 @@ define(function(require) { ...@@ -17,23 +17,19 @@ define(function(require) {
17 describe('singleton', function() { 17 describe('singleton', function() {
18 var p; 18 var p;
19 19
20 function checkHas(hasNext, hasNextJump, hasNextJumpPage, hasPrevious, hasPreviousJump, hasPreviousJumpPage) { 20 function checkHas(hasNext, hasNextJump, hasPrevious, hasPreviousJump) {
21 var wanted = { 21 var wanted = {
22 hasNext: hasNext, 22 hasNext: hasNext,
23 hasNextJump: hasNextJump, 23 hasNextJump: hasNextJump,
24 hasNextJumpPage: hasNextJumpPage,
25 hasPrevious: hasPrevious, 24 hasPrevious: hasPrevious,
26 hasPreviousJump: hasPreviousJump, 25 hasPreviousJump: hasPreviousJump,
27 hasPreviousJumpPage: hasPreviousJumpPage,
28 }; 26 };
29 it('has', function() { 27 it('has', function() {
30 var got = { 28 var got = {
31 hasNext: p.get('hasNext'), 29 hasNext: p.get('hasNext'),
32 hasNextJump: p.get('hasNextJump'), 30 hasNextJump: p.get('hasNextJump'),
33 hasNextJumpPage: p.get('hasNextJumpPage'),
34 hasPrevious: p.get('hasPrevious'), 31 hasPrevious: p.get('hasPrevious'),
35 hasPreviousJump: p.get('hasPreviousJump'), 32 hasPreviousJump: p.get('hasPreviousJump'),
36 hasPreviousJumpPage: p.get('hasPreviousJumpPage'),
37 }; 33 };
38 expect(got).toEqual(wanted); 34 expect(got).toEqual(wanted);
39 }); 35 });
...@@ -63,7 +59,7 @@ define(function(require) { ...@@ -63,7 +59,7 @@ define(function(require) {
63 p = new Pagination(); 59 p = new Pagination();
64 }); 60 });
65 describe('default settings', function() { 61 describe('default settings', function() {
66 checkHas(false, undefined, false, false, undefined, false); 62 checkHas(false, undefined, false, undefined);
67 checkPages(0, 0, 1); 63 checkPages(0, 0, 1);
68 }); 64 });
69 describe('35 items', function() { 65 describe('35 items', function() {
...@@ -71,7 +67,7 @@ define(function(require) { ...@@ -71,7 +67,7 @@ define(function(require) {
71 p.set({totalCount:35}); 67 p.set({totalCount:35});
72 }); 68 });
73 describe('initial settings', function() { 69 describe('initial settings', function() {
74 checkHas(true, false, false, false, false, false); 70 checkHas(true, false, false, false);
75 checkPages(4, 0, 1); 71 checkPages(4, 0, 1);
76 }); 72 });
77 describe('clamping', function() { 73 describe('clamping', function() {
...@@ -79,14 +75,14 @@ define(function(require) { ...@@ -79,14 +75,14 @@ define(function(require) {
79 beforeEach(function() { 75 beforeEach(function() {
80 p.set({currentPage: 5}); 76 p.set({currentPage: 5});
81 }); 77 });
82 checkHas(false, false, false, true, false, false); 78 checkHas(false, false, true, false);
83 checkPages(4, 0, 4); 79 checkPages(4, 0, 4);
84 }); 80 });
85 describe('set currentPage=-1', function() { 81 describe('set currentPage=-1', function() {
86 beforeEach(function() { 82 beforeEach(function() {
87 p.set({currentPage: -1}); 83 p.set({currentPage: -1});
88 }); 84 });
89 checkHas(true, false, false, false, false, false); 85 checkHas(true, false, false, false);
90 checkPages(4, 0, 1); 86 checkPages(4, 0, 1);
91 }); 87 });
92 }); 88 });
...@@ -99,7 +95,7 @@ define(function(require) { ...@@ -99,7 +95,7 @@ define(function(require) {
99 beforeEach(function() { 95 beforeEach(function() {
100 p.previous(); 96 p.previous();
101 }); 97 });
102 checkHas(true, false, false, false, false, false); 98 checkHas(true, false, false, false);
103 checkPages(4, 0, 1); 99 checkPages(4, 0, 1);
104 }); 100 });
105 describe('next[2]', function() { 101 describe('next[2]', function() {
...@@ -107,40 +103,40 @@ define(function(require) { ...@@ -107,40 +103,40 @@ define(function(require) {
107 p.next(); 103 p.next();
108 p.next(); 104 p.next();
109 }); 105 });
110 checkHas(false, false, false, true, false, false); 106 checkHas(false, false, true, false);
111 checkPages(4, 0, 4); 107 checkPages(4, 0, 4);
112 describe('next[1] - clamp', function() { 108 describe('next[1] - clamp', function() {
113 beforeEach(function() { 109 beforeEach(function() {
114 p.next(); 110 p.next();
115 }); 111 });
116 checkHas(false, false, false, true, false, false); 112 checkHas(false, false, true, false);
117 checkPages(4, 0, 4); 113 checkPages(4, 0, 4);
118 }); 114 });
119 describe('page[0].jump', function() { 115 describe('page[0].jump', function() {
120 beforeEach(function() { 116 beforeEach(function() {
121 p.get('pages')[0].jump(); 117 p.get('pages')[0].jump();
122 }); 118 });
123 checkHas(true, false, false, false, false, false); 119 checkHas(true, false, false, false);
124 checkPages(4, 0, 1); 120 checkPages(4, 0, 1);
125 }); 121 });
126 describe('page[3].jump', function() { 122 describe('page[3].jump', function() {
127 beforeEach(function() { 123 beforeEach(function() {
128 p.get('pages')[3].jump(); 124 p.get('pages')[3].jump();
129 }); 125 });
130 checkHas(false, false, false, true, false, false); 126 checkHas(false, false, true, false);
131 checkPages(4, 0, 4); 127 checkPages(4, 0, 4);
132 }); 128 });
133 describe('decrease to 25 items', function() { 129 describe('decrease to 25 items', function() {
134 beforeEach(function() { 130 beforeEach(function() {
135 p.set({totalCount:25}); 131 p.set({totalCount:25});
136 }); 132 });
137 checkHas(false, false, false, true, false, false); 133 checkHas(false, false, true, false);
138 checkPages(3, 0, 3); 134 checkPages(3, 0, 3);
139 describe('increase to 150 items', function() { 135 describe('increase to 150 items', function() {
140 beforeEach(function() { 136 beforeEach(function() {
141 p.set({totalCount:150}); 137 p.set({totalCount:150});
142 }); 138 });
143 checkHas(true, true, false, true, false, false); 139 checkHas(true, true, true, false);
144 checkPages(9, 0, 3); 140 checkPages(9, 0, 3);
145 }); 141 });
146 }); 142 });
...@@ -150,7 +146,7 @@ define(function(require) { ...@@ -150,7 +146,7 @@ define(function(require) {
150 beforeEach(function() { 146 beforeEach(function() {
151 p.previous(); 147 p.previous();
152 }); 148 });
153 checkHas(true, false, false, false, false, false); 149 checkHas(true, false, false, false);
154 checkPages(4, 0, 1); 150 checkPages(4, 0, 1);
155 }); 151 });
156 }); 152 });
...@@ -158,19 +154,19 @@ define(function(require) { ...@@ -158,19 +154,19 @@ define(function(require) {
158 beforeEach(function() { 154 beforeEach(function() {
159 p.set({totalCount:150}); 155 p.set({totalCount:150});
160 }); 156 });
161 checkHas(true, true, false, false, false, false); 157 checkHas(true, true, false, false);
162 checkPages(9, 0, 1); 158 checkPages(9, 0, 1);
163 describe('page[7].jump', function() { 159 describe('page[7].jump', function() {
164 beforeEach(function() { 160 beforeEach(function() {
165 p.get('pages')[7].jump(); 161 p.get('pages')[7].jump();
166 }); 162 });
167 checkHas(true, true, false, true, true, false); 163 checkHas(true, true, true, true);
168 checkPages(9, 3, 5); 164 checkPages(9, 3, 5);
169 describe('previousJump', function() { 165 describe('previousJump', function() {
170 beforeEach(function() { 166 beforeEach(function() {
171 p.previousJump(); 167 p.previousJump();
172 }); 168 });
173 checkHas(true, true, false, true, false, false); 169 checkHas(true, true, true, false);
174 checkPages(9, 0, 3); 170 checkPages(9, 0, 3);
175 }); 171 });
176 }); 172 });
...@@ -180,7 +176,7 @@ define(function(require) { ...@@ -180,7 +176,7 @@ define(function(require) {
180 p.set({pageJump: false}); 176 p.set({pageJump: false});
181 p.set({totalCount:150}); 177 p.set({totalCount:150});
182 }); 178 });
183 checkHas(true, false, false, false, false, false); 179 checkHas(true, false, false, false);
184 checkPages(9, 0, 1); 180 checkPages(9, 0, 1);
185 }); 181 });
186 }); 182 });
......