Skip to content
quarry Artifact [408c3d988d]
Login

Artifact [408c3d988d]

Artifact 408c3d988d3f50db7bcd402a85c3c84d8a7e2cc1873e90d166d5c96ca0fc16a1:


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