Fix tests being dependant on NEW_MYSTERY_ITEMS notification (#15288)

* Fix tests being dependant on NEW_MYSTERY_ITEMS notification

* remove only

* don’t actually need to check notification count

* fix tests

---------

Co-authored-by: Sabe Jones <sabrecat@gmail.com>
This commit is contained in:
Phillip Thelen 2024-09-04 01:21:00 +02:00 committed by GitHub
parent 2483e19bee
commit 8e643747f8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 4 deletions

View file

@ -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 () => {

View file

@ -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 () => {