From ac65e23984bf63864020ff46e9b84f5a1d597aa1 Mon Sep 17 00:00:00 2001 From: Brendan Chen Date: Mon, 24 Mar 2025 10:11:17 -0700 Subject: [PATCH] add test for making a connection to the server --- .../senders/AppleNotificationSenderTests.test.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/notifications/senders/AppleNotificationSenderTests.test.ts b/test/notifications/senders/AppleNotificationSenderTests.test.ts index 9804e20..2fd2805 100644 --- a/test/notifications/senders/AppleNotificationSenderTests.test.ts +++ b/test/notifications/senders/AppleNotificationSenderTests.test.ts @@ -93,13 +93,25 @@ describe("AppleNotificationSender", () => { describe("sendNotificationImmediately", () => { it('makes the connection to the http server if the notification should be sent', async () => { + const notificationArguments: NotificationAlertArguments = { + title: 'Test notification', + body: 'This notification will send', + } + const result = await notificationSender.sendNotificationImmediately('1', notificationArguments); + + expect(http2.connect).toHaveBeenCalled(); + expect(result).toBe(true); }); it('throws an error if the bundle ID is not set correctly', async () => { }); + it('returns false if there is an error sending the notification', async () => { + + }); + it('does not send notification if shouldActuallySendNotifications is false', async () => { notificationSender = new AppleNotificationSender(false);