]> Piment Noir Git Repositories - e-mobility-charging-stations-simulator.git/commitdiff
chore(tests): auto-fix lint errors (sorting and unused imports)
authorJérôme Benoit <jerome.benoit@sap.com>
Fri, 27 Feb 2026 19:49:18 +0000 (20:49 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Fri, 27 Feb 2026 19:49:18 +0000 (20:49 +0100)
- Fix export ordering in ChargingStationTestUtils.ts
- Fix object property sorting in OCPPAuthIntegration.test.ts
- Reduces lint errors from 61 to 50 (11 auto-fixed)
- All 291 tests still passing

tests/charging-station/ChargingStationTestUtils.ts
tests/charging-station/ocpp/auth/OCPPAuthIntegration.test.ts

index 8f88d1542c143d234b181a3ec29945cb47309abb..df1ece2e82dfb9d1262db493c9fe094dba884c97 100644 (file)
  * @see tests/charging-station/ChargingStationTestConstants.ts for test constants
  */
 
-// Re-export all mock classes
-export { MockWebSocket, WebSocketReadyState } from './mocks/MockWebSocket.js'
-export { MockIdTagsCache, MockSharedLRUCache } from './mocks/MockCaches.js'
-
 // Re-export all helper functions and types
 export type {
   ChargingStationMocks,
   MockChargingStationOptions,
   MockChargingStationResult,
 } from './helpers/StationHelpers.js'
-
 export {
   cleanupChargingStation,
   createMockChargingStation,
@@ -30,3 +25,8 @@ export {
   resetChargingStationState,
   waitForCondition,
 } from './helpers/StationHelpers.js'
+
+export { MockIdTagsCache, MockSharedLRUCache } from './mocks/MockCaches.js'
+
+// Re-export all mock classes
+export { MockWebSocket, WebSocketReadyState } from './mocks/MockWebSocket.js'
index b117516a1080f3e940a1521f763c714bed7cef1a..ba91b4b143914aa445b8664ba9506ef7b7a3ae5e 100644 (file)
@@ -169,9 +169,9 @@ await describe('OCPP Authentication Integration Tests', async () => {
     await it('should authenticate with valid identifier', async () => {
       const authService = new OCPPAuthServiceImpl(mockChargingStation16)
       const request = createMockAuthRequest({
-        identifier: createMockOCPP16Identifier('VALID_ID_123'),
         connectorId: 1,
         context: AuthContext.TRANSACTION_START,
+        identifier: createMockOCPP16Identifier('VALID_ID_123'),
       })
 
       const result = await authService.authenticate(request)
@@ -194,9 +194,9 @@ await describe('OCPP Authentication Integration Tests', async () => {
 
       for (const context of contexts) {
         const request = createMockAuthRequest({
-          identifier: createMockOCPP16Identifier(`CONTEXT_TEST_${context}`),
           connectorId: 1,
           context,
+          identifier: createMockOCPP16Identifier(`CONTEXT_TEST_${context}`),
         })
 
         const result = await authService.authenticate(request)
@@ -208,8 +208,8 @@ await describe('OCPP Authentication Integration Tests', async () => {
     await it('should authorize request directly', async () => {
       const authService = new OCPPAuthServiceImpl(mockChargingStation16)
       const request = createMockAuthRequest({
-        identifier: createMockOCPP16Identifier('AUTH_DIRECT_TEST'),
         connectorId: 1,
+        identifier: createMockOCPP16Identifier('AUTH_DIRECT_TEST'),
       })
 
       const result = await authService.authorize(request)
@@ -222,9 +222,9 @@ await describe('OCPP Authentication Integration Tests', async () => {
     await it('should authenticate with valid identifier', async () => {
       const authService = new OCPPAuthServiceImpl(mockChargingStation20)
       const request = createMockAuthRequest({
-        identifier: createMockOCPP20Identifier('VALID_ID_456'),
         connectorId: 2,
         context: AuthContext.TRANSACTION_START,
+        identifier: createMockOCPP20Identifier('VALID_ID_456'),
       })
 
       const result = await authService.authenticate(request)
@@ -246,9 +246,9 @@ await describe('OCPP Authentication Integration Tests', async () => {
 
       for (const context of contexts) {
         const request = createMockAuthRequest({
-          identifier: createMockOCPP20Identifier(`V20_CONTEXT_${context}`),
           connectorId: 2,
           context,
+          identifier: createMockOCPP20Identifier(`V20_CONTEXT_${context}`),
         })
 
         const result = await authService.authenticate(request)
@@ -262,13 +262,13 @@ await describe('OCPP Authentication Integration Tests', async () => {
     await it('should handle invalid identifier gracefully', async () => {
       const authService = new OCPPAuthServiceImpl(mockChargingStation16)
       const request = createMockAuthRequest({
+        connectorId: 999, // Invalid connector
+        context: AuthContext.TRANSACTION_START,
         identifier: {
           ocppVersion: OCPPVersion.VERSION_16,
           type: IdentifierType.ISO14443,
           value: '', // Invalid empty value
         },
-        connectorId: 999, // Invalid connector
-        context: AuthContext.TRANSACTION_START,
       })
 
       const result = await authService.authenticate(request)
@@ -349,8 +349,8 @@ await describe('OCPP Authentication Integration Tests', async () => {
 
       for (let i = 0; i < requestCount; i++) {
         const request = createMockAuthRequest({
-          identifier: createMockOCPP16Identifier(`PERF_TEST_${String(i)}`),
           connectorId: 1,
+          identifier: createMockOCPP16Identifier(`PERF_TEST_${String(i)}`),
         })
         promises.push(authService.authenticate(request))
       }
@@ -406,9 +406,9 @@ await describe('OCPP Authentication Integration Tests', async () => {
       const mockService = createMockAuthService({
         authorize: () =>
           Promise.resolve({
-            status: AuthorizationStatus.BLOCKED,
-            method: AuthenticationMethod.REMOTE_AUTHORIZATION,
             isOffline: false,
+            method: AuthenticationMethod.REMOTE_AUTHORIZATION,
+            status: AuthorizationStatus.BLOCKED,
             timestamp: new Date(),
           }),
       })