feat: use new ui bubbletea

This commit is contained in:
leonardotrapani
2026-02-01 20:40:17 +01:00
parent 3ae86f7bae
commit 0b0e084155
25 changed files with 2249 additions and 1934 deletions
+28
View File
@@ -0,0 +1,28 @@
package tui
import (
"testing"
tea "github.com/charmbracelet/bubbletea"
"github.com/leonardotrapani/hyprvoice/internal/config"
)
func TestWizardMenuTransitionAppliesSize(t *testing.T) {
cfg := &config.Config{}
state := &wizardState{cfg: cfg}
model := newWizardModel(state, newMenuScreen(state))
updated, _ := model.Update(tea.WindowSizeMsg{Width: 120, Height: 40})
model = updated.(wizardModel)
updated, _ = model.Update(tea.KeyMsg{Type: tea.KeyEnter})
model = updated.(wizardModel)
listScreen, ok := model.screen.(*listScreen)
if !ok {
t.Fatalf("expected list screen after selection, got %T", model.screen)
}
if listScreen.list.Width() <= 0 || listScreen.list.Height() <= 0 {
t.Fatalf("expected list size to be set, got width=%d height=%d", listScreen.list.Width(), listScreen.list.Height())
}
}