This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
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")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user