overhaul gpx creation and usage
Sonarqube Scanner / Prepare environment (push) Successful in 8s
Sonarqube Scanner / Build and test (push) Failing after 22s
Sonarqube Scanner / SonarQube analysis (push) Skipped
Sonarqube Scanner / Deploy to Server (push) Successful in 6s

This commit is contained in:
Florian Zumpe
2026-10-03 12:40:26 +02:00
parent 1cb3977269
commit 171ea88d55
29 changed files with 969 additions and 344 deletions
+20
View File
@@ -8,6 +8,26 @@ import { localizeHtml } from '../scripts/localize-html.js';
const root = path.resolve(import.meta.dirname, '..');
test('German legal pages and contacts remain static when the app uses English', async () => {
const context = { navigator: { language: 'en-GB' } };
const i18n = await loadI18n(context);
const html = await fs.readFile(path.join(root, 'public/index.html'), 'utf8');
const englishHtml = localizeHtml(html, key => i18n.t(key));
for (const name of ['privacy', 'imprint']) {
const pattern = new RegExp(`<article[^>]+data-info-page="${name}"[^>]*>[\\s\\S]*?</article>`);
const page = pattern.exec(html)?.[0];
assert.ok(page, name);
assert.match(page, /lang="de"/);
assert.doesNotMatch(page, /data-i18n/);
assert.equal(pattern.exec(englishHtml)?.[0], page);
}
for (const catalog of context.Wegwichtel.TextCatalogs.values()) {
for (const key of ['privacy', 'imprint', 'contacts']) {
assert.equal(Object.hasOwn(catalog, key), false, key);
}
}
});
test('checked-in HTML has synchronized German defaults and accessible headings, labels and links before scripts load', async () => {
const i18n = await loadI18n({});
const html = await fs.readFile(path.join(root, 'public/index.html'), 'utf8');