Files
gooseek/backend/internal/db/learning_repo_test.go
home ab48a0632b
Some checks failed
Build and Deploy GooSeek / build-backend (push) Failing after 1m4s
Build and Deploy GooSeek / build-webui (push) Failing after 1m2s
Build and Deploy GooSeek / deploy (push) Has been skipped
feat: CI/CD pipeline + Learning/Medicine/Travel services
- Add Gitea Actions workflow for automated build & deploy
- Add K8s manifests: webui, travel-svc, medicine-svc, sandbox-svc
- Update kustomization for localhost:5000 registry
- Add ingress for gooseek.ru and api.gooseek.ru
- Learning cabinet with onboarding, courses, sandbox integration
- Medicine service with symptom analysis and doctor matching
- Travel service with itinerary planning
- Server setup scripts (NVIDIA/CUDA, K3s, Gitea runner)

Made-with: Cursor
2026-03-02 20:25:44 +03:00

44 lines
1.0 KiB
Go

package db
import (
"encoding/json"
"testing"
)
func TestNewLearningRepository(t *testing.T) {
pg := &PostgresDB{}
repo := NewLearningRepository(pg)
if repo == nil {
t.Fatalf("expected repository instance")
}
if repo.db != pg {
t.Fatalf("repository must keep provided db pointer")
}
}
func TestLearningUserProfileJSONContract(t *testing.T) {
profile := LearningUserProfile{
UserID: "u-1",
DisplayName: "Alex",
Profile: json.RawMessage(`{"target_track":"backend"}`),
ResumeExtractedText: "resume text",
OnboardingCompleted: true,
}
raw, err := json.Marshal(profile)
if err != nil {
t.Fatalf("marshal profile: %v", err)
}
var decoded map[string]interface{}
if err := json.Unmarshal(raw, &decoded); err != nil {
t.Fatalf("unmarshal profile json: %v", err)
}
if decoded["userId"] != "u-1" {
t.Fatalf("unexpected userId: %v", decoded["userId"])
}
if decoded["onboardingCompleted"] != true {
t.Fatalf("unexpected onboardingCompleted: %v", decoded["onboardingCompleted"])
}
}