fix refresh
This commit is contained in:
@@ -10,9 +10,9 @@ import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func checkOpenRouterPreview(t *testing.T, a *App, s State, auth <-chan string, key string) {
|
||||
func checkOpenRouterPreview(t *testing.T, a *App, auth <-chan string, key string) {
|
||||
t.Helper()
|
||||
p, err := runPreview(t, a, PreviewRequest{Revision: s.Revision, From: "2026-09-01", To: "2026-09-30", Model: "test/model", Fields: Fields{Category: true}})
|
||||
p, err := runPreview(t, a, PreviewRequest{From: "2026-09-01", To: "2026-09-30", Model: "test/model", Fields: Fields{Category: true}})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -68,7 +68,7 @@ func TestOpenRouterKeyRotationChangesProviderAuthorization(t *testing.T) {
|
||||
if strings.Contains(string(encoded), "private-key") {
|
||||
t.Fatal("saved credential leaked into browser state")
|
||||
}
|
||||
checkOpenRouterPreview(t, a, s, auth, key)
|
||||
checkOpenRouterPreview(t, a, auth, key)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ func TestOpenRouterSavedKeyAndDisableSurviveRestartOverrideEnvironment(t *testin
|
||||
}
|
||||
})
|
||||
reopen()
|
||||
checkOpenRouterPreview(t, a, s, auth, "environment-private-key")
|
||||
checkOpenRouterPreview(t, a, auth, "environment-private-key")
|
||||
for _, key := range []string{"saved-private-key", ""} {
|
||||
var err error
|
||||
s, err = a.SaveOpenRouterKey(context.Background(), key)
|
||||
@@ -119,7 +119,7 @@ func TestOpenRouterSavedKeyAndDisableSurviveRestartOverrideEnvironment(t *testin
|
||||
if s.Status.AIConfigured != (key != "") {
|
||||
t.Fatal("restarted credential status ignored saved preference")
|
||||
}
|
||||
checkOpenRouterPreview(t, a, s, auth, key)
|
||||
checkOpenRouterPreview(t, a, auth, key)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -187,7 +187,7 @@ func TestOpenRouterRejectedKeysPreserveActiveCredential(t *testing.T) {
|
||||
}
|
||||
})
|
||||
}
|
||||
checkOpenRouterPreview(t, a, s, auth, key)
|
||||
checkOpenRouterPreview(t, a, auth, key)
|
||||
}
|
||||
|
||||
func TestOpenRouterFailedWritePreservesActiveCredential(t *testing.T) {
|
||||
@@ -216,5 +216,5 @@ func TestOpenRouterFailedWritePreservesActiveCredential(t *testing.T) {
|
||||
t.Fatal("persistence error leaked credential content")
|
||||
}
|
||||
}
|
||||
checkOpenRouterPreview(t, a, s, auth, "active-private-key")
|
||||
checkOpenRouterPreview(t, a, auth, "active-private-key")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user