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

@@ -33,7 +33,7 @@ export interface LifeCycleCount {
}
export async function testLifeCycle(selector: string, expected: LifeCycleCount) {
const page = element(by.css(selector));
expect(await getText(`${selector} #ngOnInit`)).toEqual('1');
expect(await getText(`${selector} #ionViewWillEnter`)).toEqual(expected.ionViewWillEnter.toString());
expect(await getText(`${selector} #ionViewDidEnter`)).toEqual(expected.ionViewDidEnter.toString());
expect(await getText(`${selector} #ionViewWillLeave`)).toEqual(expected.ionViewWillLeave.toString());