mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 16:00:32 +00:00
add arrange portion of first test
This commit is contained in:
@@ -233,6 +233,29 @@ describe("NotificationService", () => {
|
|||||||
|
|
||||||
describe("getAllScheduledNotificationsForDevice", () => {
|
describe("getAllScheduledNotificationsForDevice", () => {
|
||||||
it("returns scheduled notifications for the device ID", async () => {
|
it("returns scheduled notifications for the device ID", async () => {
|
||||||
|
// Arrange
|
||||||
|
const shuttle1 = await addMockShuttleToRepository(repository, "1");
|
||||||
|
const stop = await addMockStopToRepository(repository, "1");
|
||||||
|
const { eta, notificationData1 } = generateNotificationDataAndEta(shuttle1, stop);
|
||||||
|
await notificationService.scheduleNotification(notificationData1);
|
||||||
|
|
||||||
|
const shuttle2 = {
|
||||||
|
...shuttle1,
|
||||||
|
id: "2",
|
||||||
|
}
|
||||||
|
await repository.addOrUpdateShuttle(shuttle2);
|
||||||
|
|
||||||
|
const notificationData2 = {
|
||||||
|
...notificationData1,
|
||||||
|
shuttleId: shuttle2.id,
|
||||||
|
}
|
||||||
|
await notificationService.scheduleNotification(notificationData2);
|
||||||
|
|
||||||
|
// Act
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user