@@ -11,7 +11,7 @@ describe('pagination directive', function() {
11
11
$document = _$document_ ;
12
12
$templateCache = _$templateCache_ ;
13
13
body = $document . find ( 'body' ) ;
14
- element = $compile ( '<uib-pagination total-items="total" ng-model="currentPage"></uib-pagination >' ) ( $rootScope ) ;
14
+ element = $compile ( '<ul uib-pagination total-items="total" ng-model="currentPage"></ul >' ) ( $rootScope ) ;
15
15
$rootScope . $digest ( ) ;
16
16
} ) ) ;
17
17
@@ -58,7 +58,7 @@ describe('pagination directive', function() {
58
58
$templateCache . put ( 'uib/template/pagination/pagination.html' , '<div>{{pagination.randomText}}</div>' ) ;
59
59
var scope = $rootScope . $new ( ) ;
60
60
61
- element = $compile ( '<uib-pagination></uib-pagination >' ) ( scope ) ;
61
+ element = $compile ( '<ul uib-pagination></ul >' ) ( scope ) ;
62
62
$rootScope . $digest ( ) ;
63
63
64
64
var ctrl = element . controller ( 'uibPagination' ) ;
@@ -68,17 +68,17 @@ describe('pagination directive', function() {
68
68
ctrl . randomText = 'foo' ;
69
69
$rootScope . $digest ( ) ;
70
70
71
- expect ( element . html ( ) ) . toBe ( 'foo' ) ;
71
+ expect ( element . html ( ) ) . toBe ( '<div class="ng-binding"> foo</div> ' ) ;
72
72
} ) ;
73
73
74
74
it ( 'allows custom templates' , function ( ) {
75
75
$templateCache . put ( 'foo/bar.html' , '<div>baz</div>' ) ;
76
76
var scope = $rootScope . $new ( ) ;
77
77
78
- element = $compile ( '<uib-pagination template-url="foo/bar.html"></uib-pagination >' ) ( scope ) ;
78
+ element = $compile ( '<ul uib-pagination template-url="foo/bar.html"></ul >' ) ( scope ) ;
79
79
$rootScope . $digest ( ) ;
80
80
81
- expect ( element . html ( ) ) . toBe ( 'baz' ) ;
81
+ expect ( element . html ( ) ) . toBe ( '<div> baz</div> ' ) ;
82
82
} ) ;
83
83
84
84
it ( 'contains num-pages + 2 li elements' , function ( ) {
@@ -213,7 +213,7 @@ describe('pagination directive', function() {
213
213
describe ( '`items-per-page`' , function ( ) {
214
214
beforeEach ( function ( ) {
215
215
$rootScope . perpage = 5 ;
216
- element = $compile ( '<uib-pagination total-items="total" items-per-page="perpage" ng-model="currentPage"></uib-pagination >' ) ( $rootScope ) ;
216
+ element = $compile ( '<ul uib-pagination total-items="total" items-per-page="perpage" ng-model="currentPage"></ul >' ) ( $rootScope ) ;
217
217
$rootScope . $digest ( ) ;
218
218
} ) ;
219
219
@@ -256,7 +256,7 @@ describe('pagination directive', function() {
256
256
describe ( 'executes `ng-change` expression' , function ( ) {
257
257
beforeEach ( function ( ) {
258
258
$rootScope . selectPageHandler = jasmine . createSpy ( 'selectPageHandler' ) ;
259
- element = $compile ( '<uib-pagination total-items="total" ng-model="currentPage" ng-change="selectPageHandler()"></uib-pagination >' ) ( $rootScope ) ;
259
+ element = $compile ( '<ul uib-pagination total-items="total" ng-model="currentPage" ng-change="selectPageHandler()"></ul >' ) ( $rootScope ) ;
260
260
$rootScope . $digest ( ) ;
261
261
} ) ;
262
262
@@ -286,7 +286,7 @@ describe('pagination directive', function() {
286
286
$rootScope . total = 98 ; // 10 pages
287
287
$rootScope . currentPage = 3 ;
288
288
$rootScope . maxSize = 5 ;
289
- element = $compile ( '<uib-pagination total-items="total" ng-model="currentPage" max-size="maxSize"></uib-pagination >' ) ( $rootScope ) ;
289
+ element = $compile ( '<ul uib-pagination total-items="total" ng-model="currentPage" max-size="maxSize"></ul >' ) ( $rootScope ) ;
290
290
$rootScope . $digest ( ) ;
291
291
} ) ;
292
292
@@ -367,7 +367,7 @@ describe('pagination directive', function() {
367
367
$rootScope . total = 98 ; // 10 pages
368
368
$rootScope . currentPage = 3 ;
369
369
$rootScope . maxSize = 5 ;
370
- element = $compile ( '<uib-pagination total-items="total" ng-model="currentPage" max-size="maxSize" force-ellipses="true"></uib-pagination >' ) ( $rootScope ) ;
370
+ element = $compile ( '<ul uib-pagination total-items="total" ng-model="currentPage" max-size="maxSize" force-ellipses="true"></ul >' ) ( $rootScope ) ;
371
371
$rootScope . $digest ( ) ;
372
372
} ) ;
373
373
@@ -429,7 +429,7 @@ describe('pagination directive', function() {
429
429
$rootScope . total = 98 ; // 10 pages
430
430
$rootScope . currentPage = 3 ;
431
431
$rootScope . maxSize = 5 ;
432
- element = $compile ( '<uib-pagination total-items="total" ng-model="currentPage" max-size="maxSize" boundary-link-numbers="true"></uib-pagination >' ) ( $rootScope ) ;
432
+ element = $compile ( '<ul uib-pagination total-items="total" ng-model="currentPage" max-size="maxSize" boundary-link-numbers="true"></ul >' ) ( $rootScope ) ;
433
433
$rootScope . $digest ( ) ;
434
434
} ) ;
435
435
@@ -522,7 +522,7 @@ describe('pagination directive', function() {
522
522
$rootScope . currentPage = 7 ;
523
523
$rootScope . maxSize = 5 ;
524
524
$rootScope . rotate = false ;
525
- element = $compile ( '<uib-pagination total-items="total" ng-model="currentPage" max-size="maxSize" rotate="rotate"></uib-pagination >' ) ( $rootScope ) ;
525
+ element = $compile ( '<ul uib-pagination total-items="total" ng-model="currentPage" max-size="maxSize" rotate="rotate"></ul >' ) ( $rootScope ) ;
526
526
$rootScope . $digest ( ) ;
527
527
} ) ;
528
528
@@ -581,7 +581,7 @@ describe('pagination directive', function() {
581
581
582
582
describe ( 'pagination directive with `boundary-links`' , function ( ) {
583
583
beforeEach ( function ( ) {
584
- element = $compile ( '<uib-pagination boundary-links="true" total-items="total" ng-model="currentPage"></uib-pagination >' ) ( $rootScope ) ;
584
+ element = $compile ( '<ul uib-pagination boundary-links="true" total-items="total" ng-model="currentPage"></ul >' ) ( $rootScope ) ;
585
585
$rootScope . $digest ( ) ;
586
586
} ) ;
587
587
@@ -636,15 +636,15 @@ describe('pagination directive', function() {
636
636
} ) ;
637
637
638
638
it ( 'changes "first" & "last" text from attributes' , function ( ) {
639
- element = $compile ( '<uib-pagination boundary-links="true" first-text="<<<" last-text=">>>" total-items="total" ng-model="currentPage"></uib-pagination >' ) ( $rootScope ) ;
639
+ element = $compile ( '<ul uib-pagination boundary-links="true" first-text="<<<" last-text=">>>" total-items="total" ng-model="currentPage"></ul >' ) ( $rootScope ) ;
640
640
$rootScope . $digest ( ) ;
641
641
642
642
expect ( getPaginationEl ( 0 ) . text ( ) ) . toBe ( '<<<' ) ;
643
643
expect ( getPaginationEl ( - 1 ) . text ( ) ) . toBe ( '>>>' ) ;
644
644
} ) ;
645
645
646
646
it ( 'changes "previous" & "next" text from attributes' , function ( ) {
647
- element = $compile ( '<uib-pagination boundary-links="true" previous-text="<<" next-text=">>" total-items="total" ng-model="currentPage"></uib-pagination >' ) ( $rootScope ) ;
647
+ element = $compile ( '<ul uib-pagination boundary-links="true" previous-text="<<" next-text=">>" total-items="total" ng-model="currentPage"></ul >' ) ( $rootScope ) ;
648
648
$rootScope . $digest ( ) ;
649
649
650
650
expect ( getPaginationEl ( 1 ) . text ( ) ) . toBe ( '<<' ) ;
@@ -654,7 +654,7 @@ describe('pagination directive', function() {
654
654
it ( 'changes "first" & "last" text from interpolated attributes' , function ( ) {
655
655
$rootScope . myfirstText = '<<<' ;
656
656
$rootScope . mylastText = '>>>' ;
657
- element = $compile ( '<uib-pagination boundary-links="true" first-text="{{myfirstText}}" last-text="{{mylastText}}" total-items="total" ng-model="currentPage"></uib-pagination >' ) ( $rootScope ) ;
657
+ element = $compile ( '<ul uib-pagination boundary-links="true" first-text="{{myfirstText}}" last-text="{{mylastText}}" total-items="total" ng-model="currentPage"></ul >' ) ( $rootScope ) ;
658
658
$rootScope . $digest ( ) ;
659
659
660
660
expect ( getPaginationEl ( 0 ) . text ( ) ) . toBe ( '<<<' ) ;
@@ -664,7 +664,7 @@ describe('pagination directive', function() {
664
664
it ( 'changes "previous" & "next" text from interpolated attributes' , function ( ) {
665
665
$rootScope . previousText = '<<' ;
666
666
$rootScope . nextText = '>>' ;
667
- element = $compile ( '<uib-pagination boundary-links="true" previous-text="{{previousText}}" next-text="{{nextText}}" total-items="total" ng-model="currentPage"></uib-pagination >' ) ( $rootScope ) ;
667
+ element = $compile ( '<ul uib-pagination boundary-links="true" previous-text="{{previousText}}" next-text="{{nextText}}" total-items="total" ng-model="currentPage"></ul >' ) ( $rootScope ) ;
668
668
$rootScope . $digest ( ) ;
669
669
670
670
expect ( getPaginationEl ( 1 ) . text ( ) ) . toBe ( '<<' ) ;
@@ -700,7 +700,7 @@ describe('pagination directive', function() {
700
700
701
701
describe ( 'pagination directive with just number links' , function ( ) {
702
702
beforeEach ( function ( ) {
703
- element = $compile ( '<uib-pagination direction-links="false" total-items="total" ng-model="currentPage"></uib-pagination >' ) ( $rootScope ) ;
703
+ element = $compile ( '<ul uib-pagination direction-links="false" total-items="total" ng-model="currentPage"></ul >' ) ( $rootScope ) ;
704
704
$rootScope . $digest ( ) ;
705
705
} ) ;
706
706
@@ -752,7 +752,7 @@ describe('pagination directive', function() {
752
752
describe ( 'with just boundary & number links' , function ( ) {
753
753
beforeEach ( function ( ) {
754
754
$rootScope . directions = false ;
755
- element = $compile ( '<uib-pagination boundary-links="true" direction-links="directions" total-items="total" ng-model="currentPage"></uib-pagination >' ) ( $rootScope ) ;
755
+ element = $compile ( '<ul uib-pagination boundary-links="true" direction-links="directions" total-items="total" ng-model="currentPage"></ul >' ) ( $rootScope ) ;
756
756
$rootScope . $digest ( ) ;
757
757
} ) ;
758
758
@@ -784,7 +784,7 @@ describe('pagination directive', function() {
784
784
describe ( '`num-pages`' , function ( ) {
785
785
beforeEach ( function ( ) {
786
786
$rootScope . numpg = null ;
787
- element = $compile ( '<uib-pagination total-items="total" ng-model="currentPage" num-pages="numpg"></uib-pagination >' ) ( $rootScope ) ;
787
+ element = $compile ( '<ul uib-pagination total-items="total" ng-model="currentPage" num-pages="numpg"></ul >' ) ( $rootScope ) ;
788
788
$rootScope . $digest ( ) ;
789
789
} ) ;
790
790
@@ -827,7 +827,7 @@ describe('pagination directive', function() {
827
827
paginationConfig . previousText = 'PR' ;
828
828
paginationConfig . nextText = 'NE' ;
829
829
paginationConfig . lastText = 'LA' ;
830
- element = $compile ( '<uib-pagination total-items="total" ng-model="currentPage"></uib-pagination >' ) ( $rootScope ) ;
830
+ element = $compile ( '<ul uib-pagination total-items="total" ng-model="currentPage"></ul >' ) ( $rootScope ) ;
831
831
$rootScope . $digest ( ) ;
832
832
833
833
expect ( getPaginationEl ( 0 ) . text ( ) ) . toBe ( 'FI' ) ;
@@ -838,23 +838,23 @@ describe('pagination directive', function() {
838
838
839
839
it ( 'contains number of pages + 2 li elements' , function ( ) {
840
840
paginationConfig . itemsPerPage = 5 ;
841
- element = $compile ( '<uib-pagination total-items="total" ng-model="currentPage"></uib-pagination >' ) ( $rootScope ) ;
841
+ element = $compile ( '<ul uib-pagination total-items="total" ng-model="currentPage"></ul >' ) ( $rootScope ) ;
842
842
$rootScope . $digest ( ) ;
843
843
844
844
expect ( getPaginationBarSize ( ) ) . toBe ( 12 ) ;
845
845
} ) ;
846
846
847
847
it ( 'should take maxSize defaults into account' , function ( ) {
848
848
paginationConfig . maxSize = 2 ;
849
- element = $compile ( '<uib-pagination total-items="total" ng-model="currentPage"></uib-pagination >' ) ( $rootScope ) ;
849
+ element = $compile ( '<ul uib-pagination total-items="total" ng-model="currentPage"></ul >' ) ( $rootScope ) ;
850
850
$rootScope . $digest ( ) ;
851
851
852
852
expect ( getPaginationBarSize ( ) ) . toBe ( 4 ) ;
853
853
} ) ;
854
854
855
855
it ( 'should take forceEllipses defaults into account' , function ( ) {
856
856
paginationConfig . forceEllipses = true ;
857
- element = $compile ( '<uib-pagination total-items="total" ng-model="currentPage" max-size="2"></uib-pagination >' ) ( $rootScope ) ;
857
+ element = $compile ( '<ul uib-pagination total-items="total" ng-model="currentPage" max-size="2"></ul >' ) ( $rootScope ) ;
858
858
$rootScope . $digest ( ) ;
859
859
860
860
// Should contain 2 nav buttons, 2 pages, and 2 ellipsis since the currentPage defaults to 3, which is in the middle
@@ -865,7 +865,7 @@ describe('pagination directive', function() {
865
865
paginationConfig . boundaryLinkNumbers = true ;
866
866
$rootScope . total = 88 ; // 9 pages
867
867
$rootScope . currentPage = 5 ;
868
- element = $compile ( '<uib-pagination total-items="total" ng-model="currentPage" max-size="3"></uib-pagination >' ) ( $rootScope ) ;
868
+ element = $compile ( '<ul uib-pagination total-items="total" ng-model="currentPage" max-size="3"></ul >' ) ( $rootScope ) ;
869
869
$rootScope . $digest ( ) ;
870
870
871
871
// Should contain 2 nav buttons, 2 pages, 2 ellipsis, and 2 extra end numbers since the currentPage is in the middle
@@ -879,7 +879,7 @@ describe('pagination directive', function() {
879
879
$rootScope . pageLabel = function ( id ) {
880
880
return 'test_' + id ;
881
881
} ;
882
- element = $compile ( '<uib-pagination boundary-links="true" page-label="pageLabel($page)" first-text="<<" previous-text="<" next-text=">" last-text=">>" total-items="total" ng-model="currentPage"></uib-pagination >' ) ( $rootScope ) ;
882
+ element = $compile ( '<ul uib-pagination boundary-links="true" page-label="pageLabel($page)" first-text="<<" previous-text="<" next-text=">" last-text=">>" total-items="total" ng-model="currentPage"></ul >' ) ( $rootScope ) ;
883
883
$rootScope . $digest ( ) ;
884
884
} ) ;
885
885
@@ -904,7 +904,7 @@ describe('pagination directive', function() {
904
904
905
905
describe ( 'disabled with ngDisable' , function ( ) {
906
906
beforeEach ( function ( ) {
907
- element = $compile ( '<uib-pagination total-items="total" ng-model="currentPage" ng-disabled="disabled"></uib-pagination >' ) ( $rootScope ) ;
907
+ element = $compile ( '<ul uib-pagination total-items="total" ng-model="currentPage" ng-disabled="disabled"></ul >' ) ( $rootScope ) ;
908
908
$rootScope . currentPage = 3 ;
909
909
$rootScope . $digest ( ) ;
910
910
} ) ;
@@ -941,7 +941,7 @@ describe('pagination directive', function() {
941
941
it ( 'should retain the model value when total-items starts as undefined' , function ( ) {
942
942
$rootScope . currentPage = 5 ;
943
943
$rootScope . total = undefined ;
944
- element = $compile ( '<uib-pagination total-items="total" ng-model="currentPage"></uib-pagination >' ) ( $rootScope ) ;
944
+ element = $compile ( '<ul uib-pagination total-items="total" ng-model="currentPage"></ul >' ) ( $rootScope ) ;
945
945
$rootScope . $digest ( ) ;
946
946
947
947
expect ( $rootScope . currentPage ) . toBe ( 5 ) ;
0 commit comments