feat: add diagnostic web app shell
This commit is contained in:
@@ -50,3 +50,28 @@ func TestHealth(t *testing.T) {
|
||||
t.Fatalf("body.ModelKey = %q", body.ModelKey)
|
||||
}
|
||||
}
|
||||
|
||||
func TestWebAppRoute(t *testing.T) {
|
||||
cfg := config.Config{
|
||||
Environment: "test",
|
||||
ModelKey: "deepseek-v4-flash",
|
||||
}
|
||||
memory := learnermemory.NewService(learnermemory.NewMemoryStore())
|
||||
service := interview.NewService(interview.NewMemoryStore(), workflows.NewStubRunner(), memory)
|
||||
progress := progression.NewService(memory)
|
||||
onto := ontology.NewService(ontology.NewMemoryStore())
|
||||
assets := teachingassets.NewService(teachingassets.NewMemoryStore(), onto, cfg.ImageModelKey)
|
||||
handler := NewHandler(cfg, service, memory, progress, onto, assets)
|
||||
|
||||
req := httptest.NewRequest(http.MethodGet, "/", nil)
|
||||
rec := httptest.NewRecorder()
|
||||
|
||||
handler.Routes().ServeHTTP(rec, req)
|
||||
|
||||
if rec.Code != http.StatusOK {
|
||||
t.Fatalf("status = %d, want %d", rec.Code, http.StatusOK)
|
||||
}
|
||||
if rec.Header().Get("Content-Type") != "text/html; charset=utf-8" {
|
||||
t.Fatalf("content-type = %q", rec.Header().Get("Content-Type"))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user