815f7c2a5a
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".
17 lines
600 B
Go
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)
|
|
}
|
|
}
|
|
}
|