chore: remove old and unused code
This commit is contained in:
57
tui_test.go
57
tui_test.go
@@ -919,6 +919,63 @@ func TestPullRequestAIPreparationFailureIgnoresOldDiscussionThread(t *testing.T)
|
||||
}
|
||||
}
|
||||
|
||||
func TestAIStaleOperationMessagesAreIgnored(t *testing.T) {
|
||||
m := NewApp(nil, "o", "r", false, 50, time.Second)
|
||||
m.aiGeneration = 2
|
||||
m.aiMode = aiBusy
|
||||
m.aiProgress = AIRunProgress{Stage: "current run"}
|
||||
|
||||
updated, command, handled := m.updateAI(aiProgressMsg{
|
||||
generation: 1, progress: AIRunProgress{Stage: "stale run"},
|
||||
})
|
||||
m = updated.(App)
|
||||
if !handled || command != nil || m.aiProgress.Stage != "current run" {
|
||||
t.Fatalf("stale progress handled=%v command=%v progress=%q",
|
||||
handled, command, m.aiProgress.Stage)
|
||||
}
|
||||
|
||||
updated, command, handled = m.updateAI(aiCompletedMsg{generation: 1})
|
||||
m = updated.(App)
|
||||
if !handled || command != nil || m.aiMode != aiBusy {
|
||||
t.Fatalf("stale completion handled=%v command=%v mode=%v",
|
||||
handled, command, m.aiMode)
|
||||
}
|
||||
|
||||
m.aiMode = aiPreparing
|
||||
updated, command, handled = m.updateAI(aiPreparedMsg{generation: 1})
|
||||
m = updated.(App)
|
||||
if !handled || command != nil || m.aiMode != aiPreparing {
|
||||
t.Fatalf("stale preparation handled=%v command=%v mode=%v",
|
||||
handled, command, m.aiMode)
|
||||
}
|
||||
}
|
||||
|
||||
func TestPREditStaleRecommendationMessagesAreIgnored(t *testing.T) {
|
||||
m := NewApp(nil, "o", "r", false, 50, time.Second)
|
||||
m.details = PRDetails{PullRequest: PullRequest{Owner: "o", Repository: "r"}}
|
||||
m.writeMode = writePREdit
|
||||
m.prEditGeneration = 2
|
||||
m.prEditBranches = []RepositoryBranch{{Name: "current"}}
|
||||
|
||||
updated, command := m.Update(branchesLoadedMsg{
|
||||
generation: 1, owner: "o", repo: "r",
|
||||
branches: []RepositoryBranch{{Name: "stale"}},
|
||||
})
|
||||
m = updated.(App)
|
||||
if command != nil || len(m.prEditBranches) != 1 || m.prEditBranches[0].Name != "current" {
|
||||
t.Fatalf("stale branches command=%v branches=%#v", command, m.prEditBranches)
|
||||
}
|
||||
|
||||
updated, command = m.Update(branchesLoadedMsg{
|
||||
generation: 2, owner: "o", repo: "r",
|
||||
branches: []RepositoryBranch{{Name: "accepted"}},
|
||||
})
|
||||
m = updated.(App)
|
||||
if command != nil || len(m.prEditBranches) != 1 || m.prEditBranches[0].Name != "accepted" {
|
||||
t.Fatalf("current branches command=%v branches=%#v", command, m.prEditBranches)
|
||||
}
|
||||
}
|
||||
|
||||
func TestVimModeUsesGlobalFooterBar(t *testing.T) {
|
||||
m := NewApp(nil, "o", "r", false, 50, time.Second)
|
||||
m.width, m.height = 80, 10
|
||||
|
||||
Reference in New Issue
Block a user