Conversation
Added comprehensive test coverage for UI rendering functions:
- views_cluster_test.go: Added 11 new tests covering cluster health
rendering, node views, and different cluster states (green, yellow, red)
- Coverage improvements: renderClusterView (80% → 92.5%),
renderNodesView (70% → 100%), renderNode (85.7% → 100%)
- views_resources_test.go: Added 10 new tests for resource view
rendering and field type handling
- Coverage improvements: countFields (0% → 100%),
formatFieldType (75% → 100%), renderResourcesView (5.6% → 80.6%),
renderIndexSchemaView (47.1% → 100%)
Overall project coverage increased from 58.0% to 66.2% (+8.2%)
UI package coverage increased from 59.4% to 68.0% (+8.6%)
Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
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
Changes
views_cluster_test.go (11 new tests)
Added comprehensive tests for cluster health rendering:
TestApp_RenderClusterView_NoData- Test rendering with no cluster dataTestApp_RenderClusterView_GreenStatus- Test green cluster status renderingTestApp_RenderClusterView_YellowStatus- Test yellow status with relocating/unassigned shardsTestApp_RenderClusterView_RedStatus- Test red status with initializing shardsTestApp_RenderNodesView_NoNodes- Test empty node list handlingTestApp_RenderNodesView_MasterNodes- Test master node renderingTestApp_RenderNodesView_DataNodes- Test data node renderingTestApp_RenderNodesView_MixedNodes- Test mixed node typesTestApp_RenderNode_WithDiskInfo- Test node rendering with disk informationTestApp_RenderNode_ActiveMaster- Test active master indicatorTestApp_RenderNode_NoDiskInfo- Test node rendering without disk infoviews_resources_test.go (10 new tests)
Added comprehensive tests for resource view rendering:
TestApp_CountFields_SimpleFields- Test simple field countingTestApp_CountFields_NestedFields- Test nested field countingTestApp_CountFields_DeepNesting- Test deeply nested fieldsTestApp_CountFields_EmptyProperties- Test empty propertiesTestApp_FormatFieldType- Test field type formatting (17 subtests)TestApp_RenderResourcesView_NoNodes- Test resource view with no nodesTestApp_RenderResourcesView_WithNodes- Test resource view with cluster metricsTestApp_RenderIndexSchemaView_NoMapping- Test schema view with no mappingTestApp_RenderIndexSchemaView_NoProperties- Test schema view with no propertiesTestApp_RenderIndexSchemaView_WithProperties- Test complete schema renderingCoverage Improvements
Function-level improvements:
renderClusterView: 80% → 92.5% (+12.5%)renderNodesView: 70% → 100% (+30%)renderNode: 85.7% → 100% (+14.3%)countFields: 0% → 100% (+100%)formatFieldType: 75% → 100% (+25%)renderResourcesView: 5.6% → 80.6% (+75%)renderIndexSchemaView: 47.1% → 100% (+52.9%)Test plan
🤖 Generated with Claude Code