]> Piment Noir Git Repositories - e-mobility-charging-stations-simulator.git/commitdiff
chore: harmonize test filenames to PascalCase concern suffix convention (#1955)
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Sun, 5 Jul 2026 21:30:16 +0000 (23:30 +0200)
committerGitHub <noreply@github.com>
Sun, 5 Jul 2026 21:30:16 +0000 (23:30 +0200)
chore: harmonize test filenames to PascalCase concern suffix convention

Rename 9 test files whose naming violated the codebase's dominant
`<Source>[-<PascalConcern>].test.ts` convention. 156/165 test files were
already conformant; this PR closes the remaining gap.

Renames (all via `git mv`, content unchanged):

Casing/separator normalizations (7):
- tests/utils/Configuration-hot-reload.test.ts
  → tests/utils/Configuration-HotReload.test.ts (kebab-case lowercase)
- tests/utils/ConfigurationValidation-perf.test.ts
  → tests/utils/ConfigurationValidation-Perf.test.ts (lowercase)
- tests/charging-station/ocpp/OCPPServiceUtils-pure.test.ts
  → tests/charging-station/ocpp/OCPPServiceUtils-Pure.test.ts (lowercase)
- tests/charging-station/ocpp/OCPPServiceUtils-meterValues.test.ts
  → tests/charging-station/ocpp/OCPPServiceUtils-MeterValues.test.ts (camelCase)
- tests/charging-station/ocpp/OCPPServiceUtils-validation.test.ts
  → tests/charging-station/ocpp/OCPPServiceUtils-Validation.test.ts (lowercase)
- tests/charging-station/ocpp/2.0/OCPP20ServiceUtils-enforceMessageLimits.test.ts
  → tests/charging-station/ocpp/2.0/OCPP20ServiceUtils-EnforceMessageLimits.test.ts
  (camelCase)
- tests/charging-station/ui-server/UIMCPServer.integration.test.ts
  → tests/charging-station/ui-server/UIMCPServer-Integration.test.ts
  (`.integration.` — sole `.` separator in the test tree; now aligned on
  the `-Integration` pattern used by 5 sibling integration tests)

Aggregate-pattern alignment (1):
- tests/charging-station/ocpp/1.6/OCPP16-CoherentMeterValues.test.ts
  → tests/charging-station/ocpp/1.6/OCPP16Integration-CoherentMeterValues.test.ts
  Sole use of `OCPP16-<Concept>` (version-dash without Integration) in
  the entire test tree. The file's own `@file` header describes itself
  as an "Integration-style test", aligning it with the established
  `OCPP16Integration-<PascalConcern>` aggregate pattern used by 4
  siblings (`-ChargingProfiles`, `-Configuration`, `-Reservations`,
  `-Transactions`).

OCPP standard casing (1):
- tests/charging-station/ocpp/2.0/OCPP20RequestService-HeartBeat.test.ts
  → tests/charging-station/ocpp/2.0/OCPP20RequestService-Heartbeat.test.ts
  Every other file in the 12-file `OCPP20RequestService-*` group uses
  the OCPP standard action spelling (`BootNotification`, `MeterValues`,
  `NotifyReport`, etc.). OCPP 2.0.1 spells the action `Heartbeat` (single
  word); the `HeartBeat` variant with a mid-word capital B was the sole
  outlier.

Not renamed (accepted as legitimate cases):
- OCPPAuthIntegration.test.ts — "Integration" fused into the concept
  name, no per-concern split.
- OCPP20Integration.test.ts — aggregate test with no per-concern split.
- CoherentMeterValues.test.ts (meter-values/) — PascalCase concept name
  for a multi-file subsystem, no casing violation.
- StrategyDispatch.test.ts, UIMetricsEndpoint.test.ts — PascalCase
  concept/aggregate names, no casing violation.

Content preserved verbatim in 8 of the 9 renamed files (case-only and
separator renames via `git mv` two-step for macOS APFS
case-insensitivity). The 9th file (`OCPP20RequestService-Heartbeat.test.ts`)
had 8 internal `HeartBeat` references (JSDoc `@file`, 5 `it()` descriptions,
2 inline comments) updated to `Heartbeat` to match the OCPP 2.0.1 spec
spelling — the same rationale that motivated the filename rename. Source
code already uses `Heartbeat` consistently (`src/types/ocpp/2.0/Requests.ts:
HEARTBEAT = 'Heartbeat'`).

No consumer updates required: the only non-test references to the old
filenames live in auto-regenerated caches (`.serena/cache`,
`.hermes/evidence`, `.eslintcache`) which self-heal, and historical
planning docs under `.omo/plans/` (frozen; not updated).

Post-PR: 165/165 test files conformant to the codebase's dominant
`<Source>[-<PascalConcern>].test.ts` / `<Concept>Integration[-<PascalConcern>].test.ts`
conventions.

Quality gates: typecheck clean; the 9 renamed test files run
80/80 pass, 0 fail.

Out of scope for this PR (documented for future work):
- ui/web/tests/ has 7 outliers (Utils/Dialogs/Actions casing mismatch vs
  source dirs; Errors casing vs source file; SimpleComponents /
  ClassicComponents / SkinComponents aggregate names with no matching
  source entity). These live in a different workspace with its own
  convention (source-mirror casing per file role); a dedicated
  ui/web-scoped harmonization PR is warranted.
- Helper file placement inconsistency (some in `helpers/`, some
  co-located with `.test.ts` files) and 5 competing suffixes
  (TestUtils/TestHelpers/TestConstants/TestData/Fixtures) — needs a
  documented convention in TEST_STYLE_GUIDE before rename PR.
- `mocks/` vs `auth/helpers/` split for mocks (MockCaches/MockWebSocket
  in mocks/, MockFactories in auth/helpers/) — same follow-up.

tests/charging-station/ocpp/1.6/OCPP16Integration-CoherentMeterValues.test.ts [moved from tests/charging-station/ocpp/1.6/OCPP16-CoherentMeterValues.test.ts with 100% similarity]
tests/charging-station/ocpp/2.0/OCPP20RequestService-Heartbeat.test.ts [moved from tests/charging-station/ocpp/2.0/OCPP20RequestService-HeartBeat.test.ts with 91% similarity]
tests/charging-station/ocpp/2.0/OCPP20ServiceUtils-EnforceMessageLimits.test.ts [moved from tests/charging-station/ocpp/2.0/OCPP20ServiceUtils-enforceMessageLimits.test.ts with 100% similarity]
tests/charging-station/ocpp/OCPPServiceUtils-MeterValues.test.ts [moved from tests/charging-station/ocpp/OCPPServiceUtils-meterValues.test.ts with 100% similarity]
tests/charging-station/ocpp/OCPPServiceUtils-Pure.test.ts [moved from tests/charging-station/ocpp/OCPPServiceUtils-pure.test.ts with 100% similarity]
tests/charging-station/ocpp/OCPPServiceUtils-Validation.test.ts [moved from tests/charging-station/ocpp/OCPPServiceUtils-validation.test.ts with 100% similarity]
tests/charging-station/ui-server/UIMCPServer-Integration.test.ts [moved from tests/charging-station/ui-server/UIMCPServer.integration.test.ts with 100% similarity]
tests/utils/Configuration-HotReload.test.ts [moved from tests/utils/Configuration-hot-reload.test.ts with 100% similarity]
tests/utils/ConfigurationValidation-Perf.test.ts [moved from tests/utils/ConfigurationValidation-perf.test.ts with 100% similarity]

similarity index 91%
rename from tests/charging-station/ocpp/2.0/OCPP20RequestService-HeartBeat.test.ts
rename to tests/charging-station/ocpp/2.0/OCPP20RequestService-Heartbeat.test.ts
index d2e1fc74b39e355385644d1b2a4dd3f64b0dea88..eb5b7b8b66ab7c4e6f67498e9f3ce816fd39009d 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * @file Tests for OCPP20RequestService HeartBeat
+ * @file Tests for OCPP20RequestService Heartbeat
  * @description Unit tests for OCPP 2.0 Heartbeat request building (G02)
  */
 import assert from 'node:assert/strict'
@@ -49,7 +49,7 @@ await describe('G02 - Heartbeat', async () => {
   })
 
   // FR: G02.FR.01
-  await it('should build HeartBeat request payload correctly with empty object', () => {
+  await it('should build Heartbeat request payload correctly with empty object', () => {
     const requestParams: OCPP20HeartbeatRequest = {}
 
     const payload = testableRequestService.buildRequestPayload(
@@ -64,7 +64,7 @@ await describe('G02 - Heartbeat', async () => {
   })
 
   // FR: G02.FR.02
-  await it('should build HeartBeat request payload correctly without parameters', () => {
+  await it('should build Heartbeat request payload correctly without parameters', () => {
     // Test without passing any request parameters
     const payload = testableRequestService.buildRequestPayload(
       station,
@@ -95,7 +95,7 @@ await describe('G02 - Heartbeat', async () => {
   })
 
   // FR: G02.FR.04
-  await it('should handle HeartBeat request consistently across multiple calls', () => {
+  await it('should handle Heartbeat request consistently across multiple calls', () => {
     const requestParams: OCPP20HeartbeatRequest = {}
 
     // Call buildRequestPayload multiple times to ensure consistency
@@ -125,7 +125,7 @@ await describe('G02 - Heartbeat', async () => {
   })
 
   // FR: G02.FR.05
-  await it('should handle HeartBeat request with different charging station configurations', () => {
+  await it('should handle Heartbeat request with different charging station configurations', () => {
     const { station: alternativeChargingStation } = createMockChargingStation({
       baseName: TEST_CHARGING_STATION_BASE_NAME,
       connectorsCount: 3,
@@ -150,7 +150,7 @@ await describe('G02 - Heartbeat', async () => {
       requestParams
     )
 
-    // HeartBeat payload should remain empty regardless of charging station configuration
+    // Heartbeat payload should remain empty regardless of charging station configuration
     assert.notStrictEqual(payload, undefined)
     assert.strictEqual(typeof payload, 'object')
     assert.strictEqual(Object.keys(payload as object).length, 0)
@@ -158,7 +158,7 @@ await describe('G02 - Heartbeat', async () => {
   })
 
   // FR: G02.FR.06
-  await it('should build empty HeartBeat request conforming to OCPP 2.0 specification', () => {
+  await it('should build empty Heartbeat request conforming to OCPP 2.0 specification', () => {
     const requestParams: OCPP20HeartbeatRequest = {}
 
     const payload = testableRequestService.buildRequestPayload(
@@ -167,7 +167,7 @@ await describe('G02 - Heartbeat', async () => {
       requestParams
     )
 
-    // According to OCPP 2.0 specification, HeartBeat request should be an empty object
+    // According to OCPP 2.0 specification, Heartbeat request should be an empty object
     // This validates compliance with the official OCPP 2.0 standard
     assert.notStrictEqual(payload, undefined)
     assert.deepStrictEqual(payload, {})