This commit is contained in:
@@ -44,6 +44,15 @@ func TestExtractEnvatoPreviewFromHydration(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestCollectEnvatoPreviewURLFindsOgVideo(t *testing.T) {
|
||||
html := `<meta property="og:video" content="https://video-previews.elements.envatousercontent.com/example/watermarked_preview/watermarked_preview.mp4">`
|
||||
got := collectEnvatoPreviewURL(html, "", "", "")
|
||||
want := "https://video-previews.elements.envatousercontent.com/example/watermarked_preview/watermarked_preview.mp4"
|
||||
if got != want {
|
||||
t.Fatalf("expected %q, got %q", want, got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestIsUsefulGoogleVideoResultRejectsMusicResults(t *testing.T) {
|
||||
result := SearchResult{
|
||||
Title: "Couple Friendly Sad Bgm Movie Best Bgm",
|
||||
@@ -109,6 +118,22 @@ func TestIsMatchingArtgridClipPageRejectsHomepage(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestIsMatchingArtgridClipPageAcceptsBodySignals(t *testing.T) {
|
||||
html := `<html><head><title>Night City | Stock Video Footage - Artgrid.io</title></head><body><script>window.__clip="6600269";</script></body></html>`
|
||||
if !isMatchingArtgridClipPage(html, "6600269") {
|
||||
t.Fatal("expected body/title signal Artgrid HTML to be accepted")
|
||||
}
|
||||
}
|
||||
|
||||
func TestLowValueThumbnailDetection(t *testing.T) {
|
||||
if !IsLowValueThumbnail("https://example.com/favicon.ico") {
|
||||
t.Fatal("expected favicon to be low-value thumbnail")
|
||||
}
|
||||
if IsLowValueThumbnail("https://i.ytimg.com/vi/abcd1234xyz/hqdefault.jpg") {
|
||||
t.Fatal("expected youtube thumbnail to be usable")
|
||||
}
|
||||
}
|
||||
|
||||
func TestGeminiCandidateLimitNeverExceedsCandidates(t *testing.T) {
|
||||
if got := GeminiCandidateLimit(9); got != 9 {
|
||||
t.Fatalf("expected Gemini limit to stay within candidate count, got %d", got)
|
||||
|
||||
Reference in New Issue
Block a user