Files
website/app/internal/gallery/hero_test.go
jimmy 509e7ccb43 Add Technical Kiwi website with Go, templ, and HTMX.
Single-page site with gallery by album and event, contact form over SMTP,
Docker dev/prod setup, and on-server image derivatives. Gallery photos stay
local (app/images/ is gitignored).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-25 23:57:59 +12:00

23 lines
655 B
Go

package gallery
import "testing"
func TestSelectHero_configured(t *testing.T) {
t.Setenv("HERO_IMAGE", "connectionmachine/20220723_231556.jpg")
images := []Image{
{RelPath: "templeoftechno/IMG_20250817_020719.jpg"},
{RelPath: "connectionmachine/20220723_231556.jpg", HeroURL: "/images/hero/connectionmachine/20220723_231556.jpg"},
}
hero, ok := SelectHero(images)
if !ok || hero.RelPath != "connectionmachine/20220723_231556.jpg" {
t.Fatalf("got %+v ok=%v", hero, ok)
}
}
func TestParseDate_20220723(t *testing.T) {
tm, year := parseDate("20220723_231556.jpg")
if tm.IsZero() || year != 2022 {
t.Fatalf("got %v year=%d", tm, year)
}
}