1- describe ( 'pagination directive' , function ( ) {
1+ ddescribe ( 'pagination directive' , function ( ) {
22 var $compile , $rootScope , element ;
33 beforeEach ( module ( 'ui.bootstrap.pagination' ) ) ;
44 beforeEach ( module ( 'template/pagination/pagination.html' ) ) ;
@@ -7,7 +7,7 @@ describe('pagination directive', function () {
77 $rootScope = _$rootScope_ ;
88 $rootScope . total = 47 ; // 5 pages
99 $rootScope . currentPage = 3 ;
10- element = $compile ( '<pagination total-items="total" page="currentPage"></pagination>' ) ( $rootScope ) ;
10+ element = $compile ( '<div>< pagination total-items="total" page="currentPage"></pagination></div >' ) ( $rootScope ) ;
1111 $rootScope . $digest ( ) ;
1212 } ) ) ;
1313
@@ -28,10 +28,6 @@ describe('pagination directive', function () {
2828 $rootScope . $digest ( ) ;
2929 }
3030
31- it ( 'has a "pagination" css class' , function ( ) {
32- expect ( element . hasClass ( 'pagination' ) ) . toBe ( true ) ;
33- } ) ;
34-
3531 it ( 'contains one ul and num-pages + 2 li elements' , function ( ) {
3632 expect ( element . find ( 'ul' ) . length ) . toBe ( 1 ) ;
3733 expect ( getPaginationBarSize ( ) ) . toBe ( 7 ) ;
@@ -98,7 +94,7 @@ describe('pagination directive', function () {
9894 describe ( '`items-per-page`' , function ( ) {
9995 beforeEach ( inject ( function ( ) {
10096 $rootScope . perpage = 5 ;
101- element = $compile ( '<pagination total-items="total" items-per-page="perpage" page="currentPage" on-select-page="selectPageHandler(page)"></pagination>' ) ( $rootScope ) ;
97+ element = $compile ( '<div>< pagination total-items="total" items-per-page="perpage" page="currentPage" on-select-page="selectPageHandler(page)"></pagination></div >' ) ( $rootScope ) ;
10298 $rootScope . $digest ( ) ;
10399 } ) ) ;
104100
@@ -141,7 +137,7 @@ describe('pagination directive', function () {
141137 describe ( 'executes `on-select-page` expression' , function ( ) {
142138 beforeEach ( inject ( function ( ) {
143139 $rootScope . selectPageHandler = jasmine . createSpy ( 'selectPageHandler' ) ;
144- element = $compile ( '<pagination total-items="total" page="currentPage" on-select-page="selectPageHandler(page)"></pagination>' ) ( $rootScope ) ;
140+ element = $compile ( '<div>< pagination total-items="total" page="currentPage" on-select-page="selectPageHandler(page)"></pagination></div >' ) ( $rootScope ) ;
145141 $rootScope . $digest ( ) ;
146142 } ) ) ;
147143
@@ -166,7 +162,7 @@ describe('pagination directive', function () {
166162 $rootScope . total = 98 ; // 10 pages
167163 $rootScope . currentPage = 3 ;
168164 $rootScope . maxSize = 5 ;
169- element = $compile ( '<pagination total-items="total" page="currentPage" max-size="maxSize"></pagination>' ) ( $rootScope ) ;
165+ element = $compile ( '<div>< pagination total-items="total" page="currentPage" max-size="maxSize"></pagination></div >' ) ( $rootScope ) ;
170166 $rootScope . $digest ( ) ;
171167 } ) ) ;
172168
@@ -198,7 +194,7 @@ describe('pagination directive', function () {
198194 clickPaginationEl ( 0 ) ;
199195
200196 expect ( $rootScope . currentPage ) . toBe ( 6 ) ;
201- expect ( getPaginationEl ( 3 ) ) . toHaveClass ( 'active' ) ;
197+ expect ( getPaginationEl ( 3 ) ) . toHaveClass ( 'active' ) ;
202198 expect ( getPaginationEl ( 3 ) . text ( ) ) . toBe ( '' + $rootScope . currentPage ) ;
203199 } ) ;
204200
@@ -235,7 +231,7 @@ describe('pagination directive', function () {
235231 $rootScope . currentPage = 7 ;
236232 $rootScope . maxSize = 5 ;
237233 $rootScope . rotate = false ;
238- element = $compile ( '<pagination total-items="total" page="currentPage" max-size="maxSize" rotate="rotate"></pagination>' ) ( $rootScope ) ;
234+ element = $compile ( '<div>< pagination total-items="total" page="currentPage" max-size="maxSize" rotate="rotate"></pagination></div >' ) ( $rootScope ) ;
239235 $rootScope . $digest ( ) ;
240236 } ) ) ;
241237
@@ -295,7 +291,7 @@ describe('pagination directive', function () {
295291
296292 describe ( 'pagination directive with `boundary-links`' , function ( ) {
297293 beforeEach ( inject ( function ( ) {
298- element = $compile ( '<pagination boundary-links="true" total-items="total" page="currentPage"></pagination>' ) ( $rootScope ) ;
294+ element = $compile ( '<div>< pagination boundary-links="true" total-items="total" page="currentPage"></pagination></div >' ) ( $rootScope ) ;
299295 $rootScope . $digest ( ) ;
300296 } ) ) ;
301297
@@ -351,15 +347,15 @@ describe('pagination directive', function () {
351347 } ) ;
352348
353349 it ( 'changes "first" & "last" text from attributes' , function ( ) {
354- element = $compile ( '<pagination boundary-links="true" first-text="<<<" last-text=">>>" total-items="total" page="currentPage"></pagination>' ) ( $rootScope ) ;
350+ element = $compile ( '<div>< pagination boundary-links="true" first-text="<<<" last-text=">>>" total-items="total" page="currentPage"></pagination></div >' ) ( $rootScope ) ;
355351 $rootScope . $digest ( ) ;
356352
357353 expect ( getPaginationEl ( 0 ) . text ( ) ) . toBe ( '<<<' ) ;
358354 expect ( getPaginationEl ( - 1 ) . text ( ) ) . toBe ( '>>>' ) ;
359355 } ) ;
360356
361357 it ( 'changes "previous" & "next" text from attributes' , function ( ) {
362- element = $compile ( '<pagination boundary-links="true" previous-text="<<" next-text=">>" total-items="total" page="currentPage"></pagination>' ) ( $rootScope ) ;
358+ element = $compile ( '<div>< pagination boundary-links="true" previous-text="<<" next-text=">>" total-items="total" page="currentPage"></pagination></div >' ) ( $rootScope ) ;
363359 $rootScope . $digest ( ) ;
364360
365361 expect ( getPaginationEl ( 1 ) . text ( ) ) . toBe ( '<<' ) ;
@@ -369,7 +365,7 @@ describe('pagination directive', function () {
369365 it ( 'changes "first" & "last" text from interpolated attributes' , function ( ) {
370366 $rootScope . myfirstText = '<<<' ;
371367 $rootScope . mylastText = '>>>' ;
372- element = $compile ( '<pagination boundary-links="true" first-text="{{myfirstText}}" last-text="{{mylastText}}" total-items="total" page="currentPage"></pagination>' ) ( $rootScope ) ;
368+ element = $compile ( '<div>< pagination boundary-links="true" first-text="{{myfirstText}}" last-text="{{mylastText}}" total-items="total" page="currentPage"></pagination></div >' ) ( $rootScope ) ;
373369 $rootScope . $digest ( ) ;
374370
375371 expect ( getPaginationEl ( 0 ) . text ( ) ) . toBe ( '<<<' ) ;
@@ -379,7 +375,7 @@ describe('pagination directive', function () {
379375 it ( 'changes "previous" & "next" text from interpolated attributes' , function ( ) {
380376 $rootScope . previousText = '<<' ;
381377 $rootScope . nextText = '>>' ;
382- element = $compile ( '<pagination boundary-links="true" previous-text="{{previousText}}" next-text="{{nextText}}" total-items="total" page="currentPage"></pagination>' ) ( $rootScope ) ;
378+ element = $compile ( '<div>< pagination boundary-links="true" previous-text="{{previousText}}" next-text="{{nextText}}" total-items="total" page="currentPage"></pagination></div >' ) ( $rootScope ) ;
383379 $rootScope . $digest ( ) ;
384380
385381 expect ( getPaginationEl ( 1 ) . text ( ) ) . toBe ( '<<' ) ;
@@ -389,7 +385,7 @@ describe('pagination directive', function () {
389385
390386 describe ( 'pagination directive with just number links' , function ( ) {
391387 beforeEach ( inject ( function ( ) {
392- element = $compile ( '<pagination direction-links="false" total-items="total" page="currentPage"></pagination>' ) ( $rootScope ) ;
388+ element = $compile ( '<div>< pagination direction-links="false" total-items="total" page="currentPage"></pagination></div >' ) ( $rootScope ) ;
393389 $rootScope . $digest ( ) ;
394390 } ) ) ;
395391
@@ -441,7 +437,7 @@ describe('pagination directive', function () {
441437 describe ( 'with just boundary & number links' , function ( ) {
442438 beforeEach ( inject ( function ( ) {
443439 $rootScope . directions = false ;
444- element = $compile ( '<pagination boundary-links="true" direction-links="directions" total-items="total" page="currentPage"></pagination>' ) ( $rootScope ) ;
440+ element = $compile ( '<div>< pagination boundary-links="true" direction-links="directions" total-items="total" page="currentPage"></pagination></div >' ) ( $rootScope ) ;
445441 $rootScope . $digest ( ) ;
446442 } ) ) ;
447443
@@ -473,7 +469,7 @@ describe('pagination directive', function () {
473469 describe ( '`num-pages`' , function ( ) {
474470 beforeEach ( inject ( function ( ) {
475471 $rootScope . numpg = null ;
476- element = $compile ( '<pagination total-items="total" page="currentPage" num-pages="numpg"></pagination>' ) ( $rootScope ) ;
472+ element = $compile ( '<div>< pagination total-items="total" page="currentPage" num-pages="numpg"></pagination></div >' ) ( $rootScope ) ;
477473 $rootScope . $digest ( ) ;
478474 } ) ) ;
479475
@@ -493,7 +489,7 @@ describe('pagination directive', function () {
493489 paginationConfig . previousText = 'PR' ;
494490 paginationConfig . nextText = 'NE' ;
495491 paginationConfig . lastText = 'LA' ;
496- element = $compile ( '<pagination total-items="total" page="currentPage"></pagination>' ) ( $rootScope ) ;
492+ element = $compile ( '<div>< pagination total-items="total" page="currentPage"></pagination></div >' ) ( $rootScope ) ;
497493 $rootScope . $digest ( ) ;
498494 } ) ) ;
499495 afterEach ( inject ( function ( paginationConfig ) {
@@ -515,7 +511,7 @@ describe('pagination directive', function () {
515511
516512 describe ( 'override configuration from attributes' , function ( ) {
517513 beforeEach ( inject ( function ( ) {
518- element = $compile ( '<pagination boundary-links="true" first-text="<<" previous-text="<" next-text=">" last-text=">>" total-items="total" page="currentPage"></pagination>' ) ( $rootScope ) ;
514+ element = $compile ( '<div>< pagination boundary-links="true" first-text="<<" previous-text="<" next-text=">" last-text=">>" total-items="total" page="currentPage"></pagination></div >' ) ( $rootScope ) ;
519515 $rootScope . $digest ( ) ;
520516 } ) ) ;
521517
@@ -531,4 +527,4 @@ describe('pagination directive', function () {
531527 } ) ;
532528 } ) ;
533529
534- } ) ;
530+ } ) ;
0 commit comments