test fixes

This commit is contained in:
Wyatt Johnson
2017-09-08 16:23:31 -06:00
parent d20bd20005
commit 9af21b4226
3 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -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)
];
};
+3 -1
View File
@@ -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;
+1 -1
View File
@@ -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);