fix sonar findings and translation structure
This commit is contained in:
@@ -47,3 +47,14 @@ test('public help and spoken labels omit implementation terms and preserve meani
|
||||
assert.match(text, /Fortschritt.*gelöscht/s);
|
||||
assert.match(text, /Meine Entwürfe/);
|
||||
});
|
||||
|
||||
test('English errors keep translated validation hints and hide technical replies', async () => {
|
||||
const context = { navigator: { language: 'en-GB' } };
|
||||
await loadI18n(context);
|
||||
vm.runInNewContext(await fs.readFile(path.join(root, 'public/js/user-messages.js'), 'utf8'), context);
|
||||
const { I18n, UserMessages } = context.Wegwichtel;
|
||||
assert.equal(UserMessages.error(new Error(I18n.t('editor.error.route-name'))), 'Give your trail a name.');
|
||||
assert.equal(UserMessages.error({ status: 413 }), 'This file is too large. Choose a smaller file.');
|
||||
assert.match(UserMessages.error({ message: 'Die GPX-Datei ist kein gültiges XML.' }), /readable path/);
|
||||
assert.equal(UserMessages.error(new Error('Failed to fetch')), 'That did not work. Please try again.');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user