Skip to content

Commit ae8d3dc

Browse files
committed
test(events): add test to ensure no notifications are sent when no changes occur during bulk assignee update
1 parent bf64ade commit ae8d3dc

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

test/resolvers/event-bulk-update-assignee.test.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,4 +166,25 @@ describe('EventsMutations.bulkUpdateAssignee', () => {
166166
null
167167
);
168168
});
169+
170+
it('should not enqueue notifications when nothing changed', async () => {
171+
bulkUpdateAssignee.mockResolvedValue({
172+
acknowledged: true,
173+
modifiedCount: 0,
174+
});
175+
176+
await eventResolvers.EventsMutations.bulkUpdateAssignee(
177+
{},
178+
{
179+
input: {
180+
projectId: 'p1',
181+
eventIds: [ '507f1f77bcf86cd799439011' ],
182+
assignee: ASSIGNEE_ID,
183+
},
184+
},
185+
ctx
186+
);
187+
188+
expect(sendPersonalNotification).not.toHaveBeenCalled();
189+
});
169190
});

0 commit comments

Comments
 (0)