MOBILE-3320 tests: Fix tests
parent
df7c68b07c
commit
62bc96a4df
|
@ -489,14 +489,11 @@ export class CoreAppProvider {
|
||||||
this.ssoAuthenticationDeferred = CoreUtils.instance.promiseDefer<void>();
|
this.ssoAuthenticationDeferred = CoreUtils.instance.promiseDefer<void>();
|
||||||
|
|
||||||
// Resolve it automatically after 10 seconds (it should never take that long).
|
// Resolve it automatically after 10 seconds (it should never take that long).
|
||||||
const cancelTimeout = setTimeout(() => {
|
const cancelTimeout = setTimeout(() => this.finishSSOAuthentication(), 10000);
|
||||||
this.finishSSOAuthentication();
|
|
||||||
}, 10000);
|
|
||||||
|
|
||||||
// If the promise is resolved because finishSSOAuthentication is called, stop the cancel promise.
|
// If the promise is resolved because finishSSOAuthentication is called, stop the cancel promise.
|
||||||
this.ssoAuthenticationDeferred.promise.then(() => {
|
// eslint-disable-next-line promise/catch-or-return
|
||||||
clearTimeout(cancelTimeout);
|
this.ssoAuthenticationDeferred.promise.then(() => clearTimeout(cancelTimeout));
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -248,8 +248,7 @@ export class CoreLangProvider {
|
||||||
return language;
|
return language;
|
||||||
}).catch(() =>
|
}).catch(() =>
|
||||||
// Error getting locale. Use default language.
|
// Error getting locale. Use default language.
|
||||||
this.defaultLanguage,
|
this.defaultLanguage);
|
||||||
);
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// Error getting locale. Use default language.
|
// Error getting locale. Use default language.
|
||||||
return Promise.resolve(this.defaultLanguage);
|
return Promise.resolve(this.defaultLanguage);
|
||||||
|
@ -339,8 +338,8 @@ export class CoreLangProvider {
|
||||||
|
|
||||||
// Convert old keys format to new one.
|
// Convert old keys format to new one.
|
||||||
const key = values[0].replace(/^mm\.core/, 'core').replace(/^mm\./, 'core.').replace(/^mma\./, 'addon.')
|
const key = values[0].replace(/^mm\.core/, 'core').replace(/^mm\./, 'core.').replace(/^mma\./, 'addon.')
|
||||||
.replace(/^core\.sidemenu/, 'core.mainmenu').replace(/^addon\.grades/, 'core.grades')
|
.replace(/^core\.sidemenu/, 'core.mainmenu').replace(/^addon\.grades/, 'core.grades')
|
||||||
.replace(/^addon\.participants/, 'core.user');
|
.replace(/^addon\.participants/, 'core.user');
|
||||||
|
|
||||||
this.loadString(this.customStrings, lang, key, values[1]);
|
this.loadString(this.customStrings, lang, key, values[1]);
|
||||||
});
|
});
|
||||||
|
|
|
@ -6,8 +6,8 @@
|
||||||
"cordova-plugin-file-transfer",
|
"cordova-plugin-file-transfer",
|
||||||
"cordova-plugin-inappbrowser",
|
"cordova-plugin-inappbrowser",
|
||||||
"cordova",
|
"cordova",
|
||||||
"node",
|
"dom-mediacapture-record",
|
||||||
"dom-mediacapture-record"
|
"node"
|
||||||
],
|
],
|
||||||
"paths": {
|
"paths": {
|
||||||
"@/*": ["*"],
|
"@/*": ["*"],
|
||||||
|
|
|
@ -21,9 +21,9 @@
|
||||||
"cordova-plugin-file-transfer",
|
"cordova-plugin-file-transfer",
|
||||||
"cordova-plugin-inappbrowser",
|
"cordova-plugin-inappbrowser",
|
||||||
"cordova",
|
"cordova",
|
||||||
|
"dom-mediacapture-record",
|
||||||
"jest",
|
"jest",
|
||||||
"node",
|
"node"
|
||||||
"dom-mediacapture-record"
|
|
||||||
],
|
],
|
||||||
"paths": {
|
"paths": {
|
||||||
"@/*": ["*"],
|
"@/*": ["*"],
|
||||||
|
|
|
@ -1,14 +1,15 @@
|
||||||
{
|
{
|
||||||
"extends": "./tsconfig.json",
|
"extends": "./tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"outDir": "./out-tsc/tests",
|
||||||
"allowJs": true,
|
"allowJs": true,
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"emitDecoratorMetadata": true,
|
"emitDecoratorMetadata": true,
|
||||||
"outDir": "./out-tsc/tests",
|
|
||||||
"types": [
|
"types": [
|
||||||
"cordova-plugin-file-transfer",
|
"cordova-plugin-file-transfer",
|
||||||
"cordova-plugin-inappbrowser",
|
"cordova-plugin-inappbrowser",
|
||||||
"cordova",
|
"cordova",
|
||||||
|
"dom-mediacapture-record",
|
||||||
"jest",
|
"jest",
|
||||||
"node"
|
"node"
|
||||||
],
|
],
|
||||||
|
@ -31,8 +32,7 @@
|
||||||
"src/polyfills.ts"
|
"src/polyfills.ts"
|
||||||
],
|
],
|
||||||
"include": [
|
"include": [
|
||||||
"src/**/*.test.ts",
|
"src/**/*.ts",
|
||||||
"src/**/*.d.ts",
|
"src/**/*.d.ts"
|
||||||
"src/tests/**/*.ts"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue