Skip to content

Presentation Layer Testing and Cleanup #170

Closed

Description

@josecelano

This issue addresses specific presentation layer testing improvements and cleanup tasks identified during Epic #154 work. The focus is on practical improvements to test organization, code coverage, and following established testing conventions to prepare the codebase for future development.

Goals

Primary Goals

  1. Split test_support.rs into multiple focused modules
  2. Clean unused code in test support modules (unused public functions/methods)
  3. Fix test output - ensure clean output when run without --nocapture
  4. Reorganize tests in src/presentation/views/core.rs (better grouping of integration tests)
  5. Review naming conventions - ensure all tests follow it_should_ format from project conventions
  6. Increase code coverage across presentation layer modules

Success Criteria

  • test_support.rs split into logical modules with clear responsibilities
  • No unused public methods in test support modules
  • Clean test output without --nocapture flag
  • Well-organized test groups in core.rs following project conventions
  • All tests use it_should_ naming pattern consistently
  • Improved code coverage metrics across presentation layer

Implementation Plan

Task 1: Split test_support.rs into Multiple Modules

Current State: Single large file src/presentation/views/test_support.rs (438 lines)

Target Structure:

src/presentation/views/test_support/
├── mod.rs                  # Module exports and documentation
├── test_writer.rs          # TestWriter implementation
├── test_user_output.rs     # TestUserOutput struct and basic methods
└── test_wrapper.rs         # TestOutputWrapper and convenience methods

Task 2: Clean Unused Code in test_support modules

Current Issues: Unused public functions and methods identified:

  • output_pair() method marked with #[allow(dead_code)]
  • clear() method marked with #[allow(dead_code)]
  • Potentially other unused convenience methods

Task 3: Fix Test Output Quality

Problem: Tests produce noisy output when run without --nocapture
Expected Behavior: Clean output following docs/contributing/testing/unit-testing.md

Task 4: Reorganize Tests in core.rs

Current State: Tests in src/presentation/views/core.rs need better organization
Target: Group related tests into logical modules following project conventions

Task 5: Review and Fix Test Naming Conventions

Current Issues: Not all tests follow it_should_ naming pattern
Target: Convert all tests to use it_should_{expected_behavior}_when_{condition} format

Task 6: Increase Code Coverage

Current State: Various gaps in test coverage across presentation layer
Focus: Add missing test cases for edge conditions and ensure comprehensive coverage

Timeline

Estimated Effort: 3-5 days focused development

Task Priority:

  1. Task 1 (Module Split) - Foundation for other work
  2. Task 2 (Clean Unused Code) - Remove technical debt
  3. Task 5 (Naming Conventions) - Align with standards
  4. Task 4 (Test Organization) - Improve maintainability
  5. Task 3 (Test Output) - Developer experience
  6. Task 6 (Code Coverage) - Comprehensive validation

Related Documentation

Definition of Done

All 6 tasks completed with comprehensive test coverage, clean organization, and adherence to project conventions.

Activity

  1. self-assigned this
    on Nov 12, 2025
  2. added 20 commits that reference this issue on Nov 12, 2025
  3. added a commit that references this issue on Nov 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions