Skip to content
quarry Artifact [b71d335fe6]
Login

Artifact [b71d335fe6]

Artifact b71d335fe6753e29bec4fc977050d6f948c4d81650388d58115c37660a8f6c0d:


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")
	}
}