allow update for uploaded routes and implement creator id for routes
Sonarqube Scanner / Prepare environment (push) Successful in 8s
Sonarqube Scanner / Build and test (push) Successful in 21s
Sonarqube Scanner / SonarQube analysis (push) Failing after 1m3s
Sonarqube Scanner / Deploy to Server (push) Successful in 6s

This commit is contained in:
Florian Zumpe
2026-10-03 16:43:08 +02:00
parent 4b8bdcad5f
commit 0db91660b3
20 changed files with 423 additions and 91 deletions
+31
View File
@@ -214,6 +214,37 @@ assert result['ok'] is True
assert.doesNotMatch(downloadedGpx.toString(), /<trkpt /);
assert.deepEqual(parseGpx(downloadedGpx.toString()).points, parseGpx(gpx.toString()).points);
assert.equal(route.creator_id, null);
const creatorId = 'a'.repeat(64);
const { body: assigned } = await requestJson(`${baseUrl}/api/routes/${route.id}`, {
method: 'PUT', headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ creator_id: creatorId })
});
assert.equal(assigned.creator_id, creatorId);
await requestJson(`${baseUrl}/api/routes/${route.id}`, {
method: 'PUT', headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ creator_id: 'b'.repeat(64) })
}, 409);
await requestJson(`${baseUrl}/api/routes/${route.id}`, {
method: 'PUT', headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ creator_id: 'bad' })
}, 400);
const { body: preserved } = await requestJson(`${baseUrl}/api/routes/${route.id}`, {
method: 'PUT', headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ description: 'Ersteller bleibt erhalten' })
});
assert.equal(preserved.creator_id, creatorId);
const createWithIdentity = new FormData();
createWithIdentity.append('name', 'Ersteller-Test');
createWithIdentity.append('creator_id', creatorId);
createWithIdentity.append('gpx', new Blob([gpx], { type: 'application/gpx+xml' }), 'route.gpx');
const { body: ownedRoute } = await requestJson(`${baseUrl}/api/routes`, { method: 'POST', body: createWithIdentity }, 201);
assert.equal(ownedRoute.creator_id, creatorId);
const invalidIdentity = new FormData();
invalidIdentity.append('creator_id', 'invalid');
invalidIdentity.append('gpx', new Blob([gpx], { type: 'application/gpx+xml' }), 'route.gpx');
await requestJson(`${baseUrl}/api/routes`, { method: 'POST', body: invalidIdentity }, 400);
const { body: pendingPoi } = await requestJson(`${baseUrl}/api/routes/${route.id}/pois`, {
method: 'POST', headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ title: 'Ohne Empfang', lat: null, lon: null })