From 2ccdba3d117699e41db55f92247981dc1d9b8af6 Mon Sep 17 00:00:00 2001 From: Brendan Chen Date: Mon, 24 Mar 2025 10:14:43 -0700 Subject: [PATCH] add test for failing error code --- .../senders/AppleNotificationSenderTests.test.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/notifications/senders/AppleNotificationSenderTests.test.ts b/test/notifications/senders/AppleNotificationSenderTests.test.ts index aed404d..9cbc0cb 100644 --- a/test/notifications/senders/AppleNotificationSenderTests.test.ts +++ b/test/notifications/senders/AppleNotificationSenderTests.test.ts @@ -120,7 +120,17 @@ describe("AppleNotificationSender", () => { }); it('returns false if there is an error sending the notification', async () => { + mockHttp2Connect(403); + const notificationArguments: NotificationAlertArguments = { + title: 'Test notification', + body: 'This notification will not send', + } + + const result = await notificationSender.sendNotificationImmediately('1', notificationArguments); + + expect(http2.connect).toHaveBeenCalled(); + expect(result).toBe(false); }); it('does not send notification if shouldActuallySendNotifications is false', async () => {