]> Piment Noir Git Repositories - e-mobility-charging-stations-simulator.git/commitdiff
fix(tests): move ocppVersion inside stationInfo in auth mock factory
authorJérôme Benoit <jerome.benoit@sap.com>
Fri, 27 Feb 2026 17:44:35 +0000 (18:44 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Fri, 27 Feb 2026 17:44:35 +0000 (18:44 +0100)
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.

tests/charging-station/ocpp/auth/helpers/MockFactories.ts

index 80396d88431bc88f331bea5e658d813a63452612..5e5b23821abada99530586542ec292481e6b26fe 100644 (file)
@@ -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