openclaw-windows-node/tests
Scott Hanselman 4ffd028a02 test: harden test assertions and fix GetIntArg overflow bug
Test hardening (Codex code-review findings across 8 test files):

- OpenClawGatewayClientTests: constructor tests now verify URL normalization instead of just NotNull; renamed misleading GetSessionList_SortsMainSessionFirst to _ReturnsEmpty_ForFreshClient

- ExecApprovalPolicyTests: ExecApprovalsGet now deserializes and asserts enabled/defaultAction/rules fields; WithoutPolicy test verifies enabled=false

- CapabilityTests: screen list test validates screens[] array fields (name/primary/bounds); camera list validates cameras[] entries (DeviceId/Name/IsDefault); error-path tests assert 'not available' error message

- NodeCapabilitiesTests: ExecuteAsync verifies payload echoes command; CanSet verifies payload value; added Int32 overflow test

- DeviceIdentityTests: signature length tightened from >40 to ==86; public key test decodes base64url and asserts 32-byte Ed25519 length

- GatewayUrlHelperTests: added malformed percent-encoding negative tests; tightened ValidationMessage assertion

- ReadmeValidationTests: validates ALL matching allowCommands JSON blocks, not just first

- ModelsTests: replaced overly permissive OR assertion with platform-aware exact checks

Production fix:

- NodeCapabilities.GetIntArg: catch FormatException on Int32 overflow and return default value instead of throwing
2026-04-01 13:55:25 -07:00
..
OpenClaw.Shared.Tests test: harden test assertions and fix GetIntArg overflow bug 2026-04-01 13:55:25 -07:00
OpenClaw.Tray.Tests feat: SSH tunnel gateway, device identity, reconnect hardening 2026-04-01 00:03:43 -07:00