Skip to content

Add TestBackend-based widget rendering tests with insta snapshots #544

@bug-ops

Description

@bug-ops

Parent: #542

Problem

Only hyperlink.rs uses Buffer directly for testing. Widgets splash, input, confirm, help, skills, memory, resources, and status have no rendering tests.

Requirements

  • Add dev-dependency: insta with redactions feature
  • Create test helper: fn test_terminal(w: u16, h: u16) -> Terminal<TestBackend>
  • Create test helper: fn render_widget<F>(w: u16, h: u16, f: F) -> String returning buffer as string
  • Write snapshot tests for each untested widget: splash, input, confirm, help, skills, memory, resources, status
  • Test each widget in multiple states (e.g., input Normal vs Insert mode, confirm with different prompts)
  • Use insta::assert_snapshot! for all assertions

Acceptance criteria

  • Every render function has at least 2 snapshot tests
  • All snapshots are committed and reviewed

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesttestingTests and qualitytuiTUI dashboard

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions