openclaw-windows-node/tests
github-actions[bot] 2c29677dc3
test: add HandleRequestError coverage for auth/scope/unknown-method paths (#202)
Add 13 new tests to OpenClawGatewayClientTests covering the
HandleRequestError private method via reflection:

Pairing required (3 tests):
- SetsPairingBlockFlag: verifies _pairingRequiredAwaitingApproval = true
- LogsWarning: verifies auto-reconnect-paused warning is emitted
- RaisesErrorStatus: verifies ConnectionStatus.Error is raised

Device signature invalid (2 tests):
- CyclesSignatureMode: verifies mode steps V3AuthToken -> V3EmptyToken
- LogsWarningWithMode: verifies rejection warning is logged

Missing operator.read scope (1 Theory x 4 cases):
- sessions.list, usage.status, usage.cost, node.list all set
  _operatorReadScopeUnavailable = true

Unknown method fallbacks (4 tests):
- usage.status, usage.cost, sessions.preview, node.list each set
  their respective _*Unsupported flags

Also adds GatewayClientTestHelper overloads:
- Constructor accepting IOpenClawLogger (for log capture)
- TrackPendingRequest, GetPairingRequiredFlag, GetSignatureTokenMode,
  GetOperatorReadScopeUnavailable, CaptureStatusChanges helpers

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-23 10:25:20 -07:00
..
OpenClaw.Shared.Tests test: add HandleRequestError coverage for auth/scope/unknown-method paths (#202) 2026-04-23 10:25:20 -07:00
OpenClaw.Tray.Tests test: strengthen audit coverage and enable CI integration checks 2026-04-19 22:55:52 -07:00
Directory.Build.props eng: enable TreatWarningsAsErrors in test projects (#190) 2026-04-23 10:25:11 -07:00