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>
23 lines
655 B
Go
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)
|
|
}
|
|
}
|