@@ -222,7 +222,8 @@ describe('pagination directive with max size option & no rotate', function () {
222222 $rootScope . numPages = 12 ;
223223 $rootScope . currentPage = 7 ;
224224 $rootScope . maxSize = 5 ;
225- element = $compile ( '<pagination num-pages="numPages" current-page="currentPage" max-size="maxSize" rotate="false"></pagination>' ) ( $rootScope ) ;
225+ $rootScope . rotate = false ;
226+ element = $compile ( '<pagination num-pages="numPages" current-page="currentPage" max-size="maxSize" rotate="rotate"></pagination>' ) ( $rootScope ) ;
226227 $rootScope . $digest ( ) ;
227228 } ) ) ;
228229
@@ -296,7 +297,6 @@ describe('pagination directive with added first & last links', function () {
296297 $rootScope . $digest ( ) ;
297298 } ) ) ;
298299
299-
300300 it ( 'contains one ul and num-pages + 4 li elements' , function ( ) {
301301 expect ( element . find ( 'ul' ) . length ) . toBe ( 1 ) ;
302302 expect ( element . find ( 'li' ) . length ) . toBe ( 9 ) ;
@@ -331,7 +331,6 @@ describe('pagination directive with added first & last links', function () {
331331 expect ( element . find ( 'li' ) . eq ( - 1 ) . hasClass ( 'disabled' ) ) . toBe ( true ) ;
332332 } ) ;
333333
334-
335334 it ( 'changes currentPage if the "first" link is clicked' , function ( ) {
336335 var first = element . find ( 'li' ) . eq ( 0 ) . find ( 'a' ) . eq ( 0 ) ;
337336 first . click ( ) ;
@@ -365,35 +364,35 @@ describe('pagination directive with added first & last links', function () {
365364 } ) ;
366365
367366 it ( 'changes "first" & "last" text from attributes' , function ( ) {
368- element = $compile ( '<pagination boundary-links="true" first-text="\' <<<\' " last-text="\' >>>\' " num-pages="numPages" current-page="currentPage"></pagination>' ) ( $rootScope ) ;
367+ element = $compile ( '<pagination boundary-links="true" first-text="<<<" last-text=">>>" num-pages="numPages" current-page="currentPage"></pagination>' ) ( $rootScope ) ;
369368 $rootScope . $digest ( ) ;
370369
371370 expect ( element . find ( 'li' ) . eq ( 0 ) . text ( ) ) . toBe ( '<<<' ) ;
372371 expect ( element . find ( 'li' ) . eq ( - 1 ) . text ( ) ) . toBe ( '>>>' ) ;
373372 } ) ;
374373
375374 it ( 'changes "previous" & "next" text from attributes' , function ( ) {
376- element = $compile ( '<pagination boundary-links="true" previous-text="\'<<\' " next-text="\'>>\' " num-pages="numPages" current-page="currentPage"></pagination>' ) ( $rootScope ) ;
375+ element = $compile ( '<pagination boundary-links="true" previous-text="<< " next-text=">> " num-pages="numPages" current-page="currentPage"></pagination>' ) ( $rootScope ) ;
377376 $rootScope . $digest ( ) ;
378377
379378 expect ( element . find ( 'li' ) . eq ( 1 ) . text ( ) ) . toBe ( '<<' ) ;
380379 expect ( element . find ( 'li' ) . eq ( - 2 ) . text ( ) ) . toBe ( '>>' ) ;
381380 } ) ;
382381
383- it ( 'changes "first" & "last" text from attribute variables ' , function ( ) {
382+ it ( 'changes "first" & "last" text from interpolated attributes ' , function ( ) {
384383 $rootScope . myfirstText = '<<<' ;
385384 $rootScope . mylastText = '>>>' ;
386- element = $compile ( '<pagination boundary-links="true" first-text="myfirstText" last-text="mylastText" num-pages="numPages" current-page="currentPage"></pagination>' ) ( $rootScope ) ;
385+ element = $compile ( '<pagination boundary-links="true" first-text="{{ myfirstText}} " last-text="{{ mylastText}} " num-pages="numPages" current-page="currentPage"></pagination>' ) ( $rootScope ) ;
387386 $rootScope . $digest ( ) ;
388387
389388 expect ( element . find ( 'li' ) . eq ( 0 ) . text ( ) ) . toBe ( '<<<' ) ;
390389 expect ( element . find ( 'li' ) . eq ( - 1 ) . text ( ) ) . toBe ( '>>>' ) ;
391390 } ) ;
392391
393- it ( 'changes "previous" & "next" text from attribute variables ' , function ( ) {
392+ it ( 'changes "previous" & "next" text from interpolated attributes ' , function ( ) {
394393 $rootScope . previousText = '<<' ;
395394 $rootScope . nextText = '>>' ;
396- element = $compile ( '<pagination boundary-links="true" previous-text="previousText" next-text="nextText" num-pages="numPages" current-page="currentPage"></pagination>' ) ( $rootScope ) ;
395+ element = $compile ( '<pagination boundary-links="true" previous-text="{{ previousText}} " next-text="{{ nextText}} " num-pages="numPages" current-page="currentPage"></pagination>' ) ( $rootScope ) ;
397396 $rootScope . $digest ( ) ;
398397
399398 expect ( element . find ( 'li' ) . eq ( 1 ) . text ( ) ) . toBe ( '<<' ) ;
@@ -461,7 +460,6 @@ describe('pagination directive with just number links', function () {
461460 expect ( $rootScope . currentPage ) . toBe ( 2 ) ;
462461 } ) ;
463462
464-
465463 it ( 'executes the onSelectPage expression when the current page changes' , function ( ) {
466464 $rootScope . selectPageHandler = jasmine . createSpy ( 'selectPageHandler' ) ;
467465 element = $compile ( '<pagination direction-links="false" num-pages="numPages" current-page="currentPage" on-select-page="selectPageHandler(page)"></pagination>' ) ( $rootScope ) ;
@@ -541,11 +539,11 @@ describe('pagination directive with first, last & number links', function () {
541539 $rootScope = _$rootScope_ ;
542540 $rootScope . numPages = 5 ;
543541 $rootScope . currentPage = 3 ;
544- element = $compile ( '<pagination boundary-links="true" direction-links="false" num-pages="numPages" current-page="currentPage"></pagination>' ) ( $rootScope ) ;
542+ $rootScope . directions = false ;
543+ element = $compile ( '<pagination boundary-links="true" direction-links="directions" num-pages="numPages" current-page="currentPage"></pagination>' ) ( $rootScope ) ;
545544 $rootScope . $digest ( ) ;
546545 } ) ) ;
547546
548-
549547 it ( 'contains one ul and num-pages + 2 li elements' , function ( ) {
550548 expect ( element . find ( 'ul' ) . length ) . toBe ( 1 ) ;
551549 expect ( element . find ( 'li' ) . length ) . toBe ( 7 ) ;
@@ -555,7 +553,6 @@ describe('pagination directive with first, last & number links', function () {
555553 expect ( element . find ( 'li' ) . eq ( - 1 ) . text ( ) ) . toBe ( 'Last' ) ;
556554 } ) ;
557555
558-
559556 it ( 'disables the "first" & activates "1" link if current-page is 1' , function ( ) {
560557 $rootScope . currentPage = 1 ;
561558 $rootScope . $digest ( ) ;
@@ -572,7 +569,6 @@ describe('pagination directive with first, last & number links', function () {
572569 expect ( element . find ( 'li' ) . eq ( - 1 ) . hasClass ( 'disabled' ) ) . toBe ( true ) ;
573570 } ) ;
574571
575-
576572 it ( 'changes currentPage if the "first" link is clicked' , function ( ) {
577573 var first = element . find ( 'li' ) . eq ( 0 ) . find ( 'a' ) . eq ( 0 ) ;
578574 first . click ( ) ;
@@ -598,7 +594,7 @@ describe('pagination bypass configuration from attributes', function () {
598594 $rootScope = _$rootScope_ ;
599595 $rootScope . numPages = 5 ;
600596 $rootScope . currentPage = 3 ;
601- element = $compile ( '<pagination boundary-links="true" first-text="\'<<\' " previous-text="\'<\' " next-text="\'>\' " last-text="\'>>\' " num-pages="numPages" current-page="currentPage"></pagination>' ) ( $rootScope ) ;
597+ element = $compile ( '<pagination boundary-links="true" first-text="<< " previous-text="< " next-text="> " last-text=">> " num-pages="numPages" current-page="currentPage"></pagination>' ) ( $rootScope ) ;
602598 $rootScope . $digest ( ) ;
603599 } ) ) ;
604600
0 commit comments