summaryrefslogtreecommitdiffstats
path: root/apps/comments/tests
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2017-02-13 17:49:05 -0600
committerMorris Jobke <hey@morrisjobke.de>2017-02-13 17:53:33 -0600
commit200a28255e058843465c63080d917170de293ee6 (patch)
tree86c8f04fc95b22e8f2e973e16f026ae1d2552ec3 /apps/comments/tests
parent88047aaea732d77bf38730566842fc163c6ba3a1 (diff)
downloadnextcloud-server-200a28255e058843465c63080d917170de293ee6.tar.gz
nextcloud-server-200a28255e058843465c63080d917170de293ee6.zip
Always enable avatars
* we introduced this setting in the begining because our avatar support caused some performance issues, but we fixed them and should only provide one way how Nextcloud looks Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'apps/comments/tests')
-rw-r--r--apps/comments/tests/js/commentstabviewSpec.js17
1 files changed, 3 insertions, 14 deletions
diff --git a/apps/comments/tests/js/commentstabviewSpec.js b/apps/comments/tests/js/commentstabviewSpec.js
index 9e4bf4f0533..0bbfaa1f295 100644
--- a/apps/comments/tests/js/commentstabviewSpec.js
+++ b/apps/comments/tests/js/commentstabviewSpec.js
@@ -43,7 +43,6 @@ describe('OCA.Comments.CommentsTabView tests', function() {
clock = sinon.useFakeTimers(Date.UTC(2016, 1, 3, 10, 5, 9));
fetchStub = sinon.stub(OCA.Comments.CommentCollection.prototype, 'fetchNext');
view = new OCA.Comments.CommentsTabView();
- view._avatarsEnabled = false;
fileInfoModel = new OCA.Files.FileInfoModel({
id: 5,
name: 'One.txt',
@@ -146,7 +145,6 @@ describe('OCA.Comments.CommentsTabView tests', function() {
});
it('renders mentioned user id to avatar and displayname', function() {
- view._avatarsEnabled = true;
view.collection.set(testComments);
var $comment = view.$el.find('.comment[data-id=3] .message');
@@ -158,18 +156,6 @@ describe('OCA.Comments.CommentsTabView tests', function() {
expect($comment.find('strong:last-child').text()).toEqual('Lord Banquo');
});
- it('renders mentioned user id to displayname, avatars disabled', function() {
- view.collection.set(testComments);
-
- var $comment = view.$el.find('.comment[data-id=3] .message');
- expect($comment.length).toEqual(1);
- expect($comment.find('.avatar[data-user=macbeth]').length).toEqual(0);
- expect($comment.find('strong:first-child').text()).toEqual('Thane of Cawdor');
-
- expect($comment.find('.avatar[data-user=banquo]').length).toEqual(0);
- expect($comment.find('strong:last-child').text()).toEqual('Lord Banquo');
- });
-
});
describe('more comments', function() {
var hasMoreResultsStub;
@@ -316,11 +302,13 @@ describe('OCA.Comments.CommentsTabView tests', function() {
describe('editing comments', function() {
var saveStub;
var fetchStub;
+ var avatarStub;
var currentUserStub;
beforeEach(function() {
saveStub = sinon.stub(OCA.Comments.CommentModel.prototype, 'save');
fetchStub = sinon.stub(OCA.Comments.CommentModel.prototype, 'fetch');
+ avatarStub = sinon.stub($.fn, 'avatar');
currentUserStub = sinon.stub(OC, 'getCurrentUser');
currentUserStub.returns({
uid: 'testuser',
@@ -348,6 +336,7 @@ describe('OCA.Comments.CommentsTabView tests', function() {
afterEach(function() {
saveStub.restore();
fetchStub.restore();
+ avatarStub.restore();
currentUserStub.restore();
});