Skip to content
quarry Artifact [722b357a3f]
Login

Artifact [722b357a3f]

Artifact 722b357a3f9ca8383c56d111e208d5b4e51082736baf2a67340b1639ab5b4477:


package web

import (
	"strings"
	"testing"
)

// An empty list under a filter says the filter matched nothing and
// offers to clear it, rather than reading as an empty tracker.
func TestAnEmptyFilteredTicketListNamesItsFilter(t *testing.T) {
	var buf strings.Builder
	d := pageData{Title: "Tickets", Repo: "quarry",
		Nav: ticketNav{Repo: "quarry", State: "open", Title: "7777"}}
	if err := noHooks.template(ticketListPage).ExecuteTemplate(&buf, "tkt-view", d); err != nil {
		t.Fatal(err)
	}
	body := buf.String()
	if !strings.Contains(body, `data-hook="ticket-none-filtered"`) || !strings.Contains(body, "7777") {
		t.Errorf("FAIL: the empty filtered list does not name its filter: %s", body)
	}
	t.Log("ok")
}