fix: style top picks back link as button

This commit is contained in:
2026-06-28 12:52:57 +02:00
parent 44d4b7c342
commit 748c823172
2 changed files with 23 additions and 1 deletions

View File

@@ -140,6 +140,28 @@ func TestTopPicksTemplateDoesNotRenderRecommendationRationale(t *testing.T) {
}
}
func TestTopPicksTemplateStylesBackToHomeAsButton(t *testing.T) {
r, err := ProvideRenderer()
if err != nil {
t.Fatal(err)
}
var buf bytes.Buffer
err = r.ExecuteFragment(&buf, "top_picks.gohtml", "content", map[string]any{
"Animes": []domain.Anime{},
"WatchlistMap": map[int64]bool{},
})
if err != nil {
t.Fatalf("ExecuteFragment error: %v", err)
}
body := buf.String()
want := `href="/" class="inline-flex h-10 items-center justify-center bg-background-button px-4 text-sm font-normal text-foreground transition-colors hover:bg-background-button-hover focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent"`
if !strings.Contains(body, want) {
t.Fatalf("top picks back link should use button styling:\n%s", body)
}
}
func TestAnimeEpisodeCountTemplateDoesNotRenderAvailabilityStatus(t *testing.T) {
r, err := ProvideRenderer()
if err != nil {

View File

@@ -5,7 +5,7 @@
<div class="min-w-0">
<h1 class="text-xl font-normal tracking-[-0.02em] text-foreground">Top Picks for You</h1>
</div>
<a href="/" class="text-sm text-foreground-muted transition-colors hover:text-foreground">Back to Home</a>
<a href="/" class="inline-flex h-10 items-center justify-center bg-background-button px-4 text-sm font-normal text-foreground transition-colors hover:bg-background-button-hover focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent">Back to Home</a>
</div>
{{if eq (len .Animes) 0}}