File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 44 "strings"
55 "testing"
66
7+ spinnerpkg "github.com/charmbracelet/bubbles/spinner"
78 tea "github.com/charmbracelet/bubbletea"
89)
910
@@ -155,14 +156,15 @@ func TestImageModel_Update_ImageReady(t *testing.T) {
155156func TestImageModel_Update_SpinnerTick (t * testing.T ) {
156157 model := ImageRenderer ("Mewtwo" , "http://example.com/mewtwo.png" )
157158
158- // Create a spinner tick message
159159 msg := model .Spinner .Tick ()
160160
161- // Update should handle spinner ticks
162- newModel , cmd := model .Update (msg )
161+ if _ , ok := msg .(spinnerpkg.TickMsg ); ! ok {
162+ t .Fatalf ("expected spinner.TickMsg, got %T" , msg )
163+ }
163164
164- // Should return a spinner command
165- if cmd == nil {
165+ newModel , returnedCmd := model .Update (msg )
166+
167+ if returnedCmd == nil {
166168 t .Error ("Update with spinner.TickMsg should return a command" )
167169 }
168170
You can’t perform that action at this time.
0 commit comments