]> Piment Noir Git Repositories - e-mobility-charging-stations-simulator.git/commit
test(ocpp): strengthen mock call verification in OCPP 2.0 handler tests
authorJérôme Benoit <jerome.benoit@sap.com>
Tue, 31 Mar 2026 19:26:36 +0000 (21:26 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Tue, 31 Mar 2026 19:26:36 +0000 (21:26 +0200)
commitca3eec7dc4656fb2bdd002c8c088aeb167caf2c4
tree001f7a49686beba3d7873801ab54a336741a130c
parente8d291b613ba556b76192faa25e25a31b30f3117
test(ocpp): strengthen mock call verification in OCPP 2.0 handler tests

Replace loose assertions (assert.ok(>0), boolean flags) with strict
mock.fn() callCount() and argument verification across 4 test files:

- UnlockConnector: verify exact call count + STATUS_NOTIFICATION command
- ClearCache: replace 3 boolean flags with mock.fn() + callCount()
- CertificateSigned: verify closeWSConnection called/not-called per cert type
- ChangeAvailability: capture requestHandler via factory, verify side effects
tests/charging-station/ocpp/2.0/OCPP20IncomingRequestService-CertificateSigned.test.ts
tests/charging-station/ocpp/2.0/OCPP20IncomingRequestService-ChangeAvailability.test.ts
tests/charging-station/ocpp/2.0/OCPP20IncomingRequestService-ClearCache.test.ts
tests/charging-station/ocpp/2.0/OCPP20IncomingRequestService-UnlockConnector.test.ts