diff options
| author | Martin Kagamino Lehoux <martin@lehoux.net> | 2026-10-18 21:19:36 +0200 |
|---|---|---|
| committer | Martin Kagamino Lehoux <martin@lehoux.net> | 2026-10-18 21:19:36 +0200 |
| commit | 8a0032d08862dcf28c653bee3fd21052e967e35d (patch) | |
| tree | 6cb0d8efe6f5c2bf9ce9eb3ef8306faecbe7cfeb /web/server_test.go | |
| parent | d575274d00c8da251df29d5d6a636044673944a3 (diff) | |
Cut climb profile sections in the backend
The chart steps are computed in Go and shipped as finished sections, next to
the profile statistics the climb package already owns: climb.ProfileSections
cuts a Route at its widest bends under a ProfilePolicy, and
rideanalysis.MergeClimbProfile takes over the merge that lived in
web/climbs.go, so web only loads the attempt rides and maps the DTOs.
The payload carries sections instead of raw elevations, and the browser keeps
what needs the canvas: slope bands, labels, distance ticks and colours.
official-climb-profile-logic.ts and its tests are gone, replaced by
climb/profile_test.go and a page test reading the embedded profile JSON.
Diffstat (limited to 'web/server_test.go')
| -rw-r--r-- | web/server_test.go | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/web/server_test.go b/web/server_test.go index c468e4b..24ff581 100644 --- a/web/server_test.go +++ b/web/server_test.go @@ -169,7 +169,6 @@ func TestHandlerRendersRideDetailWithEmbeddedRoute(t *testing.T) { assert.Contains(t, body, `class="ride-detail-main"`) assert.Contains(t, body, `<script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"></script>`) assert.Contains(t, body, `<script type="module" src="/static/ride-detail.js"></script>`) - assert.NotContains(t, body, `<script src="/static/official-climb-profile-logic.js"`) assert.NotContains(t, body, `<script src="/static/official-climb-profile.js"`) staticRequest := httptest.NewRequest(http.MethodGet, "/static/ride-detail.js", nil) @@ -197,14 +196,6 @@ func TestHandlerRendersRideDetailWithEmbeddedRoute(t *testing.T) { assert.Equal(t, "text/javascript; charset=utf-8", profileStaticResponse.Header().Get("Content-Type")) assert.NotEmpty(t, profileScript) - logicStaticRequest := httptest.NewRequest(http.MethodGet, "/static/official-climb-profile-logic.js", nil) - logicStaticResponse := httptest.NewRecorder() - server.Handler().ServeHTTP(logicStaticResponse, logicStaticRequest) - - assert.Equal(t, http.StatusOK, logicStaticResponse.Code) - assert.Equal(t, "text/javascript; charset=utf-8", logicStaticResponse.Header().Get("Content-Type")) - assert.NotEmpty(t, logicStaticResponse.Body.String()) - syncStaticRequest := httptest.NewRequest(http.MethodGet, "/static/sync.js", nil) syncStaticResponse := httptest.NewRecorder() server.Handler().ServeHTTP(syncStaticResponse, syncStaticRequest) |
