]> Piment Noir Git Repositories - e-mobility-charging-stations-simulator.git/commit
test: use shared constants and enums instead of hardcoded literals (#2040)
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Mon, 20 Jul 2026 10:50:38 +0000 (12:50 +0200)
committerGitHub <noreply@github.com>
Mon, 20 Jul 2026 10:50:38 +0000 (12:50 +0200)
commit503d71c848d5e5749efd21c6b1b4b85ef1f3602e
tree46381b59a16347dc0511956dcf89b380108c29b7
parentd8fb33b23ffb5bd59f5e4e1e33e4bdb678303d57
test: use shared constants and enums instead of hardcoded literals (#2040)

Replace hardcoded literals in recent tests with the shared constants/enums they duplicate (single source of truth, no behavior change; values are byte-equivalent):

- OCPP20 PostStopResurrection: GenericStatus.Accepted / ReportBaseEnumType.FullInventory instead of raw 'Accepted' / 'FullInventory'
- OCPP20 RequestStartTransaction: OCPP20ChargingRateUnitEnumType.A instead of 'A' as OCPP20ChargingRateUnitEnumType casts
- OCPP16 SmartCharging: TEST_ONE_HOUR_SECONDS instead of the 3600 duration literal
- UIHttpServer: ProcedureName.* instead of raw procedure-name strings
- Remove the now-unused TEST_PROCEDURES test constant (ProcedureName is the canonical source)
tests/charging-station/ocpp/1.6/OCPP16IncomingRequestService-SmartCharging.test.ts
tests/charging-station/ocpp/2.0/OCPP20IncomingRequestService-PostStopResurrection.test.ts
tests/charging-station/ocpp/2.0/OCPP20IncomingRequestService-RequestStartTransaction.test.ts
tests/charging-station/ui-server/UIHttpServer.test.ts
tests/charging-station/ui-server/UIServerTestConstants.ts