diff --git a/test/api/v3/integration/tasks/GET-tasks_user.test.js b/test/api/v3/integration/tasks/GET-tasks_user.test.js index 31361d46bd..c08baafce3 100644 --- a/test/api/v3/integration/tasks/GET-tasks_user.test.js +++ b/test/api/v3/integration/tasks/GET-tasks_user.test.js @@ -101,34 +101,6 @@ describe('GET /tasks/user', () => { expect(allCompletedTodos[allCompletedTodos.length - 1].text).to.equal('todo to complete 2'); }); - it('returns only some completed todos if req.query.type is "completedTodos" or "_allCompletedTodos"', async () => { - const LIMIT = 30; - const numberOfTodos = LIMIT + 1; - const todosInput = []; - - for (let i = 0; i < numberOfTodos; i += 1) { - todosInput[i] = { text: `todo to complete ${i}`, type: 'todo' }; - } - const todos = await user.post('/tasks/user', todosInput); - await user.sync(); - const initialTodoCount = user.tasksOrder.todos.length; - - for (let i = 0; i < numberOfTodos; i += 1) { - const id = todos[i]._id; - - await user.post(`/tasks/${id}/score/up`); // eslint-disable-line no-await-in-loop - } - await user.sync(); - - expect(user.tasksOrder.todos.length).to.equal(initialTodoCount - numberOfTodos); - - const completedTodos = await user.get('/tasks/user?type=completedTodos'); - expect(completedTodos.length).to.equal(LIMIT); - - const allCompletedTodos = await user.get('/tasks/user?type=_allCompletedTodos'); - expect(allCompletedTodos.length).to.equal(numberOfTodos); - }); - it('returns dailies with isDue for the date specified', async () => { // @TODO Add required format const startDate = moment().subtract('1', 'days').toISOString(); diff --git a/website/server/libs/tasks/index.js b/website/server/libs/tasks/index.js index 4ad1bb71e0..94acaede40 100644 --- a/website/server/libs/tasks/index.js +++ b/website/server/libs/tasks/index.js @@ -207,11 +207,7 @@ async function getTasks (req, res, options = {}) { query.type = 'todo'; query.completed = false; // Exclude completed todos } else if (type === 'completedTodos' || type === '_allCompletedTodos') { // _allCompletedTodos is currently in BETA and is likely to be removed in future - limit = 30; - - if (type === '_allCompletedTodos') { - limit = 0; // no limit - } + limit = 0; // no limit, the 30/90 days of data for subscribers is handled during cron query.type = 'todo'; query.completed = true;