package web
import "testing"
// A REQUIRED CHECK WITH NO RUN ON THE WAY IS NOT A WAIT.
func TestChecksSummarySaysTheMergeIsUntested(t *testing.T) {
l := landingDetail{Required: []string{"test"}, Untested: true}
s := l.ChecksSummary()
if s.State != "stale" || !s.Open {
t.Errorf("FAIL: untested summary State=%q Open=%v, want stale and open", s.State, s.Open)
}
if s.Headline == "" || s.Headline == "Waiting for 1 required check" {
t.Errorf("FAIL: untested headline = %q, must not be the plain wait", s.Headline)
}
plain := landingDetail{Required: []string{"test"}}
if got := plain.ChecksSummary(); got.State != "wait" {
t.Errorf("FAIL: a wait with Untested false has state %q, want wait", got.State)
}
if !t.Failed() {
t.Log("ok")
}
}