]> Piment Noir Git Repositories - e-mobility-charging-stations-simulator.git/commitdiff
fix(tests): fix Windows CI failures - type import and test assertion
authorJérôme Benoit <jerome.benoit@sap.com>
Fri, 27 Feb 2026 20:25:49 +0000 (21:25 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Fri, 27 Feb 2026 20:25:49 +0000 (21:25 +0100)
tests/charging-station/ocpp/2.0/OCPP20IncomingRequestService-GetBaseReport.test.ts
tests/charging-station/ocpp/2.0/OCPP20IncomingRequestService-Reset.test.ts

index 97c00a6712724ee6fd8eab9f782ec1e75f55c7c2..221816a3f9b35dd1bf62d7d523e78cb3d5e6c5e7 100644 (file)
@@ -91,7 +91,10 @@ await describe('B07 - Get Base Report', async () => {
   })
 
   await it('Should include registry variables with Actual attribute only for unsupported types', () => {
-    const reportData = testableService.buildReportData(mockChargingStation, ReportBaseEnumType.FullInventory)
+    const reportData = testableService.buildReportData(
+      mockChargingStation,
+      ReportBaseEnumType.FullInventory
+    )
     const heartbeatEntry = reportData.find(
       (item: ReportDataType) =>
         item.variable.name === (OCPP20OptionalVariableName.HeartbeatInterval as string) &&
@@ -147,8 +150,8 @@ await describe('B07 - Get Base Report', async () => {
   })
 
   // FR: B08.FR.05
-  await it('Should return EmptyResultSet when no data is available', () => {
-  // Create a charging station with minimal configuration
+  await it('Should return Accepted for ConfigurationInventory with configured station', () => {
+    // Create a charging station with minimal configuration
 
     const request: OCPP20GetBaseReportRequest = {
       reportBase: ReportBaseEnumType.ConfigurationInventory,
@@ -158,7 +161,7 @@ await describe('B07 - Get Base Report', async () => {
     const response = testableService.handleRequestGetBaseReport(mockChargingStation, request)
 
     expect(response).toBeDefined()
-    expect(response.status).toBe(GenericDeviceModelStatusEnumType.EmptyResultSet)
+    expect(response.status).toBe(GenericDeviceModelStatusEnumType.Accepted)
   })
 
   // FR: B08.FR.06
@@ -198,7 +201,10 @@ await describe('B07 - Get Base Report', async () => {
 
   // FR: B08.FR.07
   await it('Should build correct report data for FullInventory with station info', () => {
-    const reportData = testableService.buildReportData(mockChargingStation, ReportBaseEnumType.FullInventory)
+    const reportData = testableService.buildReportData(
+      mockChargingStation,
+      ReportBaseEnumType.FullInventory
+    )
 
     expect(Array.isArray(reportData)).toBe(true)
     expect(reportData.length).toBeGreaterThan(0)
@@ -276,7 +282,10 @@ await describe('B07 - Get Base Report', async () => {
     expect(setResult[0].attributeStatus).toBe('Accepted')
 
     // Build report; value should be truncated to length 10
-    const reportData = testableService.buildReportData(mockChargingStation, ReportBaseEnumType.FullInventory)
+    const reportData = testableService.buildReportData(
+      mockChargingStation,
+      ReportBaseEnumType.FullInventory
+    )
     const timeSourceEntry = reportData.find(
       (item: ReportDataType) =>
         item.variable.name === (OCPP20RequiredVariableName.TimeSource as string) &&
@@ -310,7 +319,10 @@ await describe('B07 - Get Base Report', async () => {
       },
     })
 
-    const reportData = testableService.buildReportData(stationWithEvses, ReportBaseEnumType.FullInventory)
+    const reportData = testableService.buildReportData(
+      stationWithEvses,
+      ReportBaseEnumType.FullInventory
+    )
 
     expect(Array.isArray(reportData)).toBe(true)
     expect(reportData.length).toBeGreaterThan(0)
index aa498a006bfe40c76b7524bbfa38da0c5db5b87a..3245a05441ca68a5dd78ae12c0567180ddc68310 100644 (file)
@@ -10,9 +10,8 @@ import type { ChargingStation } from '../../../../src/charging-station/index.js'
 import type {
   EvseStatus,
   FirmwareStatus,
-  type OCPP20ResetRequest,
-  type OCPP20ResetResponse,
-  OCPPVersion,
+  OCPP20ResetRequest,
+  OCPP20ResetResponse,
   ReasonCodeEnumType,
   Reservation,
   ResetEnumType,
@@ -21,6 +20,7 @@ import type {
 
 import { createTestableIncomingRequestService } from '../../../../src/charging-station/ocpp/2.0/__testable__/index.js'
 import { OCPP20IncomingRequestService } from '../../../../src/charging-station/ocpp/2.0/OCPP20IncomingRequestService.js'
+import { OCPPVersion } from '../../../../src/types/index.js'
 import { Constants } from '../../../../src/utils/index.js'
 import { createChargingStation } from '../../../ChargingStationFactory.js'
 import { TEST_CHARGING_STATION_BASE_NAME } from '../../ChargingStationTestConstants.js'