From cd516fdcf47ac79ec75dc50be79cee3fd0067ebd Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Fri, 27 Feb 2026 21:25:49 +0100 Subject: [PATCH] fix(tests): fix Windows CI failures - type import and test assertion --- ...comingRequestService-GetBaseReport.test.ts | 26 ++++++++++++++----- ...OCPP20IncomingRequestService-Reset.test.ts | 6 ++--- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/tests/charging-station/ocpp/2.0/OCPP20IncomingRequestService-GetBaseReport.test.ts b/tests/charging-station/ocpp/2.0/OCPP20IncomingRequestService-GetBaseReport.test.ts index 97c00a67..221816a3 100644 --- a/tests/charging-station/ocpp/2.0/OCPP20IncomingRequestService-GetBaseReport.test.ts +++ b/tests/charging-station/ocpp/2.0/OCPP20IncomingRequestService-GetBaseReport.test.ts @@ -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) diff --git a/tests/charging-station/ocpp/2.0/OCPP20IncomingRequestService-Reset.test.ts b/tests/charging-station/ocpp/2.0/OCPP20IncomingRequestService-Reset.test.ts index aa498a00..3245a054 100644 --- a/tests/charging-station/ocpp/2.0/OCPP20IncomingRequestService-Reset.test.ts +++ b/tests/charging-station/ocpp/2.0/OCPP20IncomingRequestService-Reset.test.ts @@ -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' -- 2.43.0