From 1b20b10280ce4482c7548c6dbfbbf08583442433 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=A4fer?= Date: Tue, 13 Nov 2018 19:31:53 +0100 Subject: [PATCH] Send isBlacklisted to frontend --- server/services/comments/comments.hooks.js | 2 ++ test/services/comments.test.js | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/server/services/comments/comments.hooks.js b/server/services/comments/comments.hooks.js index a6fdc5d..c12d207 100644 --- a/server/services/comments/comments.hooks.js +++ b/server/services/comments/comments.hooks.js @@ -124,6 +124,7 @@ module.exports = { data: { content: 'Comments of this blacklisted user are not visible.', contentExcerpt: 'Comments of this blacklisted user are not visible.', + isBlacklisted: true, hasMore: false } }) @@ -134,6 +135,7 @@ module.exports = { data: { content: 'Comments of this blacklisted user are not visible.', contentExcerpt: 'Comments of this blacklisted user are not visible.', + isBlacklisted: true, hasMore: false } }) diff --git a/test/services/comments.test.js b/test/services/comments.test.js index cb442fc..95e5c2b 100644 --- a/test/services/comments.test.js +++ b/test/services/comments.test.js @@ -136,6 +136,12 @@ describe('\'comments\' service', () => { assert.equal(comment.contentExcerpt, 'Comments of this blacklisted user are not visible.'); }); + it('sends isBlacklisted: true', async () => { + const comments = await service.find(params); + const comment = comments.data[1]; + assert.equal(comment.isBlacklisted, true); + }); + context('but if user is not authenticated', () => { it('is visible', async () => { const comments = await service.find();