Files
pipelines/internal/server/notify_summary_test.go
T
alan 815f7c2a5a Stage notifications: no empty "()" and say what a waiting stage needs
A waiting human stage has no outcome yet, so its notification read
"… · waiting ()". The outcome is now shown only when recorded, and a
waiting stage reads "waiting for your decision".
2026-11-02 15:47:06 +00:00

17 lines
600 B
Go

package server
import "testing"
func TestStageNotificationSummaryOmitsEmptyOutcome(t *testing.T) {
cases := []struct{ event, outcome, want string }{
{"waiting", "", "Demo · run #229 · stage Feedback · waiting for your decision"},
{"failed", "error", "Demo · run #229 · stage Feedback · failed (error)"},
{"succeeded", " ", "Demo · run #229 · stage Feedback · succeeded"},
}
for _, c := range cases {
if got := stageNotificationSummary("Demo", 229, "Feedback", c.event, c.outcome); got != c.want {
t.Errorf("%s/%q: got %q, want %q", c.event, c.outcome, got, c.want)
}
}
}