Comments should describe what the code does, not how it evolved.
/**
* 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
* @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'
/**
* Testable UIWebSocketServer that exposes protected members for testing.
- * Consolidates TestableUIWebSocketServer from UIWebSocketServer.test.ts and AbstractUIService.test.ts.
*/
export class TestableUIWebSocketServer extends UIWebSocketServer {
/**
/**
* 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
* @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'