diff options
| author | Martin Kagamino Lehoux <martin@lehoux.net> | 2026-08-11 14:19:01 +0200 |
|---|---|---|
| committer | Martin Kagamino Lehoux <martin@lehoux.net> | 2026-08-11 14:19:01 +0200 |
| commit | 7d13374eec8c33c4e14cc5b0c3de36e4f620ce0e (patch) | |
| tree | 98a20ee73f34863ddb5938aa5eb29346e4a5db56 /strava/sync_test.go | |
| parent | 1da94931188c35c06dd032aadce2799fc13db1dd (diff) | |
fix: Continue Strava import after invalid activities
Diffstat (limited to 'strava/sync_test.go')
| -rw-r--r-- | strava/sync_test.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/strava/sync_test.go b/strava/sync_test.go index f810206..c55f97b 100644 --- a/strava/sync_test.go +++ b/strava/sync_test.go @@ -112,3 +112,23 @@ func TestGet(t *testing.T) { require.True(t, found) assert.Equal(t, 0.0, powerValue) } + +func TestGetRejectsActivityWithoutTrackPoints(t *testing.T) { + client := newTestClient(t, func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json") + switch r.URL.Path { + case "/activities/14701658670": + _, err := w.Write([]byte(`{"id":14701658670,"name":"Empty activity","type":"Ride","sport_type":"Ride","start_date":"2026-01-01T10:00:00Z"}`)) + require.NoError(t, err) + case "/activities/14701658670/streams": + _, err := w.Write([]byte(`{"latlng":{"data":[]}}`)) + require.NoError(t, err) + default: + http.NotFound(w, r) + } + }) + + _, _, err := client.Get(14701658670) + + require.EqualError(t, err, "activity has no track points") +} |