mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 07:50:31 +00:00
update server context to only include the notification repository
This commit is contained in:
@@ -44,7 +44,7 @@ describe("MutationResolvers", () => {
|
||||
const notificationResponse = response.body.singleResult.data?.scheduleNotification as any;
|
||||
expect(notificationResponse.success).toBe(false);
|
||||
|
||||
expect(context.notificationService.isNotificationScheduled(notificationInput)).toBe(false);
|
||||
expect(context.notificationRepository.isNotificationScheduled(notificationInput)).toBe(false);
|
||||
}
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ describe("MutationResolvers", () => {
|
||||
expect(notificationResponse?.success).toBe(true);
|
||||
expect(notificationResponse?.data).toEqual(expectedNotificationData);
|
||||
|
||||
expect(context.notificationService.getSecondsThresholdForScheduledNotification(expectedNotificationData)).toBe(240);
|
||||
expect(context.notificationRepository.getSecondsThresholdForScheduledNotification(expectedNotificationData)).toBe(240);
|
||||
});
|
||||
|
||||
it("adds a notification with the default seconds threshold if none is provided", async () => {
|
||||
@@ -93,7 +93,7 @@ describe("MutationResolvers", () => {
|
||||
const notificationResponse = response.body.singleResult.data?.scheduleNotification as any;
|
||||
expect(notificationResponse?.success).toBe(true);
|
||||
|
||||
expect(context.notificationService.getSecondsThresholdForScheduledNotification(notificationInput)).toBe(180);
|
||||
expect(context.notificationRepository.getSecondsThresholdForScheduledNotification(notificationInput)).toBe(180);
|
||||
});
|
||||
|
||||
it("fails if the shuttle ID doesn't exist", async () => {
|
||||
@@ -150,7 +150,7 @@ describe("MutationResolvers", () => {
|
||||
stopId: stop.id,
|
||||
secondsThreshold: 180,
|
||||
}
|
||||
await context.notificationService.scheduleNotification(notificationInput);
|
||||
await context.notificationRepository.scheduleNotification(notificationInput);
|
||||
|
||||
const notificationLookup = {
|
||||
...notificationInput
|
||||
@@ -166,7 +166,7 @@ describe("MutationResolvers", () => {
|
||||
expect(notificationResponse.success).toBe(true);
|
||||
expect(notificationResponse.data).toEqual(notificationLookup);
|
||||
|
||||
expect(context.notificationService.isNotificationScheduled(notificationLookup)).toBe(false);
|
||||
expect(context.notificationRepository.isNotificationScheduled(notificationLookup)).toBe(false);
|
||||
});
|
||||
|
||||
it("fails if the notification doesn't exist", async () => {
|
||||
|
||||
Reference in New Issue
Block a user