batch of fixes

This commit is contained in:
vcoppe committed 2026-11-04 21:27:14 +01:00
1 parent a67b982b1c
commit eee76f05d4
9 files changed
+288 -66

No files matched your search

@@ -95,6 +95,21 @@ describe('legacyFileToGPX', () => {
assert.ok(gpx.includes('href="https://example.com/?a="1"&b=2"'));
});
it('writes all the links of an element', () => {
const links = [
{ attributes: { href: 'https://a.example/' }, text: 'first' },
{ attributes: { href: 'https://b.example/' } },
];
const gpx = legacyFileToGPX({
metadata: { name: 'x', link: links },
trk: [{ link: links, trkseg: [] }],
});
const written =
'<link href="https://a.example/"><text>first</text></link><link href="https://b.example/"></link>';
assert.ok(gpx.includes(`<name>x</name>${written}</metadata>`));
assert.ok(gpx.includes(`<trk>${written}</trk>`));
});
it('leaves out what is missing or empty', () => {
const gpx = legacyFileToGPX({
metadata: { name: '', desc: null, time: 'not a date' },