Say on the Profile page that drafting from the website needs an AI provider
The Draft button is disabled, with a link to Settings → AI provider, until one is set up; the Overview lists the AI provider first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -255,3 +255,15 @@ func TestMCPNeedsTokenAndChecksIn(t *testing.T) {
|
||||
t.Fatalf("checkin not recorded: %+v %v", last, err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestProfileDraftNeedsAI(t *testing.T) {
|
||||
s, h := newTestServer(t, nil)
|
||||
body := do(h, http.MethodGet, "/profile", nil, nil).Body.String()
|
||||
if !strings.Contains(body, `<a href="/settings/ai">choose an AI provider</a>`) || !strings.Contains(body, `class="secondary" disabled>Draft`) {
|
||||
t.Errorf("profile without AI:\n%s", body)
|
||||
}
|
||||
_ = s.Secrets.Set(map[string]string{secrets.AnthropicAPIKey: "k"})
|
||||
if body := do(h, http.MethodGet, "/profile", nil, nil).Body.String(); strings.Contains(body, "choose an AI provider") {
|
||||
t.Error("warning shown with an AI key saved")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user