mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2026-11-15 07:07:07 +00:00
batch of fixes
This commit is contained in:
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' },
|
||||
|
||||
Reference in new issue
Block a user