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".
This commit is contained in:
2026-11-02 15:47:06 +00:00
parent 1c8680393e
commit 815f7c2a5a
2 changed files with 31 additions and 1 deletions
+16
View File
@@ -0,0 +1,16 @@
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)
}
}
}