update parking system tests to use updatedTime parameter

This commit is contained in:
2025-04-29 16:54:22 -07:00
parent b91f8ce151
commit f68dad0ca2

View File

@@ -40,6 +40,7 @@ describe("ParkingSystemResolver", () => {
longitude longitude
} }
address address
updatedTime
} }
} }
} }
@@ -56,8 +57,15 @@ describe("ParkingSystemResolver", () => {
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).system.parkingSystem.parkingStructures; const parkingStructures = (response.body.singleResult.data as any).system.parkingSystem.parkingStructures;
expect(parkingStructures).toEqual(expectedParkingStructures); const transformedParkingStructures = parkingStructures.map((structure: any) => {
const newStructure = { ...structure, updatedTimeMs: structure.updatedTime };
delete newStructure.updatedTime;
return newStructure;
});
expect(transformedParkingStructures).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 () => {
@@ -65,7 +73,9 @@ describe("ParkingSystemResolver", () => {
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).system.parkingSystem.parkingStructures; const parkingStructures = (response.body.singleResult.data as any).system.parkingSystem.parkingStructures;
expect(parkingStructures).toHaveLength(0); expect(parkingStructures).toHaveLength(0);
}); });
}); });
@@ -87,6 +97,7 @@ describe("ParkingSystemResolver", () => {
longitude longitude
} }
address address
updatedTime
} }
} }
} }
@@ -116,7 +127,10 @@ describe("ParkingSystemResolver", () => {
assert(response.body.kind === "single"); assert(response.body.kind === "single");
expect(response.body.singleResult.errors).toBeUndefined(); expect(response.body.singleResult.errors).toBeUndefined();
const parkingStructure = (response.body.singleResult.data as any).system.parkingSystem.parkingStructure; const parkingStructure = (response.body.singleResult.data as any).system.parkingSystem.parkingStructure;
parkingStructure.updatedTimeMs = parkingStructure.updatedTime;
delete parkingStructure.updatedTime;
expect(parkingStructure).toEqual(expectedParkingStructure); expect(parkingStructure).toEqual(expectedParkingStructure);
}); });
@@ -132,6 +146,7 @@ describe("ParkingSystemResolver", () => {
assert(response.body.kind === "single"); assert(response.body.kind === "single");
expect(response.body.singleResult.errors).toBeUndefined(); expect(response.body.singleResult.errors).toBeUndefined();
const parkingStructure = (response.body.singleResult.data as any).system.parkingSystem.parkingStructure; const parkingStructure = (response.body.singleResult.data as any).system.parkingSystem.parkingStructure;
expect(parkingStructure).toBeNull(); expect(parkingStructure).toBeNull();
}); });