Skip to content

Commit

Permalink
Adds a test for mimo84#41's bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
pocketarc committed Mar 18, 2014
1 parent fc44c3a commit ac1ad86
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,16 @@ $(function () {
$('#qunit-fixture').empty();

});

test("Newlines are not counted twice", function() {
var maxlengthInput = $('<textarea maxlength="10"></textarea>').val("t\r\nt")
.appendTo('#qunit-fixture');

maxlengthInput.maxlength();
maxlengthInput.focus();

ok($('.bootstrap-maxlength').html() === '3 / 10' , 'Current length is: '+$('.bootstrap-maxlength').html()+'. Expected 3 / 10.');

})

});

0 comments on commit ac1ad86

Please sign in to comment.