mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-01-23 02:36:05 +00:00
feat: improve language error handling and adjust test
This commit is contained in:
parent
06bbedf091
commit
4a50cb35cf
2 changed files with 7 additions and 1 deletions
|
|
@ -6,7 +6,9 @@ module.exports = {
|
|||
browser.getLog('browser', (logEntries) => {
|
||||
const errors = logEntries.filter((entry) => entry.level.name === 'SEVERE');
|
||||
if (errors.length > 0) {
|
||||
console.log('\nBROWSER CONSOLE ERRORS:');
|
||||
console.error(errors);
|
||||
console.log('\n');
|
||||
}
|
||||
browser.assert.equal(errors.length, 0, 'No console errors found');
|
||||
}),
|
||||
|
|
|
|||
|
|
@ -34,7 +34,11 @@ export class LanguageService {
|
|||
if (lng && Object.values(LanguageCode).includes(lng)) {
|
||||
this._setFn(lng);
|
||||
} else {
|
||||
console.error('Invalid language code', lng);
|
||||
if (lng) {
|
||||
console.error('Invalid language code', lng);
|
||||
} else {
|
||||
console.warn('No language code provided');
|
||||
}
|
||||
this.setFromBrowserLngIfAutoSwitchLng();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue