require_relative "test_helper" require "tempfile" class AppTest < Minitest::Test include AppTestHelper def test_health response = request.get("/api/health") assert_equal 200, response.status assert_equal({ "status" => "ok", "revision" => "dev" }, json_body(response)) end def test_index_renders_with_asset_versioning_and_importmap response = request.get("/") assert_equal 200, response.status assert_match(/\/js\/map\.js\?v=\d+/, response.body) assert_includes response.body, "importmap" assert_includes response.body, "livetrack-panel" end # Every public/js/*.js module map.js (or something it imports) can reach # needs its own versioned importmap entry (views/layout.erb) or it skips # ASSET_VERSION's whole cache-busting story — easy to forget when adding a # new module, since the app still works fine locally either way (a plain # unmapped import just resolves straight to the unversioned file). # map.js itself is excluded: it's the one entry point loaded directly by # its own