mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 07:50:31 +00:00
update tests to include the secondsThreshold argument
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user