@@ -123,11 +123,11 @@ describe('pagination directive', function () {
123
123
} ) ;
124
124
125
125
describe ( '`items-per-page`' , function ( ) {
126
- beforeEach ( inject ( function ( ) {
126
+ beforeEach ( function ( ) {
127
127
$rootScope . perpage = 5 ;
128
128
element = $compile ( '<pagination total-items="total" items-per-page="perpage" ng-model="currentPage"></pagination>' ) ( $rootScope ) ;
129
129
$rootScope . $digest ( ) ;
130
- } ) ) ;
130
+ } ) ;
131
131
132
132
it ( 'changes the number of pages' , function ( ) {
133
133
expect ( getPaginationBarSize ( ) ) . toBe ( 12 ) ;
@@ -166,11 +166,11 @@ describe('pagination directive', function () {
166
166
} ) ;
167
167
168
168
describe ( 'executes `ng-change` expression' , function ( ) {
169
- beforeEach ( inject ( function ( ) {
169
+ beforeEach ( function ( ) {
170
170
$rootScope . selectPageHandler = jasmine . createSpy ( 'selectPageHandler' ) ;
171
171
element = $compile ( '<pagination total-items="total" ng-model="currentPage" ng-change="selectPageHandler()"></pagination>' ) ( $rootScope ) ;
172
172
$rootScope . $digest ( ) ;
173
- } ) ) ;
173
+ } ) ;
174
174
175
175
it ( 'when an element is clicked' , function ( ) {
176
176
clickPaginationEl ( 2 ) ;
@@ -194,13 +194,13 @@ describe('pagination directive', function () {
194
194
} ) ;
195
195
196
196
describe ( 'with `max-size` option' , function ( ) {
197
- beforeEach ( inject ( function ( ) {
197
+ beforeEach ( function ( ) {
198
198
$rootScope . total = 98 ; // 10 pages
199
199
$rootScope . currentPage = 3 ;
200
200
$rootScope . maxSize = 5 ;
201
201
element = $compile ( '<pagination total-items="total" ng-model="currentPage" max-size="maxSize"></pagination>' ) ( $rootScope ) ;
202
202
$rootScope . $digest ( ) ;
203
- } ) ) ;
203
+ } ) ;
204
204
205
205
it ( 'contains maxsize + 2 li elements' , function ( ) {
206
206
expect ( getPaginationBarSize ( ) ) . toBe ( $rootScope . maxSize + 2 ) ;
@@ -230,7 +230,7 @@ describe('pagination directive', function () {
230
230
clickPaginationEl ( 0 ) ;
231
231
232
232
expect ( $rootScope . currentPage ) . toBe ( 6 ) ;
233
- expect ( getPaginationEl ( 3 ) ) . toHaveClass ( 'active' ) ;
233
+ expect ( getPaginationEl ( 3 ) ) . toHaveClass ( 'active' ) ;
234
234
expect ( getPaginationEl ( 3 ) . text ( ) ) . toBe ( '' + $rootScope . currentPage ) ;
235
235
} ) ;
236
236
@@ -262,14 +262,14 @@ describe('pagination directive', function () {
262
262
} ) ;
263
263
264
264
describe ( 'with `max-size` option & no `rotate`' , function ( ) {
265
- beforeEach ( inject ( function ( ) {
265
+ beforeEach ( function ( ) {
266
266
$rootScope . total = 115 ; // 12 pages
267
267
$rootScope . currentPage = 7 ;
268
268
$rootScope . maxSize = 5 ;
269
269
$rootScope . rotate = false ;
270
270
element = $compile ( '<pagination total-items="total" ng-model="currentPage" max-size="maxSize" rotate="rotate"></pagination>' ) ( $rootScope ) ;
271
271
$rootScope . $digest ( ) ;
272
- } ) ) ;
272
+ } ) ;
273
273
274
274
it ( 'contains maxsize + 4 elements' , function ( ) {
275
275
expect ( getPaginationBarSize ( ) ) . toBe ( $rootScope . maxSize + 4 ) ;
@@ -325,10 +325,10 @@ describe('pagination directive', function () {
325
325
} ) ;
326
326
327
327
describe ( 'pagination directive with `boundary-links`' , function ( ) {
328
- beforeEach ( inject ( function ( ) {
328
+ beforeEach ( function ( ) {
329
329
element = $compile ( '<pagination boundary-links="true" total-items="total" ng-model="currentPage"></pagination>' ) ( $rootScope ) ;
330
330
$rootScope . $digest ( ) ;
331
- } ) ) ;
331
+ } ) ;
332
332
333
333
it ( 'contains num-pages + 4 li elements' , function ( ) {
334
334
expect ( getPaginationBarSize ( ) ) . toBe ( 9 ) ;
@@ -418,10 +418,10 @@ describe('pagination directive', function () {
418
418
} ) ;
419
419
420
420
describe ( 'pagination directive with just number links' , function ( ) {
421
- beforeEach ( inject ( function ( ) {
421
+ beforeEach ( function ( ) {
422
422
element = $compile ( '<pagination direction-links="false" total-items="total" ng-model="currentPage"></pagination>' ) ( $rootScope ) ;
423
423
$rootScope . $digest ( ) ;
424
- } ) ) ;
424
+ } ) ;
425
425
426
426
it ( 'contains num-pages li elements' , function ( ) {
427
427
expect ( getPaginationBarSize ( ) ) . toBe ( 5 ) ;
@@ -469,11 +469,11 @@ describe('pagination directive', function () {
469
469
} ) ;
470
470
471
471
describe ( 'with just boundary & number links' , function ( ) {
472
- beforeEach ( inject ( function ( ) {
472
+ beforeEach ( function ( ) {
473
473
$rootScope . directions = false ;
474
474
element = $compile ( '<pagination boundary-links="true" direction-links="directions" total-items="total" ng-model="currentPage"></pagination>' ) ( $rootScope ) ;
475
475
$rootScope . $digest ( ) ;
476
- } ) ) ;
476
+ } ) ;
477
477
478
478
it ( 'contains number of pages + 2 li elements' , function ( ) {
479
479
expect ( getPaginationBarSize ( ) ) . toBe ( 7 ) ;
@@ -501,11 +501,11 @@ describe('pagination directive', function () {
501
501
} ) ;
502
502
503
503
describe ( '`num-pages`' , function ( ) {
504
- beforeEach ( inject ( function ( ) {
504
+ beforeEach ( function ( ) {
505
505
$rootScope . numpg = null ;
506
506
element = $compile ( '<pagination total-items="total" ng-model="currentPage" num-pages="numpg"></pagination>' ) ( $rootScope ) ;
507
507
$rootScope . $digest ( ) ;
508
- } ) ) ;
508
+ } ) ;
509
509
510
510
it ( 'equals to total number of pages' , function ( ) {
511
511
expect ( $rootScope . numpg ) . toBe ( 5 ) ;
@@ -573,10 +573,10 @@ describe('pagination directive', function () {
573
573
} ) ;
574
574
575
575
describe ( 'override configuration from attributes' , function ( ) {
576
- beforeEach ( inject ( function ( ) {
576
+ beforeEach ( function ( ) {
577
577
element = $compile ( '<pagination boundary-links="true" first-text="<<" previous-text="<" next-text=">" last-text=">>" total-items="total" ng-model="currentPage"></pagination>' ) ( $rootScope ) ;
578
578
$rootScope . $digest ( ) ;
579
- } ) ) ;
579
+ } ) ;
580
580
581
581
it ( 'contains number of pages + 4 li elements' , function ( ) {
582
582
expect ( getPaginationBarSize ( ) ) . toBe ( 9 ) ;
0 commit comments