M4: split web UI assets into app.css and app.js

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-05-31 21:05:34 -04:00
parent 93e779348c
commit 76816ae188
5 changed files with 248 additions and 217 deletions
+27
View File
@@ -203,6 +203,33 @@ func TestActiveStatePayloadCarriesNudge(t *testing.T) {
}
}
func TestServesStaticAssets(t *testing.T) {
s := newTestServer(t)
r := s.Router()
cases := []struct {
path string
ctSubstr string
}{
{"/app.css", "css"},
{"/app.js", "javascript"},
}
for _, tc := range cases {
req := httptest.NewRequest(http.MethodGet, tc.path, nil)
w := httptest.NewRecorder()
r.ServeHTTP(w, req)
if w.Code != http.StatusOK {
t.Errorf("GET %s code = %d, want 200", tc.path, w.Code)
}
if ct := w.Header().Get("Content-Type"); !strings.Contains(ct, tc.ctSubstr) {
t.Errorf("GET %s Content-Type = %q, want substring %q", tc.path, ct, tc.ctSubstr)
}
if w.Body.Len() == 0 {
t.Errorf("GET %s body is empty", tc.path)
}
}
}
func TestCommitmentCarriesAllowedClassesAndRoutesWork(t *testing.T) {
s := newTestServer(t)
r := s.Router()