fbe444c3ab
- Add Bubble Tea TUI model with Init/Update/View - Implement host list screen with keyboard navigation (up/down/enter/q) - Add styled rendering for hosts, selection, tags - Create hostkeeper tui CLI command - Add tests for TUI initialization and host loading - Update project state documentation
33 lines
525 B
Go
33 lines
525 B
Go
package tui
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestTUIInitialization(t *testing.T) {
|
|
ui := New()
|
|
if ui == nil {
|
|
t.Fatal("Failed to initialize TUI")
|
|
}
|
|
|
|
if ui.CurrentScreen != ScreenHostList {
|
|
t.Errorf("expected CurrentScreen ScreenHostList, got %d", ui.CurrentScreen)
|
|
}
|
|
|
|
if ui.Quit {
|
|
t.Error("expected Quit to be false")
|
|
}
|
|
}
|
|
|
|
func TestTUILoadHosts(t *testing.T) {
|
|
ui := New()
|
|
if ui == nil {
|
|
t.Fatal("Failed to initialize TUI")
|
|
}
|
|
|
|
ui.LoadHosts(nil)
|
|
if ui.Hosts != nil {
|
|
t.Error("expected Hosts to be nil")
|
|
}
|
|
}
|