From: Jérôme Benoit Date: Sun, 1 Mar 2026 01:41:36 +0000 (+0100) Subject: refactor(test): remove implementation history from comments X-Git-Tag: v3~45 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=a5e4b79b86ae53fb65d3994a95da6b99642c8638;p=e-mobility-charging-stations-simulator.git refactor(test): remove implementation history from comments Comments should describe what the code does, not how it evolved. --- diff --git a/tests/charging-station/ocpp/auth/helpers/MockFactories.ts b/tests/charging-station/ocpp/auth/helpers/MockFactories.ts index d6977653..88684d14 100644 --- a/tests/charging-station/ocpp/auth/helpers/MockFactories.ts +++ b/tests/charging-station/ocpp/auth/helpers/MockFactories.ts @@ -61,12 +61,7 @@ export const createMockAuthRequest = (overrides?: Partial): AuthReq /** * Create a mock AuthorizationResult with configurable status. * - * This factory consolidates what were previously 5 separate factories: - * - createMockAuthorizationResult (ACCEPTED) - * - createMockRejectedAuthorizationResult (INVALID) - * - createMockBlockedAuthorizationResult (BLOCKED) - * - createMockExpiredAuthorizationResult (EXPIRED) - * - createMockConcurrentTxAuthorizationResult (CONCURRENT_TX) + * Supports all AuthorizationStatus values: ACCEPTED, INVALID, BLOCKED, EXPIRED, CONCURRENT_TX. * @param status - Authorization status (defaults to ACCEPTED) * @param overrides - Partial AuthorizationResult properties to override defaults * @returns Mock AuthorizationResult with specified status from local list method diff --git a/tests/charging-station/ui-server/UIServerSecurity.test.ts b/tests/charging-station/ui-server/UIServerSecurity.test.ts index e2db4bee..8d858c45 100644 --- a/tests/charging-station/ui-server/UIServerSecurity.test.ts +++ b/tests/charging-station/ui-server/UIServerSecurity.test.ts @@ -2,7 +2,6 @@ * @file Tests for UIServerSecurity * @description Unit tests for UI server security utilities (rate limiting, validation) */ -// Copyright Jerome Benoit. 2024-2025. All Rights Reserved. import { expect } from '@std/expect' import { afterEach, describe, it } from 'node:test' diff --git a/tests/charging-station/ui-server/UIServerTestUtils.ts b/tests/charging-station/ui-server/UIServerTestUtils.ts index c726025b..8121ad65 100644 --- a/tests/charging-station/ui-server/UIServerTestUtils.ts +++ b/tests/charging-station/ui-server/UIServerTestUtils.ts @@ -26,7 +26,6 @@ import { MockWebSocket } from '../mocks/MockWebSocket.js' /** * Testable UIWebSocketServer that exposes protected members for testing. - * Consolidates TestableUIWebSocketServer from UIWebSocketServer.test.ts and AbstractUIService.test.ts. */ export class TestableUIWebSocketServer extends UIWebSocketServer { /** @@ -243,8 +242,8 @@ export interface MockUIService { /** * Create a mock UI service for testing UIWebSocketServer. * - * Consolidates MockUIServiceBroadcast, MockUIServiceError, and MockUIServiceNonBroadcast - * into a single parameterized factory. + * Configurable mock that simulates different AbstractUIService behaviors: + * broadcast responses, error responses, or direct (non-broadcast) responses. * @param mode - Service behavior mode (defaults to BROADCAST) * @returns Mock UI service with behavior based on mode * @example diff --git a/tests/charging-station/ui-server/UIWebSocketServer.test.ts b/tests/charging-station/ui-server/UIWebSocketServer.test.ts index 950cd105..09205138 100644 --- a/tests/charging-station/ui-server/UIWebSocketServer.test.ts +++ b/tests/charging-station/ui-server/UIWebSocketServer.test.ts @@ -2,7 +2,6 @@ * @file Tests for UIWebSocketServer * @description Unit tests for WebSocket-based UI server and response handling */ -// Copyright Jerome Benoit. 2024-2025. All Rights Reserved. import { expect } from '@std/expect' import { afterEach, describe, it } from 'node:test'