Fix sidebar repaint and command restart navigation
This commit is contained in:
@@ -125,6 +125,15 @@ func TestSidebarNavListIncludesProcessesAboveAgentTree(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestSidebarNavListIncludesExitedProcesses(t *testing.T) {
|
||||
p := testProcess("p1", "shell", StatusExited)
|
||||
r := testAgent("a1", "claude", "", StatusRunning)
|
||||
flat := sidebarNavList([]*Child{p, r}, "a1")
|
||||
if len(flat) != 2 || flat[0].ID != "p1" || flat[1].ID != "a1" {
|
||||
t.Fatalf("flat = %v, want exited process then active agent", childIDs(flat))
|
||||
}
|
||||
}
|
||||
|
||||
func TestNextChildIDWalksProcessesThenAgentTree(t *testing.T) {
|
||||
p1 := testProcess("p1", "bun", StatusRunning)
|
||||
r := testAgent("a1", "claude", "", StatusRunning)
|
||||
@@ -140,6 +149,13 @@ func TestNextChildIDWalksProcessesThenAgentTree(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestNextChildIDCanEnterSingleExitedProcessFromNoFocus(t *testing.T) {
|
||||
p := testProcess("p1", "shell", StatusExited)
|
||||
if got := nextChildID([]*Child{p}, "", "", +1); got != "p1" {
|
||||
t.Fatalf("empty focus -> exited process: %q want p1", got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestVisibleAgentTreeExcludesTopLevelCommands(t *testing.T) {
|
||||
p := testProcess("p1", "bun", StatusRunning)
|
||||
r := testAgent("a1", "claude", "", StatusRunning)
|
||||
|
||||
Reference in New Issue
Block a user