Fill in an inventory entry's empty boxes from its website
On the entry form, "Fill in the empty boxes" reads their website. Links, social accounts and feeds come straight from the pages (no guessing); the AI drafts the name if missing, a description, keywords, hashtags, and talking points set against the company profile for the relationship chosen. Typed values stay, nothing is saved until Save, and the form says which boxes were filled. Website reading moves from the profile draft into internal/site, shared by both, and now also collects links and declared RSS/Atom feeds (comment feeds skipped; Fill takes up to three). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -327,6 +327,24 @@ func TestMCPNeedsTokenAndChecksIn(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestInventoryFillNeedsAI(t *testing.T) {
|
||||
_, h := newTestServer(t, nil)
|
||||
if body := do(h, http.MethodGet, "/inventory/new", nil, nil).Body.String(); !strings.Contains(body, `<a href="/settings/ai">set up the AI</a>`) {
|
||||
t.Error("new entry without AI: no warning")
|
||||
}
|
||||
// The form comes back with what was typed, and says why.
|
||||
rec := postForm(h, "/inventory/fill", url.Values{"name": {"Rival"}, "relationship": {"competitor"},
|
||||
"description": {"Typed."}, "draft_url": {"https://rival.example"}})
|
||||
body := rec.Body.String()
|
||||
if rec.Code != http.StatusOK || !strings.Contains(body, "AI provider not configured") || !strings.Contains(body, "Typed.") {
|
||||
t.Errorf("fill without AI: %d", rec.Code)
|
||||
}
|
||||
rec = postForm(h, "/inventory/fill", url.Values{"name": {"Rival"}})
|
||||
if !strings.Contains(rec.Body.String(), "Enter their website") {
|
||||
t.Error("fill without a website: no message")
|
||||
}
|
||||
}
|
||||
|
||||
func TestProfileDraftNeedsAI(t *testing.T) {
|
||||
s, h := newTestServer(t, nil)
|
||||
body := do(h, http.MethodGet, "/settings/profile", nil, nil).Body.String()
|
||||
|
||||
Reference in New Issue
Block a user