mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 07:50:31 +00:00
update method signatures to not include system id
This commit is contained in:
@@ -36,7 +36,7 @@ export class ApiBasedShuttleRepositoryLoader implements ShuttleRepositoryLoader
|
|||||||
public async fetchAndUpdateRouteDataForSystem() {
|
public async fetchAndUpdateRouteDataForSystem() {
|
||||||
const systemId = this.passioSystemId;
|
const systemId = this.passioSystemId;
|
||||||
const routeIdsToPrune = await this.constructExistingEntityIdSet(async () => {
|
const routeIdsToPrune = await this.constructExistingEntityIdSet(async () => {
|
||||||
return await this.repository.getRoutes(this.systemIdForConstructedData);
|
return await this.repository.getRoutes();
|
||||||
});
|
});
|
||||||
|
|
||||||
const params = {
|
const params = {
|
||||||
@@ -89,7 +89,7 @@ export class ApiBasedShuttleRepositoryLoader implements ShuttleRepositoryLoader
|
|||||||
// Fetch from the API
|
// Fetch from the API
|
||||||
// Pass JSON output into two different methods to update repository
|
// Pass JSON output into two different methods to update repository
|
||||||
const stopIdsToPrune = await this.constructExistingEntityIdSet(async () => {
|
const stopIdsToPrune = await this.constructExistingEntityIdSet(async () => {
|
||||||
return await this.repository.getStops(this.systemIdForConstructedData);
|
return await this.repository.getStops();
|
||||||
});
|
});
|
||||||
|
|
||||||
const params = {
|
const params = {
|
||||||
@@ -127,7 +127,7 @@ export class ApiBasedShuttleRepositoryLoader implements ShuttleRepositoryLoader
|
|||||||
public async fetchAndUpdateShuttleDataForSystem() {
|
public async fetchAndUpdateShuttleDataForSystem() {
|
||||||
const systemId = this.passioSystemId;
|
const systemId = this.passioSystemId;
|
||||||
const shuttleIdsToPrune = await this.constructExistingEntityIdSet(async () => {
|
const shuttleIdsToPrune = await this.constructExistingEntityIdSet(async () => {
|
||||||
return await this.repository.getShuttles(this.systemIdForConstructedData);
|
return await this.repository.getShuttles();
|
||||||
});
|
});
|
||||||
|
|
||||||
const params = {
|
const params = {
|
||||||
@@ -184,7 +184,7 @@ export class ApiBasedShuttleRepositoryLoader implements ShuttleRepositoryLoader
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async fetchAndUpdateEtaDataForExistingStopsForSystem() {
|
public async fetchAndUpdateEtaDataForExistingStopsForSystem() {
|
||||||
const stops = await this.repository.getStops(this.systemIdForConstructedData);
|
const stops = await this.repository.getStops();
|
||||||
await Promise.all(stops.map(async (stop) => {
|
await Promise.all(stops.map(async (stop) => {
|
||||||
let stopId = stop.id;
|
let stopId = stop.id;
|
||||||
await this.fetchAndUpdateEtaDataForStopId(stopId);
|
await this.fetchAndUpdateEtaDataForStopId(stopId);
|
||||||
|
|||||||
@@ -4,18 +4,17 @@ import { IEta, IOrderedStop, IRoute, IShuttle, IStop } from "../entities/entitie
|
|||||||
* Shuttle getter repository to be linked to a system.
|
* Shuttle getter repository to be linked to a system.
|
||||||
*/
|
*/
|
||||||
export interface ShuttleGetterRepository {
|
export interface ShuttleGetterRepository {
|
||||||
// TODO: Remove system ID argument from all getters
|
getStops(): Promise<IStop[]>;
|
||||||
getStops(systemId: string): Promise<IStop[]>;
|
|
||||||
getStopById(stopId: string): Promise<IStop | null>;
|
getStopById(stopId: string): Promise<IStop | null>;
|
||||||
|
|
||||||
getRoutes(systemId: string): Promise<IRoute[]>;
|
getRoutes(): Promise<IRoute[]>;
|
||||||
getRouteById(routeId: string): Promise<IRoute | null>;
|
getRouteById(routeId: string): Promise<IRoute | null>;
|
||||||
|
|
||||||
getShuttles(systemId: string): Promise<IShuttle[]>;
|
getShuttles(): Promise<IShuttle[]>;
|
||||||
getShuttleById(shuttleId: string): Promise<IShuttle | null>;
|
getShuttleById(shuttleId: string): Promise<IShuttle | null>;
|
||||||
getShuttlesByRouteId(routeId: string): Promise<IShuttle[]>;
|
getShuttlesByRouteId(routeId: string): Promise<IShuttle[]>;
|
||||||
|
|
||||||
getEtas(shuttleId: string): Promise<IEta[]>;
|
getEtasForShuttleId(shuttleId: string): Promise<IEta[]>;
|
||||||
getEtasForStopId(stopId: string): Promise<IEta[]>;
|
getEtasForStopId(stopId: string): Promise<IEta[]>;
|
||||||
getEtaForShuttleAndStopId(shuttleId: string, stopId: string): Promise<IEta | null>;
|
getEtaForShuttleAndStopId(shuttleId: string, stopId: string): Promise<IEta | null>;
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ export class UnoptimizedInMemoryShuttleRepository implements ShuttleGetterSetter
|
|||||||
|
|
||||||
private subscribers: ((eta: IEta) => void)[] = [];
|
private subscribers: ((eta: IEta) => void)[] = [];
|
||||||
|
|
||||||
public async getStops(systemId: string) {
|
public async getStops(): Promise<IStop[]> {
|
||||||
return this.stops.filter(stop => stop.systemId === systemId);
|
return this.stops.filter(stop => stop.systemId === systemId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -23,7 +23,7 @@ export class UnoptimizedInMemoryShuttleRepository implements ShuttleGetterSetter
|
|||||||
return this.findEntityById(stopId, this.stops);
|
return this.findEntityById(stopId, this.stops);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async getRoutes(systemId: string) {
|
public async getRoutes(): Promise<IRoute[]> {
|
||||||
return this.routes.filter(route => route.systemId === systemId);
|
return this.routes.filter(route => route.systemId === systemId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -31,7 +31,7 @@ export class UnoptimizedInMemoryShuttleRepository implements ShuttleGetterSetter
|
|||||||
return this.findEntityById(routeId, this.routes);
|
return this.findEntityById(routeId, this.routes);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async getShuttles(systemId: string) {
|
public async getShuttles(): Promise<IShuttle[]> {
|
||||||
return this.shuttles.filter(shuttle => shuttle.systemId === systemId);
|
return this.shuttles.filter(shuttle => shuttle.systemId === systemId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -43,7 +43,7 @@ export class UnoptimizedInMemoryShuttleRepository implements ShuttleGetterSetter
|
|||||||
return this.findEntityById(shuttleId, this.shuttles);
|
return this.findEntityById(shuttleId, this.shuttles);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async getEtas(shuttleId: string) {
|
public async getEtasForShuttleId(shuttleId: string): Promise<IEta[]> {
|
||||||
return this.etas.filter(eta => eta.shuttleId === shuttleId);
|
return this.etas.filter(eta => eta.shuttleId === shuttleId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ export const ShuttleResolvers: Resolvers<ServerContext> = {
|
|||||||
const system = contextValue.findSystemById(parent.systemId);
|
const system = contextValue.findSystemById(parent.systemId);
|
||||||
if (!system) return null;
|
if (!system) return null;
|
||||||
|
|
||||||
const etasForShuttle = await system.shuttleRepository.getEtas(parent.id);
|
const etasForShuttle = await system.shuttleRepository.getEtasForShuttleId();
|
||||||
if (!etasForShuttle) return null;
|
if (!etasForShuttle) return null;
|
||||||
|
|
||||||
const computedEtas = await Promise.all(etasForShuttle.map(async ({
|
const computedEtas = await Promise.all(etasForShuttle.map(async ({
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ export const SystemResolvers: Resolvers<ServerContext> = {
|
|||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
return await system.shuttleRepository.getRoutes(parent.id);
|
return await system.shuttleRepository.getRoutes();
|
||||||
},
|
},
|
||||||
stops: async (parent, _args, contextValue, _info) => {
|
stops: async (parent, _args, contextValue, _info) => {
|
||||||
const system = contextValue.findSystemById(parent.id);
|
const system = contextValue.findSystemById(parent.id);
|
||||||
@@ -17,7 +17,7 @@ export const SystemResolvers: Resolvers<ServerContext> = {
|
|||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
return await system.shuttleRepository.getStops(parent.id);
|
return await system.shuttleRepository.getStops();
|
||||||
},
|
},
|
||||||
stop: async (parent, args, contextValue, _info) => {
|
stop: async (parent, args, contextValue, _info) => {
|
||||||
if (!args.id) return null;
|
if (!args.id) return null;
|
||||||
@@ -76,7 +76,7 @@ export const SystemResolvers: Resolvers<ServerContext> = {
|
|||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
return await system.shuttleRepository.getShuttles(parent.id);
|
return await system.shuttleRepository.getShuttles();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ describe("ApiBasedRepositoryLoader", () => {
|
|||||||
await loader.fetchAndUpdateRouteDataForSystem();
|
await loader.fetchAndUpdateRouteDataForSystem();
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
const routes = await loader.repository.getRoutes(systemId);
|
const routes = await loader.repository.getRoutes();
|
||||||
|
|
||||||
expect(routes.length).toEqual(fetchRouteDataSuccessfulResponse.all.length)
|
expect(routes.length).toEqual(fetchRouteDataSuccessfulResponse.all.length)
|
||||||
});
|
});
|
||||||
@@ -78,7 +78,7 @@ describe("ApiBasedRepositoryLoader", () => {
|
|||||||
|
|
||||||
await loader.fetchAndUpdateStopAndPolylineDataForRoutesInSystem();
|
await loader.fetchAndUpdateStopAndPolylineDataForRoutesInSystem();
|
||||||
|
|
||||||
const stops = await loader.repository.getStops(systemId);
|
const stops = await loader.repository.getStops();
|
||||||
expect(stops.length).toEqual(stopsArray.length);
|
expect(stops.length).toEqual(stopsArray.length);
|
||||||
|
|
||||||
await Promise.all(stops.map(async (stop) => {
|
await Promise.all(stops.map(async (stop) => {
|
||||||
@@ -86,7 +86,7 @@ describe("ApiBasedRepositoryLoader", () => {
|
|||||||
expect(orderedStops.length).toBeGreaterThan(0);
|
expect(orderedStops.length).toBeGreaterThan(0);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const routes = await loader.repository.getRoutes(systemId);
|
const routes = await loader.repository.getRoutes();
|
||||||
routes.forEach((route) => {
|
routes.forEach((route) => {
|
||||||
expect(route.polylineCoordinates.length).toBeGreaterThan(0);
|
expect(route.polylineCoordinates.length).toBeGreaterThan(0);
|
||||||
});
|
});
|
||||||
@@ -114,7 +114,7 @@ describe("ApiBasedRepositoryLoader", () => {
|
|||||||
|
|
||||||
await loader.fetchAndUpdateShuttleDataForSystem();
|
await loader.fetchAndUpdateShuttleDataForSystem();
|
||||||
|
|
||||||
const shuttles = await loader.repository.getShuttles(systemId);
|
const shuttles = await loader.repository.getShuttles();
|
||||||
|
|
||||||
expect(shuttles.length).toEqual(busesInResponse.length);
|
expect(shuttles.length).toEqual(busesInResponse.length);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -27,12 +27,12 @@ describe("UnoptimizedInMemoryRepository", () => {
|
|||||||
await repository.addOrUpdateStop(stop);
|
await repository.addOrUpdateStop(stop);
|
||||||
}
|
}
|
||||||
|
|
||||||
const result = await repository.getStops("sys1");
|
const result = await repository.getStops();
|
||||||
expect(result).toEqual(mockStops.filter((stop) => stop.systemId === "sys1"));
|
expect(result).toEqual(mockStops.filter((stop) => stop.systemId === "sys1"));
|
||||||
});
|
});
|
||||||
|
|
||||||
test("returns an empty list if there are no stops for the given system ID", async () => {
|
test("returns an empty list if there are no stops for the given system ID", async () => {
|
||||||
const result = await repository.getStops("nonexistent-system");
|
const result = await repository.getStops();
|
||||||
expect(result).toEqual([]);
|
expect(result).toEqual([]);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -60,12 +60,12 @@ describe("UnoptimizedInMemoryRepository", () => {
|
|||||||
await repository.addOrUpdateRoute(route);
|
await repository.addOrUpdateRoute(route);
|
||||||
}
|
}
|
||||||
|
|
||||||
const result = await repository.getRoutes("sys1");
|
const result = await repository.getRoutes();
|
||||||
expect(result).toEqual(mockRoutes.filter((route) => route.systemId === "sys1"));
|
expect(result).toEqual(mockRoutes.filter((route) => route.systemId === "sys1"));
|
||||||
});
|
});
|
||||||
|
|
||||||
test("returns an empty list if there are no routes for the system ID", async () => {
|
test("returns an empty list if there are no routes for the system ID", async () => {
|
||||||
const result = await repository.getRoutes("nonexistent-system");
|
const result = await repository.getRoutes();
|
||||||
expect(result).toEqual([]);
|
expect(result).toEqual([]);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -92,12 +92,12 @@ describe("UnoptimizedInMemoryRepository", () => {
|
|||||||
await repository.addOrUpdateShuttle(shuttle);
|
await repository.addOrUpdateShuttle(shuttle);
|
||||||
}
|
}
|
||||||
|
|
||||||
const result = await repository.getShuttles("sys1");
|
const result = await repository.getShuttles();
|
||||||
expect(result).toEqual(mockShuttles.filter((sh) => sh.systemId === "sys1"));
|
expect(result).toEqual(mockShuttles.filter((sh) => sh.systemId === "sys1"));
|
||||||
});
|
});
|
||||||
|
|
||||||
test("returns an empty list if there are no shuttles for the system ID", async () => {
|
test("returns an empty list if there are no shuttles for the system ID", async () => {
|
||||||
const result = await repository.getShuttles("nonexistent-system");
|
const result = await repository.getShuttles();
|
||||||
expect(result).toEqual([]);
|
expect(result).toEqual([]);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -143,12 +143,12 @@ describe("UnoptimizedInMemoryRepository", () => {
|
|||||||
await repository.addOrUpdateEta(eta);
|
await repository.addOrUpdateEta(eta);
|
||||||
}
|
}
|
||||||
|
|
||||||
const result = await repository.getEtas("sh1");
|
const result = await repository.getEtasForShuttleId("sh1");
|
||||||
expect(result).toEqual(mockEtas.filter((eta) => eta.shuttleId === "sh1"));
|
expect(result).toEqual(mockEtas.filter((eta) => eta.shuttleId === "sh1"));
|
||||||
});
|
});
|
||||||
|
|
||||||
test("returns an empty list if there are no ETAs for the shuttle ID", async () => {
|
test("returns an empty list if there are no ETAs for the shuttle ID", async () => {
|
||||||
const result = await repository.getEtas("nonexistent-shuttle");
|
const result = await repository.getEtasForShuttleId("nonexistent-shuttle");
|
||||||
expect(result).toEqual([]);
|
expect(result).toEqual([]);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -292,7 +292,7 @@ describe("UnoptimizedInMemoryRepository", () => {
|
|||||||
|
|
||||||
await repository.addOrUpdateRoute(newRoute);
|
await repository.addOrUpdateRoute(newRoute);
|
||||||
|
|
||||||
const result = await repository.getRoutes("sys1");
|
const result = await repository.getRoutes();
|
||||||
expect(result).toEqual([newRoute]);
|
expect(result).toEqual([newRoute]);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -305,7 +305,7 @@ describe("UnoptimizedInMemoryRepository", () => {
|
|||||||
await repository.addOrUpdateRoute(existingRoute);
|
await repository.addOrUpdateRoute(existingRoute);
|
||||||
await repository.addOrUpdateRoute(updatedRoute);
|
await repository.addOrUpdateRoute(updatedRoute);
|
||||||
|
|
||||||
const result = await repository.getRoutes("sys1");
|
const result = await repository.getRoutes();
|
||||||
expect(result).toEqual([updatedRoute]);
|
expect(result).toEqual([updatedRoute]);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -317,7 +317,7 @@ describe("UnoptimizedInMemoryRepository", () => {
|
|||||||
|
|
||||||
await repository.addOrUpdateShuttle(newShuttle);
|
await repository.addOrUpdateShuttle(newShuttle);
|
||||||
|
|
||||||
const result = await repository.getShuttles("sys1");
|
const result = await repository.getShuttles();
|
||||||
expect(result).toEqual([newShuttle]);
|
expect(result).toEqual([newShuttle]);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -330,7 +330,7 @@ describe("UnoptimizedInMemoryRepository", () => {
|
|||||||
await repository.addOrUpdateShuttle(existingShuttle);
|
await repository.addOrUpdateShuttle(existingShuttle);
|
||||||
await repository.addOrUpdateShuttle(updatedShuttle);
|
await repository.addOrUpdateShuttle(updatedShuttle);
|
||||||
|
|
||||||
const result = await repository.getShuttles("sys1");
|
const result = await repository.getShuttles();
|
||||||
expect(result).toEqual([updatedShuttle]);
|
expect(result).toEqual([updatedShuttle]);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -342,7 +342,7 @@ describe("UnoptimizedInMemoryRepository", () => {
|
|||||||
|
|
||||||
await repository.addOrUpdateStop(newStop);
|
await repository.addOrUpdateStop(newStop);
|
||||||
|
|
||||||
const result = await repository.getStops("sys1");
|
const result = await repository.getStops();
|
||||||
expect(result).toEqual([newStop]);
|
expect(result).toEqual([newStop]);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -355,7 +355,7 @@ describe("UnoptimizedInMemoryRepository", () => {
|
|||||||
await repository.addOrUpdateStop(existingStop);
|
await repository.addOrUpdateStop(existingStop);
|
||||||
await repository.addOrUpdateStop(updatedStop);
|
await repository.addOrUpdateStop(updatedStop);
|
||||||
|
|
||||||
const result = await repository.getStops("sys1");
|
const result = await repository.getStops();
|
||||||
expect(result).toEqual([updatedStop]);
|
expect(result).toEqual([updatedStop]);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -392,7 +392,7 @@ describe("UnoptimizedInMemoryRepository", () => {
|
|||||||
|
|
||||||
await repository.addOrUpdateEta(newEta);
|
await repository.addOrUpdateEta(newEta);
|
||||||
|
|
||||||
const result = await repository.getEtas(newEta.shuttleId);
|
const result = await repository.getEtasForShuttleId(newEta.shuttleId);
|
||||||
expect(result).toEqual([newEta]);
|
expect(result).toEqual([newEta]);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -405,7 +405,7 @@ describe("UnoptimizedInMemoryRepository", () => {
|
|||||||
await repository.addOrUpdateEta(existingEta);
|
await repository.addOrUpdateEta(existingEta);
|
||||||
await repository.addOrUpdateEta(updatedEta);
|
await repository.addOrUpdateEta(updatedEta);
|
||||||
|
|
||||||
const result = await repository.getEtas(existingEta.shuttleId);
|
const result = await repository.getEtasForShuttleId(existingEta.shuttleId);
|
||||||
expect(result).toEqual([updatedEta]);
|
expect(result).toEqual([updatedEta]);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -422,7 +422,7 @@ describe("UnoptimizedInMemoryRepository", () => {
|
|||||||
const routeToRemove = mockRoutes[0];
|
const routeToRemove = mockRoutes[0];
|
||||||
await repository.removeRouteIfExists(routeToRemove.id);
|
await repository.removeRouteIfExists(routeToRemove.id);
|
||||||
|
|
||||||
const remainingRoutes = await repository.getRoutes(systemId);
|
const remainingRoutes = await repository.getRoutes();
|
||||||
expect(remainingRoutes).toHaveLength(mockRoutes.length - 1);
|
expect(remainingRoutes).toHaveLength(mockRoutes.length - 1);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -436,7 +436,7 @@ describe("UnoptimizedInMemoryRepository", () => {
|
|||||||
|
|
||||||
await repository.removeRouteIfExists("nonexistent-id");
|
await repository.removeRouteIfExists("nonexistent-id");
|
||||||
|
|
||||||
const remainingRoutes = await repository.getRoutes(systemId);
|
const remainingRoutes = await repository.getRoutes();
|
||||||
expect(remainingRoutes).toHaveLength(mockRoutes.length);
|
expect(remainingRoutes).toHaveLength(mockRoutes.length);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -453,7 +453,7 @@ describe("UnoptimizedInMemoryRepository", () => {
|
|||||||
const shuttleToRemove = mockShuttles[0];
|
const shuttleToRemove = mockShuttles[0];
|
||||||
await repository.removeShuttleIfExists(shuttleToRemove.id);
|
await repository.removeShuttleIfExists(shuttleToRemove.id);
|
||||||
|
|
||||||
const remainingShuttles = await repository.getShuttles(systemId);
|
const remainingShuttles = await repository.getShuttles();
|
||||||
expect(remainingShuttles).toHaveLength(mockShuttles.length - 1);
|
expect(remainingShuttles).toHaveLength(mockShuttles.length - 1);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -467,7 +467,7 @@ describe("UnoptimizedInMemoryRepository", () => {
|
|||||||
|
|
||||||
await repository.removeShuttleIfExists("nonexistent-id");
|
await repository.removeShuttleIfExists("nonexistent-id");
|
||||||
|
|
||||||
const remainingShuttles = await repository.getShuttles(systemId);
|
const remainingShuttles = await repository.getShuttles();
|
||||||
expect(remainingShuttles).toHaveLength(mockShuttles.length);
|
expect(remainingShuttles).toHaveLength(mockShuttles.length);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -484,7 +484,7 @@ describe("UnoptimizedInMemoryRepository", () => {
|
|||||||
const stopToRemove = mockStops[0];
|
const stopToRemove = mockStops[0];
|
||||||
await repository.removeStopIfExists(stopToRemove.id);
|
await repository.removeStopIfExists(stopToRemove.id);
|
||||||
|
|
||||||
const remainingStops = await repository.getStops(systemId);
|
const remainingStops = await repository.getStops();
|
||||||
expect(remainingStops).toHaveLength(mockStops.length - 1);
|
expect(remainingStops).toHaveLength(mockStops.length - 1);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -498,7 +498,7 @@ describe("UnoptimizedInMemoryRepository", () => {
|
|||||||
|
|
||||||
await repository.removeStopIfExists("nonexistent-id");
|
await repository.removeStopIfExists("nonexistent-id");
|
||||||
|
|
||||||
const remainingStops = await repository.getStops(systemId);
|
const remainingStops = await repository.getStops();
|
||||||
expect(remainingStops).toHaveLength(mockStops.length);
|
expect(remainingStops).toHaveLength(mockStops.length);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -580,7 +580,7 @@ describe("UnoptimizedInMemoryRepository", () => {
|
|||||||
|
|
||||||
await repository.clearShuttleData();
|
await repository.clearShuttleData();
|
||||||
|
|
||||||
const result = await repository.getShuttles("sys1");
|
const result = await repository.getShuttles();
|
||||||
expect(result).toEqual([]);
|
expect(result).toEqual([]);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -594,7 +594,7 @@ describe("UnoptimizedInMemoryRepository", () => {
|
|||||||
|
|
||||||
await repository.clearEtaData();
|
await repository.clearEtaData();
|
||||||
|
|
||||||
const result = await repository.getEtas("shuttle1");
|
const result = await repository.getEtasForShuttleId("shuttle1");
|
||||||
expect(result).toEqual([]);
|
expect(result).toEqual([]);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -622,7 +622,7 @@ describe("UnoptimizedInMemoryRepository", () => {
|
|||||||
|
|
||||||
await repository.clearRouteData();
|
await repository.clearRouteData();
|
||||||
|
|
||||||
const result = await repository.getRoutes("sys1");
|
const result = await repository.getRoutes();
|
||||||
expect(result).toEqual([]);
|
expect(result).toEqual([]);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -636,7 +636,7 @@ describe("UnoptimizedInMemoryRepository", () => {
|
|||||||
|
|
||||||
await repository.clearStopData();
|
await repository.clearStopData();
|
||||||
|
|
||||||
const result = await repository.getStops("sys1");
|
const result = await repository.getStops();
|
||||||
expect(result).toEqual([]);
|
expect(result).toEqual([]);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user