You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I am currently unit testing my TUI application using bubbletea. I found it unintuitive that when setting a field's value, you cannot immediately retrieve the results after creating a form.
funcTestFilledForm(t*testing.T) {
event:=sampleEvent()
f:=filledEventForm(EventWrapper{&event})
// huh forms do not set the results until processing nextFieldMsg through all fieldsfori:=0; i<50; i++ {
f.Update(f.NextField())
}
iff.GetString("summary") !=event.Summary {
t.Errorf("Summary: %v != %v", f.Get("summary"), event.Summary)
}
iff.GetString("description") !=event.Description {
t.Errorf("Description: %v != %v", f.Get("description"), event.Summary)
}
iff.GetString("start") !=event.Start.DateTime {
t.Errorf("Start: %v != %v", f.Get("start"), event.Start.DateTime)
}
iff.GetString("end") !=event.End.DateTime {
t.Errorf("End: %v != %v", f.Get("end"), event.End.DateTime)
}
iff.GetString("location") !=event.Location {
t.Errorf("Location: %v != %v", f.GetString("location"), event.Location)
}
}
Describe the solution you'd like
A clear and concise description of what you want to happen.
Within NewForm(), I would like to set the results to any existing values for fields within it.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
I can always call NextField() in the Form setup for my unit tests, but I figure this behavior might confuse some users in the future.
Additional context
I just want to make sure if there is a specific choice for forms to work this way. If it is not intended, I can take a stab at it. I'm learning Go right now, and I think it would be a good opportunity.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
I am currently unit testing my TUI application using bubbletea. I found it unintuitive that when setting a field's value, you cannot immediately retrieve the results after creating a form.
Describe the solution you'd like
A clear and concise description of what you want to happen.
Within
NewForm()
, I would like to set the results to any existing values for fields within it.Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
I can always call
NextField()
in the Form setup for my unit tests, but I figure this behavior might confuse some users in the future.Additional context
I just want to make sure if there is a specific choice for forms to work this way. If it is not intended, I can take a stab at it. I'm learning Go right now, and I think it would be a good opportunity.
The text was updated successfully, but these errors were encountered: