diff --git a/test/api/v3/integration/tasks/groups/POST-tasks_group_id_assign_user_id.test.js b/test/api/v3/integration/tasks/groups/POST-tasks_group_id_assign_user_id.test.js index 2e122e78fc..1870f5b768 100644 --- a/test/api/v3/integration/tasks/groups/POST-tasks_group_id_assign_user_id.test.js +++ b/test/api/v3/integration/tasks/groups/POST-tasks_group_id_assign_user_id.test.js @@ -105,9 +105,9 @@ describe('POST /tasks/:taskId/assign/:memberId', () => { const groupTask = await user.get(`/tasks/group/${guild._id}`); - expect(member.notifications.length).to.equal(2); - expect(member.notifications[1].type).to.equal('GROUP_TASK_ASSIGNED'); - expect(member.notifications[1].taskId).to.equal(groupTask._id); + const lastNotification = member.notifications[member.notifications.length - 1]; + expect(lastNotification.type).to.equal('GROUP_TASK_ASSIGNED'); + expect(lastNotification.taskId).to.equal(groupTask._id); }); it('assigns a task to multiple users', async () => { diff --git a/test/api/v3/integration/tasks/groups/POST-tasks_task_id_unassign.test.js b/test/api/v3/integration/tasks/groups/POST-tasks_task_id_unassign.test.js index 117c9f760f..7338482971 100644 --- a/test/api/v3/integration/tasks/groups/POST-tasks_task_id_unassign.test.js +++ b/test/api/v3/integration/tasks/groups/POST-tasks_task_id_unassign.test.js @@ -89,10 +89,12 @@ describe('POST /tasks/:taskId/unassign/:memberId', () => { }); it('removes task assignment notification from unassigned user', async () => { + await member.sync(); + const oldNotificationCount = member.notifications.length; await user.post(`/tasks/${task._id}/unassign/${member._id}`); await member.sync(); - expect(member.notifications.length).to.equal(1); // mystery items + expect(member.notifications.length).to.equal(oldNotificationCount - 1); }); it('unassigns a user and only that user from a task', async () => {