Skip to content

Commit 97b6291

Browse files
committed
fix: add vehicle availability checker and corresponding test data for v3.1-RC2
1 parent 4229804 commit 97b6291

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

models/typescript/tests/v3.1-RC2.spec.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import SystemPricingPlansTI from '../v3.1-RC2/test-type-checkers/system_pricing_
1313
import SystemRegionsTI from "../v3.1-RC2/test-type-checkers/system_regions-ti";
1414
import VehicleStatusTI from "../v3.1-RC2/test-type-checkers/vehicle_status-ti";
1515
import VehicleTypesTI from '../v3.1-RC2/test-type-checkers/vehicle_types-ti';
16+
import VehicleAvailabilityTI from '../v3.1-RC2/test-type-checkers/vehicle_availability-ti';
1617

1718
// checkers
1819
const { GbfsVersions } = createCheckers(GbfsVersionsTI);
@@ -27,6 +28,7 @@ const { SystemPricingPlans } = createCheckers(SystemPricingPlansTI);
2728
const { SystemRegions } = createCheckers(SystemRegionsTI);
2829
const { VehicleStatus } = createCheckers(VehicleStatusTI);
2930
const { VehicleTypes } = createCheckers(VehicleTypesTI);
31+
const { VehicleAvailability } = createCheckers(VehicleAvailabilityTI);
3032

3133
// json test data: these are gbfs with no errors for v3.1-RC2
3234
import gbfsVersionsJson from '../../../testFixtures/v3.1-RC2/gbfs_versions.json';
@@ -44,6 +46,7 @@ import systemRegionsJson from '../../../testFixtures/v3.1-RC2/system_regions.jso
4446
import vehicleStatusCarsharingJson from '../../../testFixtures/v3.1-RC2/vehicle_status_carsharing.json';
4547
import vehicleStatusMicromobilityJson from '../../../testFixtures/v3.1-RC2/vehicle_status_micromobility.json';
4648
import vehicleTypesJson from '../../../testFixtures/v3.1-RC2/vehicle_types.json';
49+
import vehicleAvailabilityJson from '../../../testFixtures/v3.1-RC2/vehicle_availability.json';
4750

4851
// Date objects cannot be represented in JSON
4952
// Manual checks for dates are required
@@ -137,4 +140,10 @@ describe('GBFS Validator v3.1-RC2', () => {
137140
VehicleTypes.check(vehicleTypesJson);
138141
}).not.toThrow();
139142
});
143+
144+
it('should check if vehicle_availability is valid', () => {
145+
expect(() => {
146+
VehicleAvailability.check(vehicleAvailabilityJson);
147+
}).not.toThrow();
148+
});
140149
});

0 commit comments

Comments
 (0)