Get activity title from uploaded file, if it is present (#7)

* Use activity title from GPX file when present

* Extend test

* Test shortening of long names

* Extract constant

---------

Co-authored-by: Niklas Deutschmann <sonstharmlos@noreply.codeberg.org>
This commit is contained in:
Niklas 2026-04-13 10:12:38 +02:00 committed by GitHub
parent 6afd7a5dad
commit 03b8e6d315
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 56 additions and 15 deletions

View file

@ -112,6 +112,10 @@ class GpxParserIntegrationTest {
// Verify at least some basic data
assertNotNull(parsedData.getActivityType(), "Activity type should be determined");
String parsedTitle = parsedData.getTitle();
assertEquals(255, parsedTitle.length());
assertTrue(parsedTitle.startsWith("Einmal Frust loswerden"));
assertFalse(parsedTitle.contains("Shouldn't appear"));
assertEquals(Activity.ActivityType.RUN, parsedData.getActivityType(),
"Activity type should be RUN (from GPX <type>running</type>)");
assertTrue(parsedData.getTrackPoints().size() > 0, "Should have at least one track point");