mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 07:50:31 +00:00
Change properties to match GraphQL input and query result
This commit is contained in:
@@ -152,8 +152,8 @@ describe.each(repositoryImplementations)('$name', (holder) => {
|
||||
describe("getHistoricalAveragesOfParkingStructureCounts", () => {
|
||||
it("should return empty array for non-existent structure or no data", async () => {
|
||||
const options: ParkingStructureCountOptions = {
|
||||
startUnixEpochMs: new Date(1000),
|
||||
endUnixEpochMs: new Date(2000),
|
||||
from: new Date(1000),
|
||||
to: new Date(2000),
|
||||
intervalMs: 500
|
||||
};
|
||||
|
||||
@@ -183,8 +183,8 @@ describe.each(repositoryImplementations)('$name', (holder) => {
|
||||
|
||||
const now = Date.now();
|
||||
const options: ParkingStructureCountOptions = {
|
||||
startUnixEpochMs: new Date(now - 10000), // Look back 10 seconds
|
||||
endUnixEpochMs: new Date(now + 10000), // Look forward 10 seconds
|
||||
from: new Date(now - 10000), // Look back 10 seconds
|
||||
to: new Date(now + 10000), // Look forward 10 seconds
|
||||
intervalMs: 20000 // Single large interval
|
||||
};
|
||||
|
||||
@@ -193,10 +193,10 @@ describe.each(repositoryImplementations)('$name', (holder) => {
|
||||
// Should have at least some historical data
|
||||
expect(result.length).toEqual(1);
|
||||
if (result.length > 0) {
|
||||
expect(result[0]).toHaveProperty('fromUnixEpochMs');
|
||||
expect(result[0]).toHaveProperty('toUnixEpochMs');
|
||||
expect(result[0].fromUnixEpochMs).toBeInstanceOf(Date);
|
||||
expect(result[0].toUnixEpochMs).toBeInstanceOf(Date);
|
||||
expect(result[0]).toHaveProperty('from');
|
||||
expect(result[0]).toHaveProperty('to');
|
||||
expect(result[0].from).toBeInstanceOf(Date);
|
||||
expect(result[0].to).toBeInstanceOf(Date);
|
||||
expect(result[0]).toHaveProperty('averageSpotsAvailable');
|
||||
expect(result[0].averageSpotsAvailable).toBeCloseTo(52.5);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user