From 7a44e1aa4e8e2026754a758276668f0f15cb2c97 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Fri, 11 Apr 2025 23:49:31 +0200 Subject: [PATCH] test that there is no email sent when no notification (#8362) --- backend/src/middleware/notifications/posts-in-groups.spec.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/backend/src/middleware/notifications/posts-in-groups.spec.ts b/backend/src/middleware/notifications/posts-in-groups.spec.ts index 86e700d1c..742685816 100644 --- a/backend/src/middleware/notifications/posts-in-groups.spec.ts +++ b/backend/src/middleware/notifications/posts-in-groups.spec.ts @@ -295,6 +295,7 @@ describe('notify group members of new posts in group', () => { }) it('sends NO notification when another post is posted', async () => { + jest.clearAllMocks() authenticatedUser = await groupMember.toJson() await markAllAsRead() authenticatedUser = await postAuthor.toJson() @@ -323,6 +324,10 @@ describe('notify group members of new posts in group', () => { }) }) + it('sends NO email', () => { + expect(sendMailMock).not.toHaveBeenCalled() + }) + describe('group member unmutes group again but disables email', () => { beforeAll(async () => { jest.clearAllMocks()