Merge pull request #7648 from nextcloud/fix_7414

Show max warning comment lenth again
This commit is contained in:
Roeland Jago Douma 2018-01-02 11:11:38 +01:00 committed by GitHub
commit d9419f333b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -512,7 +512,7 @@
_onTypeComment: function(ev) {
var $field = $(ev.target);
var len = $field.val().length;
var len = $field.text().length;
var $submitButton = $field.data('submitButtonEl');
if (!$submitButton) {
$submitButton = $field.closest('form').find('.submit');

View File

@ -411,7 +411,7 @@ describe('OCA.Comments.CommentsTabView tests', function() {
expect($message.hasClass('error')).toEqual(false);
});
it('displays tooltip when limit is almost reached', function() {
$message.val(createMessageWithLength(view._commentMaxLength - 2));
$message.text(createMessageWithLength(view._commentMaxLength - 2));
$message.trigger('change');
expect(tooltipStub.calledWith('show')).toEqual(true);
@ -419,7 +419,7 @@ describe('OCA.Comments.CommentsTabView tests', function() {
expect($message.hasClass('error')).toEqual(false);
});
it('displays tooltip and disabled button when limit is exceeded', function() {
$message.val(createMessageWithLength(view._commentMaxLength + 2));
$message.text(createMessageWithLength(view._commentMaxLength + 2));
$message.trigger('change');
expect(tooltipStub.calledWith('show')).toEqual(true);