summaryrefslogtreecommitdiffstats
path: root/apps/comments
diff options
context:
space:
mode:
Diffstat (limited to 'apps/comments')
-rw-r--r--apps/comments/js/commentstabview.js2
-rw-r--r--apps/comments/tests/js/commentstabviewSpec.js4
2 files changed, 3 insertions, 3 deletions
diff --git a/apps/comments/js/commentstabview.js b/apps/comments/js/commentstabview.js
index 9b75cb4671e..bd89c8bbb49 100644
--- a/apps/comments/js/commentstabview.js
+++ b/apps/comments/js/commentstabview.js
@@ -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');
diff --git a/apps/comments/tests/js/commentstabviewSpec.js b/apps/comments/tests/js/commentstabviewSpec.js
index 813b2a72eae..0131bc7bce3 100644
--- a/apps/comments/tests/js/commentstabviewSpec.js
+++ b/apps/comments/tests/js/commentstabviewSpec.js
@@ -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);