From e1db269cd1339f0caddb4f150c2a2dde84dbdf6d Mon Sep 17 00:00:00 2001 From: Noel De Martin Date: Wed, 18 Nov 2020 13:17:30 +0100 Subject: [PATCH] MOBILE-3320 tests: Fix silent errors --- src/app/app.component.test.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/app/app.component.test.ts b/src/app/app.component.test.ts index 9036f4b7b..b495748b6 100644 --- a/src/app/app.component.test.ts +++ b/src/app/app.component.test.ts @@ -12,13 +12,15 @@ // See the License for the specific language governing permissions and // limitations under the License. +import { Observable } from 'rxjs'; import { NavController } from '@ionic/angular'; import { AppComponent } from '@app/app.component'; import { CoreEvents } from '@singletons/events'; import { CoreLangProvider } from '@services/lang'; +import { Network, Platform, NgZone } from '@singletons/core.singletons'; -import { mock, renderComponent, RenderConfig } from '@/tests/utils'; +import { mock, mockSingleton, renderComponent, RenderConfig } from '@/tests/utils'; describe('AppComponent', () => { @@ -27,6 +29,10 @@ describe('AppComponent', () => { let config: Partial; beforeEach(() => { + mockSingleton(Network, { onChange: () => new Observable() }); + mockSingleton(Platform, { ready: () => Promise.resolve() }); + mockSingleton(NgZone, { run: jest.fn() }); + langProvider = mock(['clearCustomStrings']); navController = mock(['navigateRoot']); config = {