add ui
CI / Test + coverage (push) Successful in 1m15s

This commit is contained in:
2026-09-19 06:49:28 -09:00
parent 0e3ea5a714
commit a46428a757
20 changed files with 529 additions and 30 deletions
+11 -3
View File
@@ -12,13 +12,21 @@
(handler {:request-method method :uri uri :headers {}}))
(deftest root-test
(let [resp (request :get "/")]
(let [resp (request :get "/")
body (slurp (:body resp))]
(is (= 200 (:status resp)))
(is (= "text/plain; charset=utf-8" (get-in resp [:headers "Content-Type"])))
(is (re-find #"/api-docs" (:body resp))))
(is (= "text/html; charset=utf-8" (get-in resp [:headers "Content-Type"])))
(testing "serves the HTML shell that mounts the re-frame UI"
(is (re-find #"<div id=\"app\"" body))
(is (re-find #"<script src=\"/js/main\.js\"" body))))
(testing "HEAD is served like GET, without a body"
(is (= 200 (:status (request :head "/"))))))
(deftest js-assets-test
;; main.js only exists once script/ui-build has run, so only the miss is asserted here;
;; the integration suite (which runs against the built image) checks the hit.
(is (= 404 (:status (request :get "/js/nope.js")))))
(deftest swagger-spec-test
(let [resp (request :get "/swagger.json")]
(is (= 200 (:status resp)))