Files
ai-resume/internal/site/platforms_test.go
Paperclip Builder 59580b6e45 site: publish the platform guides at /platforms/ and link them from an About page
(cherry picked from commit 408d6cdfd76d13945db1d9727b58feca23d1e48b)
2026-10-28 15:55:36 +11:00

43 lines
953 B
Go

package site
import (
"os"
"path/filepath"
"strings"
"testing"
)
func TestRenderPlatformsShowsTheGuides(t *testing.T) {
root, err := filepath.Abs(filepath.Join("..", ".."))
if err != nil {
t.Fatal(err)
}
out := t.TempDir()
count, err := RenderPlatforms(root, out)
if err != nil {
t.Fatalf("RenderPlatforms: %v", err)
}
if count != 3 {
t.Fatalf("got %d guides, want 3", count)
}
raw, err := os.ReadFile(filepath.Join(out, "platforms", "index.html"))
if err != nil {
t.Fatalf("read page: %v", err)
}
page := strings.ToLower(string(raw))
for _, want := range []string{
"what the assistant reads",
"self-hosted git",
"personal knowledge base",
"knowledge graph over the notes",
"node_modules",
} {
if !strings.Contains(page, want) {
t.Errorf("page does not contain %q", want)
}
}
if _, err := os.Stat(filepath.Join(out, "platforms", "index.json")); err != nil {
t.Errorf("index.json missing: %v", err)
}
}