summaryrefslogtreecommitdiff
path: root/internal/tui/flamegraph/model_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/tui/flamegraph/model_test.go')
-rw-r--r--internal/tui/flamegraph/model_test.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/internal/tui/flamegraph/model_test.go b/internal/tui/flamegraph/model_test.go
index f83ccff..23c44e1 100644
--- a/internal/tui/flamegraph/model_test.go
+++ b/internal/tui/flamegraph/model_test.go
@@ -1056,6 +1056,22 @@ func TestDataRefreshAnimationConvergesOverTicks(t *testing.T) {
}
}
+func TestAnimationCmdFollowsAnimatingState(t *testing.T) {
+ m := NewModel(nil)
+ if cmd := m.AnimationCmd(); cmd != nil {
+ t.Fatalf("expected no animation command when model is idle")
+ }
+
+ m.animating = true
+ cmd := m.AnimationCmd()
+ if cmd == nil {
+ t.Fatalf("expected animation command when model is animating")
+ }
+ if _, ok := cmd().(animTickMsg); !ok {
+ t.Fatalf("expected animation command to emit animTickMsg")
+ }
+}
+
func TestRebuildKeepsSelectionOnVisibleRowsWhenTruncated(t *testing.T) {
m := NewModel(nil)
m.width = 80