verae-mcp-timestamping-serv.../internal/tools/welcome_test.go
George Lambert 3ec1f0516b
Some checks failed
test-and-deploy / test (push) Failing after 12m55s
test-and-deploy / deploy-138 (push) Has been cancelled
feat(mcp): optional receipt_format on stamp/verify (text/PDF/JSON/MD/CSV/TSV)
Add receipt_format to stamp and verify. Omitted → text; receipt|PDF-Receipt → PDF;
JSON-Receipt → JSON; MD|MD-Receipt; CSV|CSV-Receipt; TSV|TSV-Receipt.

Stamp always returns receipts[] and adds artifacts[] in the chosen format.
Stdio writes ~/.verae/receipts (0600); public MCP returns content_text/content_base64 only.
Verify accepts inline receipt or receipt_path (stdio), parses id, and re-emits an artifact.

Vendors pdfcert (+ slim statuslang, gofpdf) for CERT-01 PDF. Also lands welcome tool
and email-username helpers already wired into register/public paths.
2026-10-20 16:02:20 -04:00

36 lines
942 B
Go

package tools
import (
"context"
"strings"
"testing"
)
func TestWelcomeMessageMentionsSignupLogin(t *testing.T) {
t.Parallel()
for _, want := range []string{"Welcome to Verae", "signup", "login", "access_token", "digest"} {
if !strings.Contains(welcomeMessage, want) {
t.Fatalf("welcomeMessage missing %q", want)
}
}
for _, want := range []string{"Welcome to Verae", "signup", "login", "tool welcome"} {
if !strings.Contains(instructions, want) {
t.Fatalf("instructions missing %q", want)
}
}
}
func TestWelcomeTool(t *testing.T) {
t.Parallel()
d := &Deps{}
_, out, err := d.welcome(context.Background(), nil, EmptyArgs{})
if err != nil {
t.Fatal(err)
}
if out.Title != "Welcome to Verae" || !strings.Contains(strings.ToLower(out.Message), "timestamp") {
t.Fatalf("unexpected welcome: %+v", out)
}
if len(out.NextSteps) < 3 || out.HasAccount == "" {
t.Fatalf("next_steps/ask incomplete: %+v", out)
}
}