add additional check for notification service scheduling

This commit is contained in:
2025-02-04 11:25:31 -08:00
parent 94c15f93dd
commit 69e2748eec

View File

@@ -56,6 +56,8 @@ describe("MutationResolvers", () => {
const notificationResponse = response.body.singleResult.data?.scheduleNotification as any; const notificationResponse = response.body.singleResult.data?.scheduleNotification as any;
expect(notificationResponse?.success).toBe(true); expect(notificationResponse?.success).toBe(true);
expect(notificationResponse?.notification).toStrictEqual(notificationInput); expect(notificationResponse?.notification).toStrictEqual(notificationInput);
expect(context.notificationService.isNotificationScheduled(notificationInput)).toBe(true);
}); });
it("fails if the shuttle ID doesn't exist", async () => { it("fails if the shuttle ID doesn't exist", async () => {
@@ -73,6 +75,8 @@ describe("MutationResolvers", () => {
expect(response.body.singleResult.errors).toBeUndefined(); expect(response.body.singleResult.errors).toBeUndefined();
const notificationResponse = response.body.singleResult.data?.scheduleNotification as any; const notificationResponse = response.body.singleResult.data?.scheduleNotification as any;
expect(notificationResponse.success).toBe(false); expect(notificationResponse.success).toBe(false);
expect(context.notificationService.isNotificationScheduled(notificationInput)).toBe(false);
}); });
it("fails if the stop ID doesn't exist", async () => { it("fails if the stop ID doesn't exist", async () => {
@@ -90,6 +94,8 @@ describe("MutationResolvers", () => {
expect(response.body.singleResult.errors).toBeUndefined(); expect(response.body.singleResult.errors).toBeUndefined();
const notificationResponse = response.body.singleResult.data?.scheduleNotification as any; const notificationResponse = response.body.singleResult.data?.scheduleNotification as any;
expect(notificationResponse.success).toBe(false); expect(notificationResponse.success).toBe(false);
expect(context.notificationService.isNotificationScheduled(notificationInput)).toBe(false);
}); });
}); });