MOBILE-3320 tests: Fix silent errors

main
Noel De Martin 2020-11-18 13:17:30 +01:00
parent 85507d75fb
commit e1db269cd1
1 changed files with 7 additions and 1 deletions

View File

@ -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<RenderConfig>;
beforeEach(() => {
mockSingleton(Network, { onChange: () => new Observable() });
mockSingleton(Platform, { ready: () => Promise.resolve() });
mockSingleton(NgZone, { run: jest.fn() });
langProvider = mock<CoreLangProvider>(['clearCustomStrings']);
navController = mock<NavController>(['navigateRoot']);
config = {