Skip to content

fix(tests): TUI view and launch tests discard results without meaningful assertions #56

@jongio

Description

@jongio

Summary

At least 12 tests in internal/tui call functions and immediately discard the results with _ = v or _ = cmd, providing zero assertion value. These tests pass regardless of whether the code under test works correctly.

Details

Field Value
Files internal/tui/model_update_test.go, internal/tui/model_launch_test.go
Severity High
Category Testing quality

View tests with no assertions (model_update_test.go lines 103-134)

  • TestView_HelpOverlay — calls View(), discards result
  • TestView_ShellPicker — calls View(), discards result
  • TestView_FilterPanel — calls View(), discards result
  • TestView_ConfigPanel — calls View(), discards result

These tests only verify that View() does not panic, but the adjacent TestView_Loading (line 95) shows the correct pattern — it asserts that the content is non-empty.

Launch tests with no assertions (model_launch_test.go lines 18-100+)

  • TestLaunchMultiple_NoSelections_NoFolder — calls launchMultiple(), discards cmd
  • TestLaunchMultiple_WithSelectedSessions — calls launchMultiple(), discards cmd
  • TestLaunchMultiple_FolderSelected — calls launchMultiple(), discards cmd
  • TestLaunchMultiple_EmptySelectedSessions — calls launchMultiple(), discards cmd
  • TestLaunchMultiple_InPlaceModeForced — calls launchMultiple(), discards cmd

Suggested fix

At minimum, assert that View() returns non-empty content and launchMultiple() returns nil or non-nil cmd as appropriate for the scenario.

Metadata

Metadata

Assignees

No one assigned

    Labels

    automatedCreated by automationmax-qualityQuality audit findings

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions