From 9af21b4226779b8a346764ae6521ce74f0e8bcf9 Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Fri, 8 Sep 2017 16:23:31 -0600 Subject: [PATCH] test fixes --- graph/mutators/comment.js | 2 +- services/assets.js | 4 +++- services/comments.js | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/graph/mutators/comment.js b/graph/mutators/comment.js index a75e319f4..c6e335018 100644 --- a/graph/mutators/comment.js +++ b/graph/mutators/comment.js @@ -218,7 +218,7 @@ const filterNewComment = async (context, {body, asset_id}) => { wl.scan('body', body), // Return the asset's settings. - AssetsService.rectifySettings(asset, settings) + await AssetsService.rectifySettings(asset, settings) ]; }; diff --git a/services/assets.js b/services/assets.js index cddfcfb7c..8f93de009 100644 --- a/services/assets.js +++ b/services/assets.js @@ -34,13 +34,15 @@ module.exports = class AssetsService { globalSettings, asset, ] = await Promise.all([ - settings || SettingsService.retrieve(), + settings !== null ? settings : SettingsService.retrieve(), assetQuery, ]); // If the asset exists and has settings then return the merged object. if (asset && asset.settings) { settings = merge({}, globalSettings, asset.settings); + } else { + settings = globalSettings; } return settings; diff --git a/services/comments.js b/services/comments.js index 1c39fdafb..82914bcd0 100644 --- a/services/comments.js +++ b/services/comments.js @@ -160,7 +160,7 @@ module.exports = class CommentsService { // We should adjust the comment's status such that if it was approved // previously, we should mark the comment as 'NONE' or 'PREMOD', which ever // was most recent if the new comment is destined to be `NONE` or `PREMOD`. - if (originalComment.status === 'ACCEPTED' && ['NONE', 'PREMOD'].includes(status)) { + if (originalComment.status === 'ACCEPTED' && status === 'NONE') { const lastUnmoderatedStatus = CommentsService.lastUnmoderatedStatus(originalComment);