Merge pull request #2968 from NoelDeMartin/MOBILE-3833

MOBILE-3833: Expose ngZone service to automated tests
main
Dani Palou 2021-10-05 07:57:57 +02:00 committed by GitHub
commit 1145b3fa52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 5 deletions

View File

@ -12,17 +12,18 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
import { ApplicationRef } from '@angular/core'; import { ApplicationRef, NgZone as NgZoneService } from '@angular/core';
import { CorePushNotifications, CorePushNotificationsProvider } from '@features/pushnotifications/services/pushnotifications'; import { CorePushNotifications, CorePushNotificationsProvider } from '@features/pushnotifications/services/pushnotifications';
import { CoreApp, CoreAppProvider } from '@services/app'; import { CoreApp, CoreAppProvider } from '@services/app';
import { CoreCronDelegate, CoreCronDelegateService } from '@services/cron'; import { CoreCronDelegate, CoreCronDelegateService } from '@services/cron';
import { CoreCustomURLSchemes, CoreCustomURLSchemesProvider } from '@services/urlschemes'; import { CoreCustomURLSchemes, CoreCustomURLSchemesProvider } from '@services/urlschemes';
import { Application } from '@singletons'; import { Application, NgZone } from '@singletons';
type AutomatedTestsWindow = Window & { type AutomatedTestsWindow = Window & {
appRef?: ApplicationRef; appRef?: ApplicationRef;
appProvider?: CoreAppProvider; appProvider?: CoreAppProvider;
cronProvider?: CoreCronDelegateService; cronProvider?: CoreCronDelegateService;
ngZone?: NgZoneService;
pushNotifications?: CorePushNotificationsProvider; pushNotifications?: CorePushNotificationsProvider;
urlSchemes?: CoreCustomURLSchemesProvider; urlSchemes?: CoreCustomURLSchemesProvider;
}; };
@ -31,6 +32,7 @@ function initializeAutomatedTestsWindow(window: AutomatedTestsWindow) {
window.appRef = Application.instance; window.appRef = Application.instance;
window.appProvider = CoreApp.instance; window.appProvider = CoreApp.instance;
window.cronProvider = CoreCronDelegate.instance; window.cronProvider = CoreCronDelegate.instance;
window.ngZone = NgZone.instance;
window.pushNotifications = CorePushNotifications.instance; window.pushNotifications = CorePushNotifications.instance;
window.urlSchemes = CoreCustomURLSchemes.instance; window.urlSchemes = CoreCustomURLSchemes.instance;
} }