summaryrefslogtreecommitdiff
path: root/internal/tui/flamegraph/model_test.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-03-10 07:50:47 +0200
committerPaul Buetow <paul@buetow.org>2026-03-10 07:50:47 +0200
commitea56e858a0b2194f540b9bf7523b9fbf4691863b (patch)
tree4c933a0ab9cd108c93e481d3ca033f2d3122f125 /internal/tui/flamegraph/model_test.go
parent599c1bd9331960e92dee72feff11e67d5f76c3df (diff)
tui/flamegraph: centralize animation tick scheduling (task 422)
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