Update function calls within tests where shuttle repositories are a dependency

This commit is contained in:
2025-11-10 20:22:08 -08:00
parent 20c97de94d
commit ca5c7c618a
3 changed files with 11 additions and 11 deletions

View File

@@ -80,7 +80,7 @@ describe("ETANotificationScheduler", () => {
// Act
await notificationRepository.addOrUpdateNotification(notificationData1);
await notificationRepository.addOrUpdateNotification(notificationData2);
await shuttleRepository.addOrUpdateEta(eta);
await shuttleRepository.addOrUpdateEtaFromExternalSource(eta);
// Assert
// Wait for the callback to actually be called
@@ -103,7 +103,7 @@ describe("ETANotificationScheduler", () => {
// Act
await notificationRepository.addOrUpdateNotification(notificationData1);
await shuttleRepository.addOrUpdateEta(eta);
await shuttleRepository.addOrUpdateEtaFromExternalSource(eta);
// Assert
await waitForMilliseconds(500);
@@ -136,7 +136,7 @@ describe("ETANotificationScheduler", () => {
// Act
await notificationRepository.addOrUpdateNotification(notificationData1);
await shuttleRepository.addOrUpdateEta(eta);
await shuttleRepository.addOrUpdateEtaFromExternalSource(eta);
// Assert
// The notification should stay scheduled to be retried once

View File

@@ -25,7 +25,7 @@ describe("ShuttleResolvers", () => {
const etas = generateMockEtas();
await Promise.all(etas.map(async (eta) => {
eta.shuttleId = shuttleId;
await context.systems[0].shuttleRepository.addOrUpdateEta(eta);
await context.systems[0].shuttleRepository.addOrUpdateEtaFromExternalSource(eta);
}));
return etas;
}
@@ -146,9 +146,9 @@ describe("ShuttleResolvers", () => {
const e1 = { ...generateMockEtas()[0], shuttleId: mockShuttle.id, stopId: "stA", secondsRemaining: 300 };
const e2 = { ...generateMockEtas()[0], shuttleId: mockShuttle.id, stopId: "stB", secondsRemaining: 30 };
const e3 = { ...generateMockEtas()[0], shuttleId: mockShuttle.id, stopId: "stC", secondsRemaining: 120 };
await context.systems[0].shuttleRepository.addOrUpdateEta(e1);
await context.systems[0].shuttleRepository.addOrUpdateEta(e2);
await context.systems[0].shuttleRepository.addOrUpdateEta(e3);
await context.systems[0].shuttleRepository.addOrUpdateEtaFromExternalSource(e1);
await context.systems[0].shuttleRepository.addOrUpdateEtaFromExternalSource(e2);
await context.systems[0].shuttleRepository.addOrUpdateEtaFromExternalSource(e3);
const response = await holder.testServer.executeOperation({
query,

View File

@@ -106,7 +106,7 @@ describe("StopResolvers", () => {
mockEtas = mockEtas.filter((eta) => eta.stopId === mockEtas[0].stopId);
await Promise.all(mockEtas.map(async eta => {
eta.stopId = mockStop.id;
await context.systems[0].shuttleRepository.addOrUpdateEta(eta);
await context.systems[0].shuttleRepository.addOrUpdateEtaFromExternalSource(eta);
}));
const response = await getResponseForQuery(query);
@@ -128,9 +128,9 @@ describe("StopResolvers", () => {
const e1 = { ...generateMockEtas()[0], stopId: mockStop.id, shuttleId: "shA", secondsRemaining: 240 };
const e2 = { ...generateMockEtas()[0], stopId: mockStop.id, shuttleId: "shB", secondsRemaining: 60 };
const e3 = { ...generateMockEtas()[0], stopId: mockStop.id, shuttleId: "shC", secondsRemaining: 120 };
await context.systems[0].shuttleRepository.addOrUpdateEta(e1);
await context.systems[0].shuttleRepository.addOrUpdateEta(e2);
await context.systems[0].shuttleRepository.addOrUpdateEta(e3);
await context.systems[0].shuttleRepository.addOrUpdateEtaFromExternalSource(e1);
await context.systems[0].shuttleRepository.addOrUpdateEtaFromExternalSource(e2);
await context.systems[0].shuttleRepository.addOrUpdateEtaFromExternalSource(e3);
const response = await getResponseForQuery(query);