update tests to include the secondsThreshold argument

This commit is contained in:
2025-03-25 14:59:03 -07:00
parent 8874704acb
commit 07b80f2012

View File

@@ -65,10 +65,12 @@ describe("ETANotificationScheduler", () => {
deviceId: "1", deviceId: "1",
shuttleId: eta.shuttleId, shuttleId: eta.shuttleId,
stopId: eta.stopId, stopId: eta.stopId,
secondsThreshold: 240,
} }
const notificationData2 = { const notificationData2 = {
...notificationData1, ...notificationData1,
deviceId: "2", deviceId: "2",
secondsThreshold: 180,
} }
return { eta, notificationData1, notificationData2 }; return { eta, notificationData1, notificationData2 };
} }
@@ -79,7 +81,8 @@ describe("ETANotificationScheduler", () => {
const notificationData = { const notificationData = {
deviceId: "1", deviceId: "1",
shuttleId: "1", shuttleId: "1",
stopId: "1" stopId: "1",
secondsThreshold: 120,
}; };
await notificationService.scheduleNotification(notificationData); await notificationService.scheduleNotification(notificationData);
@@ -117,7 +120,7 @@ describe("ETANotificationScheduler", () => {
const shuttle = await addMockShuttleToRepository(repository, "1"); const shuttle = await addMockShuttleToRepository(repository, "1");
const stop = await addMockStopToRepository(repository, "1"); const stop = await addMockStopToRepository(repository, "1");
const { eta, notificationData1 } = generateNotificationDataAndEta(shuttle, stop); const { eta, notificationData1 } = generateNotificationDataAndEta(shuttle, stop);
eta.secondsRemaining = notificationService.secondsThresholdForNotificationToFire + 100; notificationData1.secondsThreshold = eta.secondsRemaining - 10;
// Act // Act
await notificationService.scheduleNotification(notificationData1); await notificationService.scheduleNotification(notificationData1);