mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 16:00:32 +00:00
add test for making a connection to the server
This commit is contained in:
@@ -93,13 +93,25 @@ describe("AppleNotificationSender", () => {
|
|||||||
|
|
||||||
describe("sendNotificationImmediately", () => {
|
describe("sendNotificationImmediately", () => {
|
||||||
it('makes the connection to the http server if the notification should be sent', async () => {
|
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('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 () => {
|
it('does not send notification if shouldActuallySendNotifications is false', async () => {
|
||||||
notificationSender = new AppleNotificationSender(false);
|
notificationSender = new AppleNotificationSender(false);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user