mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-19 08:50:29 +00:00
Modify getShuttleLastStopArrival to use shuttle ID
This commit is contained in:
@@ -90,7 +90,7 @@ describe("RedisShuttleRepository", () => {
|
||||
};
|
||||
|
||||
await repository.addOrUpdateShuttle(shuttle);
|
||||
const lastStop = await repository.getShuttleLastStopArrival(shuttle);
|
||||
const lastStop = await repository.getShuttleLastStopArrival(shuttle.id);
|
||||
expect(lastStop?.stopId).toEqual(stop2.id)
|
||||
});
|
||||
|
||||
@@ -213,7 +213,7 @@ describe("RedisShuttleRepository", () => {
|
||||
};
|
||||
|
||||
await repository.updateShuttleLastStopArrival(shuttle, stopArrival);
|
||||
const result = await repository.getShuttleLastStopArrival(shuttle);
|
||||
const result = await repository.getShuttleLastStopArrival(shuttle.id);
|
||||
|
||||
expect(result).toBeDefined();
|
||||
expect(result?.stopId).toBe(stopArrival.stopId);
|
||||
@@ -224,7 +224,7 @@ describe("RedisShuttleRepository", () => {
|
||||
const mockShuttles = generateMockShuttles();
|
||||
const shuttle = mockShuttles[0];
|
||||
|
||||
const result = await repository.getShuttleLastStopArrival(shuttle);
|
||||
const result = await repository.getShuttleLastStopArrival(shuttle.id);
|
||||
|
||||
expect(result).toBeUndefined();
|
||||
});
|
||||
@@ -246,7 +246,7 @@ describe("RedisShuttleRepository", () => {
|
||||
await repository.updateShuttleLastStopArrival(shuttle, firstArrival);
|
||||
await repository.updateShuttleLastStopArrival(shuttle, secondArrival);
|
||||
|
||||
const result = await repository.getShuttleLastStopArrival(shuttle);
|
||||
const result = await repository.getShuttleLastStopArrival(shuttle.id);
|
||||
|
||||
expect(result).toBeDefined();
|
||||
expect(result?.stopId).toBe(secondArrival.stopId);
|
||||
|
||||
Reference in New Issue
Block a user