package web
import (
"strings"
"testing"
)
// The page says what size means. A mark whose area encodes something,
// on a page that never explains it, reads as decoration: each of the
// time axes carries exactly one key sentence under its picture.
func TestThePageExplainsTheSizeCode(t *testing.T) {
draw := func(axis string) string {
var buf strings.Builder
err := noHooks.template(activityPage).ExecuteTemplate(&buf, "act-view", pageData{
Repo: "alpha",
Activity: &activityView{
Axis: axis, Win: "recent", Grain: "week",
Since: "2026-09-01", Until: "2026-09-03", Window: "recent",
},
})
if err != nil {
t.Fatal(err)
}
return buf.String()
}
for _, axis := range []string{"clock", "tree", "people"} {
if n := strings.Count(draw(axis), `class="act-key"`); n != 1 {
t.Errorf("FAIL: the %s axis carries %d key sentences, want one", axis, n)
}
}
t.Log("ok")
}