26 lines
1003 B
Go
26 lines
1003 B
Go
package handlers
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"ai-media-hub/backend/services"
|
|
)
|
|
|
|
func TestShouldWarnPartialSearchDoesNotWarnForCompletedSearch(t *testing.T) {
|
|
if shouldWarnPartialSearch(services.SearchExecutionMeta{}, services.GeminiBatchStats{}, false, "") {
|
|
t.Fatal("expected no warning when search completed without deadline limits")
|
|
}
|
|
}
|
|
|
|
func TestShouldWarnPartialSearchWarnsWhenDeadlineLimited(t *testing.T) {
|
|
if !shouldWarnPartialSearch(services.SearchExecutionMeta{PartialDueToDeadline: true}, services.GeminiBatchStats{}, false, "") {
|
|
t.Fatal("expected warning when search collection was deadline limited")
|
|
}
|
|
if !shouldWarnPartialSearch(services.SearchExecutionMeta{}, services.GeminiBatchStats{DeadlineLimited: true}, false, "") {
|
|
t.Fatal("expected warning when gemini stage was deadline limited")
|
|
}
|
|
if !shouldWarnPartialSearch(services.SearchExecutionMeta{}, services.GeminiBatchStats{}, true, "") {
|
|
t.Fatal("expected warning when supplemental exploration was deadline limited")
|
|
}
|
|
}
|