docs/E2E_TESTING.md
The TUI module includes a comprehensive E2E test suite covering complete user interaction workflows. These tests verify that individual components (handlers, renderers, state management) work correctly together in realistic usage scenarios.
File: internal/tui/e2e_test.go
Tests: 18 end-to-end workflow tests
Coverage: 87.5% of statements
All tests pass with -race flag for concurrency safety
go test ./internal/tui/... -v -run E2E -race
go test ./internal/tui/... -race
go test ./internal/tui/... -cover
go test ./internal/tui/... -v -race
Each E2E test follows this pattern:
// Create model with servers
m := NewModel(context.Background(), client, 5*time.Second)
m.servers = []serverInfo{ ... }
// Enter filter mode (press 'f')
result, _ := m.Update(tea.KeyMsg{Type: tea.KeyRunes, Runes: []rune{'f'}})
m = result.(model)
// Verify state
assert.Equal(t, ModeFilterEdit, m.uiMode)
Update() method returns (tea.Model, tea.Cmd)model: m = result.(model)renderServers() and renderActivity() require height parameter for visible rowsThe TUI has 5 modes:
These tests run as part of the standard test suite:
go test -race ./internal/tui/...
No additional dependencies are required—tests use only Go standard library and existing test frameworks (testify).
Potential areas for additional E2E tests:
t.Logf() to print model stateinternal/tui/handlers.go for key handling logicinternal/tui/views.go for display logic-run TestName to isolate and debuginternal/tui/model.go for state managementinternal/tui/handlers.go for key bindingsinternal/tui/views.go for display logic