mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-08-03 08:21:07 +00:00
fix failing tests
This commit is contained in:
parent
78c1ee2053
commit
29b6e958c6
4 changed files with 4 additions and 4 deletions
|
|
@ -79,7 +79,7 @@ describe('PUT /tasks/:id', () => {
|
|||
let id2 = generateUUID();
|
||||
|
||||
let savedDaily = await user.put(`/tasks/${daily._id}`, {
|
||||
checklist: [
|
||||
reminders: [
|
||||
{id: id1, time: new Date(), startDate: new Date()},
|
||||
{id: id2, time: new Date(), startDate: new Date()},
|
||||
],
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ describe('PUT /tasks/:taskId/checklist/:itemId', () => {
|
|||
savedTask = await user.put(`/tasks/${task._id}/checklist/${savedTask.checklist[0]._id}`, {
|
||||
text: 'updated',
|
||||
completed: true,
|
||||
_id: 123,
|
||||
_id: 123, // ignored
|
||||
});
|
||||
|
||||
expect(savedTask.checklist.length).to.equal(1);
|
||||
|
|
|
|||
|
|
@ -570,7 +570,7 @@ api.addChecklistItem = {
|
|||
|
||||
if (task.type !== 'daily' && task.type !== 'todo') throw new BadRequest(res.t('checklistOnlyDailyTodo'));
|
||||
|
||||
task.checklist.push(Tasks.Task.sanitizeChecklist(req.body));
|
||||
task.checklist.push(Tasks.Task.sanitizeChecklist(req.body)); // TODO why not allow to supply _id on creation?
|
||||
let savedTask = await task.save();
|
||||
|
||||
res.respond(200, savedTask); // TODO what to return
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ TaskSchema.statics.sanitizeChecklist = function sanitizeChecklist (checklistObj)
|
|||
};
|
||||
|
||||
// Sanitize reminder objects (disallowing id)
|
||||
TaskSchema.statics.sanitizeChecklist = function sanitizeChecklist (reminderObj) {
|
||||
TaskSchema.statics.sanitizeReminder = function sanitizeReminder (reminderObj) {
|
||||
delete reminderObj.id;
|
||||
return reminderObj;
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue