add rest of parkingStructures tests

This commit is contained in:
2025-04-16 16:39:07 -07:00
parent ea1150a98d
commit a38ca3d3de

View File

@@ -343,16 +343,29 @@ describe("SystemResolvers", () => {
assert(response.body.kind === "single"); assert(response.body.kind === "single");
expect(response.body.singleResult.errors).toBeUndefined(); expect(response.body.singleResult.errors).toBeUndefined();
const parkingStructures = (response.body.singleResult.data as any).parkingStructures; const parkingStructures = (response.body.singleResult.data as any).system.parkingStructures;
expect(parkingStructures).toEqual(expectedParkingStructures); expect(parkingStructures).toEqual(expectedParkingStructures);
}); });
it("returns a blank array if there are no parking structures", async () => { it("returns a blank array if there are no parking structures", async () => {
const response = await getResponseFromQueryNeedingSystemId(query);
assert(response.body.kind === "single");
expect(response.body.singleResult.errors).toBeUndefined();
const parkingStructures = (response.body.singleResult.data as any).system.parkingStructures;
expect(parkingStructures).toHaveLength(0);
}); });
it("returns null if there is no parking data available", async () => { it("returns null if there is no parking data available", async () => {
context.systems[0].parkingTimedDataLoader = null;
context.systems[0].parkingRepository = null;
const response = await getResponseFromQueryNeedingSystemId(query);
assert(response.body.kind === "single");
expect(response.body.singleResult.errors).toBeUndefined();
const parkingStructures = (response.body.singleResult.data as any).system.parkingStructures;
expect(parkingStructures).toBeNull();
}); });
}); });