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:
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user