Skip to content

Commit

Permalink
Adding tests for custom css classes for first, last, next, prev items
Browse files Browse the repository at this point in the history
  • Loading branch information
brantwills committed Feb 13, 2016
1 parent 3c3f67b commit 0253966
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions test/paging-css.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ describe('Angular-Paging: CSS Class Name Tests', function() {
'disabled-class="{{disabledClass}}" ' +
'show-prev-next="{{showPrevNext}}" ' +
'show-first-last="{{showFirstLast}}" ' +
'text-next-class="{{textNextClass}}" ' +
'text-prev-class="{{textPrevClass}}" ' +
'text-first-class="{{textFirstClass}}" ' +
'text-last-class="{{textLastClass}}" ' +
'</div>';

paging = compile(template)(scope);
Expand Down Expand Up @@ -144,4 +148,30 @@ describe('Angular-Paging: CSS Class Name Tests', function() {

});


it('Should append the class items to the first, last, next, prev items', function(){

scope.textFirstClass = 'first class';
scope.textLastClass = 'last class';
scope.textNextClass = 'next class';
scope.textPrevClass = 'prev class';
recompile();

var items = paging.find('a');
var count = items.length;

var firstItem = items.eq(0);
var prevItem = items.eq(1);
var lastItem = items.eq(count - 1);
var nextItem = items.eq(count - 2);

expect(firstItem.hasClass(scope.textFirstClass)).toEqual(true);
expect(prevItem.hasClass(scope.textPrevClass)).toEqual(true);
expect(nextItem.hasClass(scope.textNextClass)).toEqual(true);
expect(lastItem.hasClass(scope.textLastClass)).toEqual(true);

});



});

0 comments on commit 0253966

Please sign in to comment.