Inventory is now the Market
Everything the user sees says Market: the sidebar, titles, breadcrumbs, help text, messages, suggestions and the agent tool's description; the export downloads as supermarket-market.yaml. Its pages live under /market, and the old /inventory addresses redirect there (308, so a form's POST stays a POST). The YAML format (inventory:), the database and the code's names are unchanged, so exported files still import. A breadcrumb no longer repeats the page's own title. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+10
-10
@@ -95,8 +95,8 @@ func TestEveryPageRenders(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
for _, path := range []string{"/", "/?msg=saved", "/settings/profile", "/inventory", "/inventory?relationship=partner",
|
||||
"/inventory/new", "/inventory/1", "/inventory/import", "/inventory/export",
|
||||
for _, path := range []string{"/", "/?msg=saved", "/settings/profile", "/market", "/market?relationship=partner",
|
||||
"/market/new", "/market/1", "/market/import", "/market/export",
|
||||
"/settings/ai", "/settings/accounts", "/settings/core", "/static/app.css", "/favicon.ico", "/static/favicon.png", "/static/logo.png", "/static/apple-touch-icon.png", "/search", "/crm", "/search?q=rival", "/search?q=nothing+here", "/static/htmx.min.js", "/healthz",
|
||||
"/content", "/content/1", "/content/1?dismissed=1", "/posts", "/posts?msg=drafted",
|
||||
"/content/scheduled", "/content/published",
|
||||
@@ -107,7 +107,7 @@ func TestEveryPageRenders(t *testing.T) {
|
||||
t.Errorf("core=%v GET %s: %d %s", c != nil, path, rec.Code, rec.Body.String())
|
||||
}
|
||||
}
|
||||
if rec := do(h, http.MethodGet, "/inventory/999", nil, nil); rec.Code != http.StatusNotFound {
|
||||
if rec := do(h, http.MethodGet, "/market/999", nil, nil); rec.Code != http.StatusNotFound {
|
||||
t.Errorf("missing entry: %d", rec.Code)
|
||||
}
|
||||
}
|
||||
@@ -179,7 +179,7 @@ func TestProfileAndInventoryForms(t *testing.T) {
|
||||
}
|
||||
|
||||
entry := url.Values{"name": {"Rival"}, "relationship": {"competitor"}, "hashtags": {"rival, #Other"}, "twitter_handle": {"@rival"}}
|
||||
if rec := postForm(h, "/inventory/save", entry); rec.Code != http.StatusSeeOther {
|
||||
if rec := postForm(h, "/market/save", entry); rec.Code != http.StatusSeeOther {
|
||||
t.Fatalf("save entry: %d %s", rec.Code, rec.Body.String())
|
||||
}
|
||||
entries, _ := inventory.List(s.DB, "competitor")
|
||||
@@ -188,12 +188,12 @@ func TestProfileAndInventoryForms(t *testing.T) {
|
||||
t.Fatalf("entry: %+v", entries)
|
||||
}
|
||||
// Same name, different case: refused.
|
||||
rec = postForm(h, "/inventory/save", url.Values{"name": {"RIVAL"}, "relationship": {"partner"}})
|
||||
rec = postForm(h, "/market/save", url.Values{"name": {"RIVAL"}, "relationship": {"partner"}})
|
||||
if rec.Code != http.StatusOK || !strings.Contains(rec.Body.String(), "already has that name") {
|
||||
t.Errorf("duplicate: %d", rec.Code)
|
||||
}
|
||||
|
||||
rec = postForm(h, "/inventory/import", url.Values{"example": {"federated"}, "relationship": {"watch"}})
|
||||
rec = postForm(h, "/market/import", url.Values{"example": {"federated"}, "relationship": {"watch"}})
|
||||
if rec.Code != http.StatusOK || !strings.Contains(rec.Body.String(), "21 added") {
|
||||
t.Errorf("import example: %d %s", rec.Code, rec.Body.String())
|
||||
}
|
||||
@@ -202,7 +202,7 @@ func TestProfileAndInventoryForms(t *testing.T) {
|
||||
t.Errorf("example entries are partners: got %d", len(partners))
|
||||
}
|
||||
|
||||
if rec := postForm(h, "/inventory/1/delete", nil); rec.Code != http.StatusSeeOther {
|
||||
if rec := postForm(h, "/market/1/delete", nil); rec.Code != http.StatusSeeOther {
|
||||
t.Errorf("delete: %d", rec.Code)
|
||||
}
|
||||
}
|
||||
@@ -384,17 +384,17 @@ 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>`) {
|
||||
if body := do(h, http.MethodGet, "/market/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"},
|
||||
rec := postForm(h, "/market/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"}})
|
||||
rec = postForm(h, "/market/fill", url.Values{"name": {"Rival"}})
|
||||
if !strings.Contains(rec.Body.String(), "Enter their website") {
|
||||
t.Error("fill without a website: no message")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user