Skip to content

Commit d909560

Browse files
fixing issue with test not returning
1 parent 174a990 commit d909560

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

cmd/card/imageviewer_test.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
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) {
155156
func 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

0 commit comments

Comments
 (0)