feat: implement basic TUI framework with host list
- 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
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
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")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user