feat: add diagnostic web app shell

This commit is contained in:
user
2026-04-26 18:39:09 +09:00
parent 3493f8b5a5
commit ce38189f33
15 changed files with 763 additions and 9 deletions

View File

@@ -0,0 +1,36 @@
package webapp
import (
"net/http"
"net/http/httptest"
"strings"
"testing"
)
func TestHandlerServesIndex(t *testing.T) {
req := httptest.NewRequest(http.MethodGet, "/", nil)
rec := httptest.NewRecorder()
Handler().ServeHTTP(rec, req)
if rec.Code != http.StatusOK {
t.Fatalf("status = %d", rec.Code)
}
if !strings.Contains(rec.Body.String(), "Interview practice") {
t.Fatal("expected app shell content")
}
}
func TestHandlerServesAsset(t *testing.T) {
req := httptest.NewRequest(http.MethodGet, "/assets/app.js", nil)
rec := httptest.NewRecorder()
Handler().ServeHTTP(rec, req)
if rec.Code != http.StatusOK {
t.Fatalf("status = %d", rec.Code)
}
if !strings.Contains(rec.Body.String(), "diagnostic-sessions") {
t.Fatal("expected app script content")
}
}