mirror of
https://github.com/marcusDenslow/terminalShop.git
synced 2026-10-25 02:52:20 +02:00
test was failing after some AI change. this should fix it
This commit is contained in:
@@ -18,7 +18,7 @@ func TestModel_updateLayout(t *testing.T) {
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
m := NewModel("")
|
||||
m.updateLayout(tt.width, tt.height)
|
||||
m = m.updateLayout(tt.width, tt.height)
|
||||
if m.viewportWidth != tt.width {
|
||||
t.Errorf("viewportWidth = %d, want %d", m.viewportWidth, tt.width)
|
||||
}
|
||||
|
||||
@@ -202,7 +202,8 @@ func validatePaymentForm(state *PaymentFormState) string {
|
||||
// UpdatePaymentForm handles updates to the payment form.
|
||||
// Mutates state in place, returns only the tea.Cmd.
|
||||
func (m Model) UpdatePaymentForm(msg tea.Msg, state *PaymentFormState) tea.Cmd {
|
||||
if _, ok := msg.(tea.WindowSizeMsg); ok {
|
||||
switch _, ok := msg.(tea.WindowSizeMsg); {
|
||||
case ok:
|
||||
if m.size < medium {
|
||||
state.form = state.form.WithLayout(huh.LayoutStack).WithWidth(m.widthContent)
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user