test(angular): add tests for ngOnInit

This commit is contained in:
Manu Mtz.-Almeida
2018-12-05 21:22:26 +01:00
committed by Manu MA
parent c8d9685bc9
commit 7698c31790
8 changed files with 30 additions and 9 deletions

View File

@@ -1,14 +1,15 @@
import { Component, Input, NgZone } from '@angular/core';
import { Component, Input, NgZone, OnInit } from '@angular/core';
import { ModalController } from '@ionic/angular';
@Component({
selector: 'app-modal-example',
templateUrl: './modal-example.component.html',
})
export class ModalExampleComponent {
export class ModalExampleComponent implements OnInit {
@Input() value: string;
onInit = 0;
willEnter = 0;
didEnter = 0;
willLeave = 0;
@@ -18,6 +19,11 @@ export class ModalExampleComponent {
private modalCtrl: ModalController
) {}
ngOnInit() {
NgZone.assertInAngularZone();
this.onInit++;
}
ionViewWillEnter() {
NgZone.assertInAngularZone();
this.willEnter++;