From: Jérôme Benoit Date: Fri, 27 Feb 2026 17:44:35 +0000 (+0100) Subject: fix(tests): move ocppVersion inside stationInfo in auth mock factory X-Git-Tag: ocpp-server@v3.0.0~116 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=ad1826d32dc139997a4b4b40b77aecbe2e0287e5;p=e-mobility-charging-stations-simulator.git fix(tests): move ocppVersion inside stationInfo in auth mock factory The mock factory was placing ocppVersion at the root level of the mock ChargingStation, but AuthComponentFactory.createAdapters() looks for chargingStation.stationInfo?.ocppVersion, causing all auth service tests to fail with 'OCPP version not found in charging station' error. --- diff --git a/tests/charging-station/ocpp/auth/helpers/MockFactories.ts b/tests/charging-station/ocpp/auth/helpers/MockFactories.ts index 80396d88..5e5b2382 100644 --- a/tests/charging-station/ocpp/auth/helpers/MockFactories.ts +++ b/tests/charging-station/ocpp/auth/helpers/MockFactories.ts @@ -297,10 +297,10 @@ export const createMockAuthServiceTestStation = ( idTagLocalAuthorized: () => false, isConnected: () => true, logPrefix: () => `[TEST-CS-${id}]`, - ocppVersion, sendRequest: () => Promise.resolve({}), stationInfo: { chargingStationId: `TEST-CS-${id}`, hashId: `test-hash-${id}`, + ocppVersion, }, }) as unknown as ChargingStation