26 lines
960 B
Go
26 lines
960 B
Go
package tui
|
|
|
|
import (
|
|
"strings"
|
|
"testing"
|
|
|
|
"git.a-wan.net/alan/pipelines/internal/protocol"
|
|
)
|
|
|
|
func TestExportWaitRendersRecoveryNotHumanDecision(t *testing.T) {
|
|
run := &protocol.RunDetail{RunSummary: protocol.RunSummary{ID: 7, Status: "waiting", ExportPendingSequence: 2, CurrentStage: "worker"}, Graph: protocol.Graph{Stages: []protocol.Stage{{Key: "worker", Type: "model", Edges: map[string]string{"success": "next", "error": "#failure"}}}}}
|
|
frame := strings.Join(waitingLines(run), "\n")
|
|
if !strings.Contains(frame, "Waiting for session export") || strings.Contains(frame, "person") || strings.Contains(frame, "Decide:") {
|
|
t.Fatalf("export wait offered a human choice:\n%s", frame)
|
|
}
|
|
m := Model{runDetail: run}
|
|
_, options, _ := m.waitingStage()
|
|
if len(options) != 0 {
|
|
t.Fatal("model-stage edges exposed as human options")
|
|
}
|
|
updated, _ := m.openDecision()
|
|
if updated.(Model).decisionOpen {
|
|
t.Fatal("opened decision for export wait")
|
|
}
|
|
}
|