mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 07:50:31 +00:00
fix test references after removal of addMockSystemToRepository
This commit is contained in:
@@ -12,17 +12,9 @@ describe("QueryResolvers", () => {
|
||||
const holder = setupTestServerHolder();
|
||||
const context = setupTestServerContext();
|
||||
|
||||
async function addMockSystems() {
|
||||
const systems = generateMockPassioSystems();
|
||||
await Promise.all(systems.map(async (system) => {
|
||||
await context.shuttleRepository.updateSystem(system);
|
||||
}));
|
||||
return systems;
|
||||
}
|
||||
|
||||
describe("systems", () => {
|
||||
it("returns systems from the repository", async () => {
|
||||
const systems = await addMockSystems();
|
||||
const systems = context.systems;
|
||||
|
||||
const query = `
|
||||
query GetSystems
|
||||
@@ -58,7 +50,7 @@ describe("QueryResolvers", () => {
|
||||
`;
|
||||
|
||||
it("returns a system for an ID from the repository", async () => {
|
||||
const systems = await addMockSystems();
|
||||
const systems = context.systems;
|
||||
const systemToGet = systems[1];
|
||||
|
||||
const response = await holder.testServer.executeOperation({
|
||||
@@ -103,8 +95,8 @@ describe("QueryResolvers", () => {
|
||||
|
||||
it("returns correct data if the notification is scheduled", async () => {
|
||||
// Arrange
|
||||
const shuttle = await addMockShuttleToRepository(context.shuttleRepository, "1");
|
||||
const stop = await addMockStopToRepository(context.shuttleRepository, "1")
|
||||
const shuttle = await addMockShuttleToRepository(context.systems[0].shuttleRepository, "1");
|
||||
const stop = await addMockStopToRepository(context.systems[0].shuttleRepository, "1")
|
||||
|
||||
const notification: ScheduledNotification = {
|
||||
shuttleId: shuttle.id,
|
||||
@@ -112,7 +104,7 @@ describe("QueryResolvers", () => {
|
||||
deviceId: "1",
|
||||
secondsThreshold: 240,
|
||||
};
|
||||
await context.notificationRepository.addOrUpdateNotification(notification);
|
||||
await context.systems[0].notificationRepository.addOrUpdateNotification(notification);
|
||||
|
||||
const notificationLookup: any = {
|
||||
...notification,
|
||||
|
||||
Reference in New Issue
Block a user