diff --git a/test/notifications/senders/AppleNotificationSenderTests.test.ts b/test/notifications/senders/AppleNotificationSenderTests.test.ts index 919f535..9804e20 100644 --- a/test/notifications/senders/AppleNotificationSenderTests.test.ts +++ b/test/notifications/senders/AppleNotificationSenderTests.test.ts @@ -1,7 +1,10 @@ import { beforeEach, describe, expect, it, jest } from "@jest/globals"; import http2 from "http2"; import { EventEmitter } from "node:events"; -import { AppleNotificationSender } from "../../../src/notifications/senders/AppleNotificationSender"; +import { + AppleNotificationSender, + NotificationAlertArguments +} from "../../../src/notifications/senders/AppleNotificationSender"; import { ETANotificationScheduler } from "../../../src/notifications/schedulers/ETANotificationScheduler"; jest.mock("http2"); @@ -89,6 +92,26 @@ describe("AppleNotificationSender", () => { }); describe("sendNotificationImmediately", () => { + it('makes the connection to the http server if the notification should be sent', async () => { + }); + + it('throws an error if the bundle ID is not set correctly', async () => { + + }); + + it('does not send notification if shouldActuallySendNotifications is false', async () => { + notificationSender = new AppleNotificationSender(false); + + const notificationArguments: NotificationAlertArguments = { + title: 'Test notification', + body: 'This notification should not send', + } + + const result = await notificationSender.sendNotificationImmediately('1', notificationArguments); + + expect(http2.connect).not.toHaveBeenCalled(); + expect(result).toBe(true); + }); }); });