mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 07:50:31 +00:00
rename repository to server repository in server context
This commit is contained in:
@@ -14,8 +14,8 @@ describe("ShuttleResolvers", () => {
|
||||
let mockShuttle: IShuttle;
|
||||
|
||||
beforeEach(async () => {
|
||||
mockSystem = await addMockSystemToRepository(context.repository);
|
||||
mockShuttle = await addMockShuttleToRepository(context.repository,
|
||||
mockSystem = await addMockSystemToRepository(context.shuttleRepository);
|
||||
mockShuttle = await addMockShuttleToRepository(context.shuttleRepository,
|
||||
mockSystem.id);
|
||||
});
|
||||
|
||||
@@ -24,7 +24,7 @@ describe("ShuttleResolvers", () => {
|
||||
const etas = generateMockEtas();
|
||||
await Promise.all(etas.map(async (eta) => {
|
||||
eta.shuttleId = shuttleId;
|
||||
await context.repository.addOrUpdateEta(eta);
|
||||
await context.shuttleRepository.addOrUpdateEta(eta);
|
||||
}));
|
||||
return etas;
|
||||
}
|
||||
@@ -56,9 +56,8 @@ describe("ShuttleResolvers", () => {
|
||||
stopId: mockEta.stopId,
|
||||
},
|
||||
}, {
|
||||
contextValue: {
|
||||
repository: context.repository,
|
||||
},
|
||||
contextValue: context
|
||||
|
||||
});
|
||||
|
||||
// Assert
|
||||
@@ -77,9 +76,8 @@ describe("ShuttleResolvers", () => {
|
||||
stopId: "nonexistent-stop",
|
||||
}
|
||||
}, {
|
||||
contextValue: {
|
||||
repository: context.repository,
|
||||
}
|
||||
contextValue: context
|
||||
|
||||
});
|
||||
|
||||
// Assert
|
||||
@@ -114,9 +112,8 @@ describe("ShuttleResolvers", () => {
|
||||
shuttleId: mockShuttle.id,
|
||||
},
|
||||
}, {
|
||||
contextValue: {
|
||||
repository: context.repository,
|
||||
}
|
||||
contextValue: context
|
||||
|
||||
});
|
||||
|
||||
assert(response.body.kind === "single");
|
||||
@@ -133,9 +130,8 @@ describe("ShuttleResolvers", () => {
|
||||
shuttleId: mockShuttle.id,
|
||||
},
|
||||
}, {
|
||||
contextValue: {
|
||||
repository: context.repository,
|
||||
}
|
||||
contextValue: context
|
||||
|
||||
});
|
||||
|
||||
assert(response.body.kind === "single");
|
||||
@@ -172,15 +168,14 @@ describe("ShuttleResolvers", () => {
|
||||
shuttleId: mockShuttle.id,
|
||||
}
|
||||
}, {
|
||||
contextValue: {
|
||||
repository: context.repository,
|
||||
}
|
||||
contextValue: context
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
it("returns the route if it exists", async () => {
|
||||
const mockRoute = generateMockRoutes()[0];
|
||||
await context.repository.addOrUpdateRoute(mockRoute);
|
||||
await context.shuttleRepository.addOrUpdateRoute(mockRoute);
|
||||
|
||||
const response = await getResponseForQuery();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user