package httpd import ( "strings" "testing" "gitbay.org/gitbay/internal/control" "gitbay.org/gitbay/internal/store" "gitbay.org/gitbay/internal/web" ) // The dashboard is three columns: pinned repositories with counts, the // tile strip and queue rows, the activity feed. Tiles carry every queue's // count; only a non-empty queue lists rows (desktop layout spec). func TestDashboardTilesAndPins(t *testing.T) { var sb strings.Builder var base basePage base.Viewer = "alice" err := web.Render(&sb, "dashboard.html", struct { basePage Tab string Pins []pinnedRow Reviews []store.DashboardItem Assigned []store.DashboardItem MRs []store.DashboardItem Issues []store.DashboardItem Feed []control.FeedLine }{base, "dashboard", []pinnedRow{ {Owner: "krz", Name: "gitbay", Issues: 3, MRs: 0, Build: "success"}, {Owner: "krz", Name: "old", Build: "cancelled"}, }, nil, nil, nil, []store.DashboardItem{{RepoPath: "krz/gitbay", Number: 1, Title: "one", Author: "alice", State: "open"}}, nil}) if err != nil { t.Fatal(err) } out := sb.String() for _, want := range []string{ `