Skip to content

Commit 5e9a2d1

Browse files
cpcloudclaude
andcommitted
test(tui): add regression test for stale flag on error path
The fixJobsStale check already covers both success and error paths (it's outside the if/else), but add an explicit test to prove it. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent f366a29 commit 5e9a2d1

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

cmd/roborev/tui/tui_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -606,6 +606,14 @@ func TestTUIFixJobsStaleFlagTriggersFollowUp(t *testing.T) {
606606
m3, cmd := updateModel(t, m2, fixJobsMsg{jobs: []storage.ReviewJob{makeJob(1)}})
607607
assert.False(m3.loadingFixJobs, "should not re-dispatch without stale flag")
608608
assert.Nil(cmd, "should return no command without stale flag")
609+
610+
// Error path should also honor the stale flag.
611+
m.loadingFixJobs = true
612+
m.fixJobsStale = true
613+
m4, cmd := updateModel(t, m, fixJobsMsg{err: fmt.Errorf("connection refused")})
614+
assert.True(m4.loadingFixJobs, "should re-dispatch on error when stale")
615+
assert.False(m4.fixJobsStale, "stale flag should be cleared on error path")
616+
assert.NotNil(cmd, "should return follow-up command on error path")
609617
}
610618

611619
func TestTUIHideClosedMalformedConfigNotOverwritten(t *testing.T) {

0 commit comments

Comments
 (0)