[Repo Assist] test(shared): add 45 unit tests for MenuDisplayHelper and MenuSizingHelper#522
Conversation
…elper Both classes had zero test coverage. These tests cover: MenuDisplayHelper (21 tests): - GetStatusIcon: Connected/Connecting/Error/unknown enum value - GetChannelStatusIcon: healthy/intermediate/empty/null/unknown status - TruncateText: short/null/whitespace/exact-max/over-max/custom-length - FormatProviderSummary: singular vs plural - GetNextToggleValue: on/ON/On → off; off/null/empty/other → on MenuSizingHelper (24 tests): - ConvertPixelsToViewUnits: 96/192 dpi, zero/negative pixels, zero dpi fallback, minimum-1 clamp - HasDpiOrScaleChanged: same DPI+scale, different DPI, different scale, sub-tolerance scale delta, zero-DPI normalisation, NaN/0 scale normalisation - CalculateWindowHeight: content fits/exceeds, zero/negative content, zero work area, work area smaller than minimum, custom minimum All 45 tests pass. Pre-existing 8 failures in ExecApprovalV2NormalizationTests are Windows-path tests that fail on Linux runners — not caused by this change. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Codex review: needs maintainer review before merge. Latest ClawSweeper review: 2026-05-23 01:33 UTC / May 22, 2026, 9:33 PM ET. Workflow note: Future ClawSweeper reviews update this same comment in place. How this review workflow works
Summary Reproducibility: not applicable. this is a test coverage PR, not a bug report. The source check shows the helpers and existing tray-project tests are present on current main. PR rating Rank-up moves:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. Real behavior proof Risk before merge
Maintainer options:
Next step before merge Security Review detailsBest possible solution: Keep one clear owning location for menu helper coverage, adding only the missing tolerance or normalization cases if maintainers want extra coverage in Shared.Tests. Do we have a high-confidence way to reproduce the issue? Not applicable; this is a test coverage PR, not a bug report. The source check shows the helpers and existing tray-project tests are present on current main. Is this the best way to solve the issue? Unclear. The patch is coherent, but current main already has broader helper tests in Label changes:
Label justifications:
What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 8714381248a2. |
|
ClawSweeper PR egg ✨ Hatched: 🥚 common Moonlit Merge Sprite Hatch commandComment Hatchability rules:
Rarity: 🥚 common. What is this egg doing here?
|
🤖 This PR was created by Repo Assist, an automated AI assistant.
Summary
MenuDisplayHelperandMenuSizingHelperare pure static helpers inOpenClaw.Sharedwith zero unit-test coverage. This PR adds 45 tests across both classes.MenuDisplayHelper (21 tests)
GetStatusIcon— Connected / Connecting / Error / unknown enum valueGetChannelStatusIcon— healthy, intermediate, null, empty, and unknown status stringsTruncateText— short, null, whitespace-only, exact-max-length, over-max-length, and custommaxLengthFormatProviderSummary— singular vs pluralGetNextToggleValue—on/ON/On→off; everything else →onMenuSizingHelper (24 tests)
ConvertPixelsToViewUnits— 96 dpi, 192 dpi, zero/negative pixels, zero-dpi fallback, minimum-1 clampHasDpiOrScaleChanged— identical, DPI change, scale change, sub-tolerance scale delta, zero-DPI normalisation, NaN/0 scale normalisationCalculateWindowHeight— content fits, content exceeds work area, zero/negative content, zero work area, work area smaller than minimum, custom minimum heightTest Status
dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj— 45 new tests pass ✅