gitgram/aitimemachine/beads/cmd/bd/onboard_test.go
caelum0x 49b183818c Unify gitgram + aitimemachine into the monorepo (de-submodule) and merge vendored engines
Convert gitgram/ and aitimemachine/ from embedded git repos (which showed as
opaque submodule gitlinks on GitHub) into fully-tracked first-party content.

AITM now merges its 7 vendored repos as first-party engines:
- memory: beads (Go task DAG) + context7 (docs SDK), unified into saved_contexts
- git: vendored C git (bundled binary) + gitnexus (in-process code intelligence)
- agentic: a2a (@a2a-js/sdk) + pal (AITM-managed Python subprocess)

Includes the full session's product build: Gitgram web/mobile/backend features,
AITM website/CLI/MCP, the unified memory layer, engine build tooling
(scripts/build-engines.sh, Dockerfile, CI), docs (README, ENGINES.md, ARCHITECTURE.md),
and extensive test suites.

Build artifacts, node_modules, external/, and gemini-cli are gitignored.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23 14:14:09 +03:00

70 lines
2.2 KiB
Go

package main
import (
"bytes"
"strings"
"testing"
)
func TestOnboardCommand(t *testing.T) {
t.Run("onboard output contains key sections", func(t *testing.T) {
var buf bytes.Buffer
if err := renderOnboardInstructions(&buf); err != nil {
t.Fatalf("renderOnboardInstructions() error = %v", err)
}
output := buf.String()
// Verify output contains expected sections
expectedSections := []string{
"bd Onboarding",
"AGENTS.md",
"BEGIN AGENTS.MD CONTENT",
"END AGENTS.MD CONTENT",
"bd prime",
"How it works",
}
for _, section := range expectedSections {
if !strings.Contains(output, section) {
t.Errorf("Expected output to contain '%s', but it was missing", section)
}
}
})
t.Run("agents content is minimal and points to bd prime", func(t *testing.T) {
// Verify the agentsContent constant is minimal and points to bd prime
if !strings.Contains(agentsContent, "bd prime") {
t.Error("agentsContent should point to 'bd prime' for full workflow")
}
if !strings.Contains(agentsContent, "bd ready") {
t.Error("agentsContent should include quick reference to 'bd ready'")
}
if !strings.Contains(agentsContent, "bd create") {
t.Error("agentsContent should include quick reference to 'bd create'")
}
if !strings.Contains(agentsContent, "bd close") {
t.Error("agentsContent should include quick reference to 'bd close'")
}
if !strings.Contains(agentsContent, "bd dolt push") {
t.Error("agentsContent should include quick reference to 'bd dolt push'")
}
// Verify it's actually minimal (less than 500 chars)
if len(agentsContent) > 500 {
t.Errorf("agentsContent should be minimal (<500 chars), got %d chars", len(agentsContent))
}
})
t.Run("copilot instructions content is minimal", func(t *testing.T) {
// Verify copilotInstructionsContent is also minimal
if !strings.Contains(copilotInstructionsContent, "bd prime") {
t.Error("copilotInstructionsContent should point to 'bd prime'")
}
// Verify it's minimal (less than 500 chars)
if len(copilotInstructionsContent) > 500 {
t.Errorf("copilotInstructionsContent should be minimal (<500 chars), got %d chars", len(copilotInstructionsContent))
}
})
}