})
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) &&
})
// 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,
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
// 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)
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) &&
},
})
- 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)
import type {
EvseStatus,
FirmwareStatus,
- type OCPP20ResetRequest,
- type OCPP20ResetResponse,
- OCPPVersion,
+ OCPP20ResetRequest,
+ OCPP20ResetResponse,
ReasonCodeEnumType,
Reservation,
ResetEnumType,
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'