mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 16:00:32 +00:00
add additional check for notification service scheduling
This commit is contained in:
@@ -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);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user