mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
raise coverage for tasks api calls (#10029)
* - updates a group task - approval is required - updates a group task with checklist * add expect to test the new checklist length * - moves tasks to a specified position out of length * remove unused line * website getter tasks tests * re-add sanitizeUserChallengeTask * change config.json.example variable to be a string not a boolean * fix tests - pick the text / up/down props too * fix test - remove changes on text/up/down - revert sanitize condition - revert sanitization props
This commit is contained in:
@@ -169,9 +169,13 @@ TaskSchema.statics.findByIdOrAlias = async function findByIdOrAlias (identifier,
|
||||
// Sanitize user tasks linked to a challenge
|
||||
// See http://habitica.wikia.com/wiki/Challenges#Challenge_Participant.27s_Permissions for more info
|
||||
TaskSchema.statics.sanitizeUserChallengeTask = function sanitizeUserChallengeTask (taskObj) {
|
||||
let initialSanitization = this.sanitize(taskObj);
|
||||
const initialSanitization = this.sanitize(taskObj);
|
||||
|
||||
return _.pick(initialSanitization, ['streak', 'checklist', 'attribute', 'reminders', 'tags', 'notes', 'collapseChecklist', 'alias', 'yesterDaily', 'counterDown', 'counterUp']);
|
||||
return _.pick(initialSanitization, [
|
||||
'streak', 'checklist', 'attribute', 'reminders',
|
||||
'tags', 'notes', 'collapseChecklist',
|
||||
'alias', 'yesterDaily', 'counterDown', 'counterUp',
|
||||
]);
|
||||
};
|
||||
|
||||
// Sanitize checklist objects (disallowing id)
|
||||
|
||||
Reference in New Issue
Block a user