rename repository to server repository in server context

This commit is contained in:
2025-03-27 10:38:02 -07:00
parent bba00eb067
commit bda46d6808
18 changed files with 128 additions and 148 deletions

View File

@@ -18,11 +18,11 @@ describe("RouteResolvers", () => {
let mockStop: IStop;
beforeEach(async () => {
mockSystem = await addMockSystemToRepository(context.repository);
mockSystem = await addMockSystemToRepository(context.shuttleRepository);
const systemId = mockSystem.id;
mockRoute = await addMockRouteToRepository(context.repository, systemId);
mockStop = await addMockStopToRepository(context.repository, systemId);
mockRoute = await addMockRouteToRepository(context.shuttleRepository, systemId);
mockStop = await addMockStopToRepository(context.shuttleRepository, systemId);
});
@@ -48,9 +48,8 @@ describe("RouteResolvers", () => {
routeId: mockRoute.id,
},
}, {
contextValue: {
repository: context.repository,
}
contextValue: context
});
}
@@ -59,7 +58,7 @@ describe("RouteResolvers", () => {
const expectedShuttle = expectedShuttles[0];
expectedShuttle.systemId = mockSystem.id;
expectedShuttle.routeId = mockRoute.id;
await context.repository.addOrUpdateShuttle(expectedShuttle);
await context.shuttleRepository.addOrUpdateShuttle(expectedShuttle);
const response = await getResponseForShuttlesQuery();
@@ -104,9 +103,8 @@ describe("RouteResolvers", () => {
stopId: mockStop.id,
}
}, {
contextValue: {
repository: context.repository,
}
contextValue: context
});
}
@@ -115,7 +113,7 @@ describe("RouteResolvers", () => {
const expectedOrderedStop = orderedStops[0];
expectedOrderedStop.stopId = mockStop.id;
expectedOrderedStop.routeId = mockRoute.id;
await context.repository.addOrUpdateOrderedStop(expectedOrderedStop);
await context.shuttleRepository.addOrUpdateOrderedStop(expectedOrderedStop);
const response = await getResponseForOrderedStopQuery();
@@ -132,9 +130,9 @@ describe("RouteResolvers", () => {
const expectedOrderedStop = orderedStops[0];
expectedOrderedStop.stopId = mockStop.id;
expectedOrderedStop.routeId = mockRoute.id;
await context.repository.addOrUpdateOrderedStop(expectedOrderedStop);
await context.shuttleRepository.addOrUpdateOrderedStop(expectedOrderedStop);
await context.repository.removeStopIfExists(mockStop.id);
await context.shuttleRepository.removeStopIfExists(mockStop.id);
const response = await getResponseForOrderedStopQuery();