Add View-layer render tests for cluster reports tab#347
Merged
Conversation
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 Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
renderClusterReportsTabwas the only fully-untested (0%) render function in theTUI package. Added deterministic, fully-mocked render tests (model state only —
no PagerDuty/OCM/backplane API, no host tools, no filesystem) covering every branch:
DatadecodeTest plan
renderClusterReportsTabcoverage 0% → 100%;pkg/tui64.0% → 64.9%make test-allgreen (fmt, vet, lint, test, race, test-fixtures)Only test files + a plan doc touched; no README trigger.
🤖 Generated with Claude Code