Skip to content

Add View-layer render tests for cluster reports tab#347

Merged
clcollins merged 2 commits into
mainfrom
srepd/view-render-tests
Jul 9, 2026
Merged

Add View-layer render tests for cluster reports tab#347
clcollins merged 2 commits into
mainfrom
srepd/view-render-tests

Conversation

@clcollins

Copy link
Copy Markdown
Owner

Summary

renderClusterReportsTab was the only fully-untested (0%) render function in the
TUI package. Added deterministic, fully-mocked render tests (model state only —
no PagerDuty/OCM/backplane API, no host tools, no filesystem) covering every branch:

  • backplane disabled / OCM not connected / OCM auth pending / loading
  • cache present but no reports
  • with data: report numbering, summaries, newest-first sort, base64 Data decode
  • invalid base64 → raw fallback

Test plan

  • 7 render tests, all green (characterization of existing correct behavior)
  • renderClusterReportsTab coverage 0% → 100%; pkg/tui 64.0% → 64.9%
  • make test-all green (fmt, vet, lint, test, race, test-fixtures)

Only test files + a plan doc touched; no README trigger.

🤖 Generated with Claude Code

renderClusterReportsTab was the only fully-untested (0%) render function.
Add deterministic, fully-mocked tests covering every branch (backplane
disabled, OCM not connected/pending/loading, no reports, with-data with
newest-first sort and base64 decode, invalid-base64 fallback). Model state
only — no API/host/filesystem calls.

Coverage: renderClusterReportsTab 0% -> 100%; pkg/tui 64.0% -> 64.9%.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@codecov-commenter

codecov-commenter commented Jul 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.86%. Comparing base (7332752) to head (eb94544).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #347      +/-   ##
==========================================
+ Coverage   66.43%   66.86%   +0.42%     
==========================================
  Files          51       51              
  Lines        8200     8200              
==========================================
+ Hits         5448     5483      +35     
+ Misses       2375     2341      -34     
+ Partials      377      376       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@clcollins clcollins merged commit 5ba13a9 into main Jul 9, 2026
11 checks passed
@clcollins clcollins deleted the srepd/view-render-tests branch July 9, 2026 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants