editor overhaul
This commit is contained in:
@@ -762,3 +762,16 @@ test('route selection reads metadata only and station media is loaded and releas
|
||||
assert.equal(await api.getAppPoi('missing', 0), null);
|
||||
assert.equal(api.get('lazy').pois[0].images[0].url, undefined);
|
||||
});
|
||||
|
||||
test('submission status persists with the server ID and rejects unknown status values', async () => {
|
||||
const { api, localStorage } = await loadLocalRoutes();
|
||||
const id = api.createRouteId();
|
||||
for (const submissionStatus of ['rejected', 'removed', null, 'invalid']) {
|
||||
const expected = submissionStatus === 'invalid' ? null : submissionStatus;
|
||||
api.save({ id, gpx: api.emptyGpx('Waldweg'), route: { name: 'Waldweg', serverRouteId: 42, submissionStatus }, pois: [] });
|
||||
assert.equal(api.get(id).route.submissionStatus, expected);
|
||||
assert.equal(api.get(id).route.serverRouteId, 42);
|
||||
const stored = JSON.parse(localStorage.getItem(`${api.STORAGE_PREFIX}.${encodeURIComponent(id)}.json`));
|
||||
assert.equal(stored.route.submissionStatus, expected);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user