Update interface and implementation of ETANotificationScheduler
Rely on both the ETA repository and the shuttle repository
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { beforeEach, describe, expect, it, jest } from "@jest/globals";
|
||||
import { ETANotificationScheduler } from "../ETANotificationScheduler";
|
||||
import { UnoptimizedInMemoryShuttleRepository } from "../../../repositories/shuttle/UnoptimizedInMemoryShuttleRepository";
|
||||
import { InMemoryExternalSourceETARepository } from "../../../repositories/shuttle/eta/InMemoryExternalSourceETARepository";
|
||||
import { IEta, IShuttle, IStop } from "../../../entities/ShuttleRepositoryEntities";
|
||||
import { addMockShuttleToRepository, addMockStopToRepository } from "../../../../testHelpers/repositorySetupHelpers";
|
||||
import { AppleNotificationSender } from "../../senders/AppleNotificationSender";
|
||||
@@ -26,18 +27,21 @@ async function waitForMilliseconds(ms: number): Promise<void> {
|
||||
|
||||
|
||||
describe("ETANotificationScheduler", () => {
|
||||
let shuttleRepository: UnoptimizedInMemoryShuttleRepository
|
||||
let shuttleRepository: UnoptimizedInMemoryShuttleRepository;
|
||||
let etaRepository: InMemoryExternalSourceETARepository;
|
||||
let notificationService: ETANotificationScheduler;
|
||||
let notificationRepository: NotificationRepository;
|
||||
|
||||
beforeEach(() => {
|
||||
shuttleRepository = new UnoptimizedInMemoryShuttleRepository();
|
||||
notificationRepository = new InMemoryNotificationRepository();
|
||||
etaRepository = new InMemoryExternalSourceETARepository();
|
||||
|
||||
mockNotificationSenderMethods(true);
|
||||
|
||||
const appleNotificationSender = new MockAppleNotificationSender(false);
|
||||
notificationService = new ETANotificationScheduler(
|
||||
etaRepository,
|
||||
shuttleRepository,
|
||||
notificationRepository,
|
||||
appleNotificationSender,
|
||||
@@ -127,6 +131,7 @@ describe("ETANotificationScheduler", () => {
|
||||
mockNotificationSenderMethods(false);
|
||||
const updatedNotificationSender = new MockAppleNotificationSender(false);
|
||||
notificationService = new ETANotificationScheduler(
|
||||
etaRepository,
|
||||
shuttleRepository,
|
||||
notificationRepository,
|
||||
updatedNotificationSender,
|
||||
|
||||
Reference in New Issue
Block a user