test(e2e): nav/child-navs

This commit is contained in:
Daniel Imhoff
2017-03-03 16:27:35 -06:00
parent 1fc1305dd5
commit 3dfaa4c019
14 changed files with 236 additions and 144 deletions

View File

@@ -1,144 +0,0 @@
import { NgModule, Component } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { IonicApp, IonicModule, NavController } from '../../../..';
@Component({
template: `<ion-nav [root]="root"></ion-nav>`,
})
export class E2EApp {
root = LandingPage;
}
@Component({
template: `
<ion-header>
<ion-navbar>
<ion-title>
Landing Page Comp
</ion-title>
</ion-navbar>
</ion-header>
<ion-content>
<button ion-button color="primary" (click)="goToPage()" class="e2eChildNavsNested">
Nested Children Test
</button>
</ion-content>
`
})
export class LandingPage {
constructor(public navCtrl: NavController) {}
goToPage() {
this.navCtrl.push(FirstPage);
}
}
@Component({
template: `
<ion-header>
<ion-navbar>
<ion-title>
First Page Comp
</ion-title>
</ion-navbar>
</ion-header>
<ion-content>
<h3>Sub Header First Page</h3>
<ion-nav [root]="root"></ion-nav>
</ion-content>
`
})
export class FirstPage {
root = SecondPage;
}
@Component({
template: `
<ion-header>
<ion-navbar>
<ion-title>
Second Page Comp
</ion-title>
</ion-navbar>
</ion-header>
<ion-content>
<h3>Sub Header Second Page</h3>
<ion-nav [root]="root"></ion-nav>
</ion-content>
`
})
export class SecondPage {
root = ThirdPage;
}
@Component({
template: `
<ion-header>
<ion-navbar>
<ion-title>
Third Page Comp
</ion-title>
</ion-navbar>
</ion-header>
<ion-content>
<h3>Sub Header Third Page</h3>
<ion-nav [root]="root"></ion-nav>
</ion-content>
`
})
export class ThirdPage {
root = FourthPage;
}
@Component({
template: `
<ion-content>
<ion-list>
<ion-item *ngFor="let item of items">
{{item}}
</ion-item>
</ion-list>
</ion-content>
`
})
export class FourthPage {
items: string[];
ionViewWillEnter() {
let items: string[] = [];
for ( let i = 0 ; i < 500; i++ ) {
items.push(`Item ${(i + 1)}`);
}
this.items = items;
}
}
@NgModule({
declarations: [
E2EApp,
LandingPage,
FirstPage,
SecondPage,
ThirdPage,
FourthPage
],
imports: [
BrowserModule,
IonicModule.forRoot(E2EApp)
],
bootstrap: [IonicApp],
entryComponents: [
E2EApp,
LandingPage,
FirstPage,
SecondPage,
ThirdPage,
FourthPage
]
})
export class AppModule {}

View File

@@ -0,0 +1,8 @@
import { Component } from '@angular/core';
@Component({
template: `<ion-nav [root]="root"></ion-nav>`,
})
export class E2EApp {
root = 'LandingPage';
}

View File

@@ -0,0 +1,28 @@
import { NgModule, Component } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { IonicApp, IonicModule } from '../../../../..';
import { E2EApp } from './app.component';
@NgModule({
declarations: [
E2EApp,
],
imports: [
BrowserModule,
IonicModule.forRoot(E2EApp, {}, {
links: [
{ loadChildren: '../pages/landing-page/landing-page.module#LandingPageModule', name: 'LandingPage' },
{ loadChildren: '../pages/first-page/first-page.module#FirstPageModule', name: 'FirstPage' },
{ loadChildren: '../pages/second-page/second-page.module#SecondPageModule', name: 'SecondPage' },
{ loadChildren: '../pages/third-page/third-page.module#ThirdPageModule', name: 'ThirdPage' },
{ loadChildren: '../pages/fourth-page/fourth-page.module#FourthPageModule', name: 'FourthPage' },
]
})
],
bootstrap: [IonicApp],
entryComponents: [
E2EApp,
]
})
export class AppModule {}

View File

@@ -0,0 +1,17 @@
import { NgModule } from '@angular/core';
import { DeepLinkModule } from '../../../../../..';
import { FirstPage } from './first-page';
@NgModule({
declarations: [
FirstPage,
],
imports: [
DeepLinkModule.forChild(FirstPage)
],
entryComponents: [
FirstPage,
]
})
export class FirstPageModule {}

View File

@@ -0,0 +1,21 @@
import { Component } from '@angular/core';
@Component({
template: `
<ion-header>
<ion-navbar>
<ion-title>
First Page Comp
</ion-title>
</ion-navbar>
</ion-header>
<ion-content>
<h3>Sub Header First Page</h3>
<ion-nav [root]="root"></ion-nav>
</ion-content>
`
})
export class FirstPage {
root = 'SecondPage';
}

View File

@@ -0,0 +1,17 @@
import { NgModule } from '@angular/core';
import { DeepLinkModule } from '../../../../../..';
import { FourthPage } from './fourth-page';
@NgModule({
declarations: [
FourthPage,
],
imports: [
DeepLinkModule.forChild(FourthPage)
],
entryComponents: [
FourthPage,
]
})
export class FourthPageModule {}

View File

@@ -0,0 +1,24 @@
import { Component } from '@angular/core';
@Component({
template: `
<ion-content>
<ion-list>
<ion-item *ngFor="let item of items">
{{item}}
</ion-item>
</ion-list>
</ion-content>
`
})
export class FourthPage {
items: string[];
ionViewWillEnter() {
let items: string[] = [];
for ( let i = 0 ; i < 500; i++ ) {
items.push(`Item ${(i + 1)}`);
}
this.items = items;
}
}

View File

@@ -0,0 +1,17 @@
import { NgModule } from '@angular/core';
import { DeepLinkModule } from '../../../../../..';
import { LandingPage } from './landing-page';
@NgModule({
declarations: [
LandingPage,
],
imports: [
DeepLinkModule.forChild(LandingPage)
],
entryComponents: [
LandingPage,
]
})
export class LandingPageModule {}

View File

@@ -0,0 +1,28 @@
import { Component } from '@angular/core';
import { NavController } from '../../../../../..';
@Component({
template: `
<ion-header>
<ion-navbar>
<ion-title>
Landing Page Comp
</ion-title>
</ion-navbar>
</ion-header>
<ion-content>
<button ion-button color="primary" (click)="goToPage()" class="e2eChildNavsNested">
Nested Children Test
</button>
</ion-content>
`
})
export class LandingPage {
constructor(public navCtrl: NavController) {}
goToPage() {
this.navCtrl.push('FirstPage');
}
}

View File

@@ -0,0 +1,17 @@
import { NgModule } from '@angular/core';
import { DeepLinkModule } from '../../../../../..';
import { SecondPage } from './second-page';
@NgModule({
declarations: [
SecondPage,
],
imports: [
DeepLinkModule.forChild(SecondPage)
],
entryComponents: [
SecondPage,
]
})
export class SecondPageModule {}

View File

@@ -0,0 +1,21 @@
import { Component } from '@angular/core';
@Component({
template: `
<ion-header>
<ion-navbar>
<ion-title>
Second Page Comp
</ion-title>
</ion-navbar>
</ion-header>
<ion-content>
<h3>Sub Header Second Page</h3>
<ion-nav [root]="root"></ion-nav>
</ion-content>
`
})
export class SecondPage {
root = 'ThirdPage';
}

View File

@@ -0,0 +1,17 @@
import { NgModule } from '@angular/core';
import { DeepLinkModule } from '../../../../../..';
import { ThirdPage } from './third-page';
@NgModule({
declarations: [
ThirdPage,
],
imports: [
DeepLinkModule.forChild(ThirdPage)
],
entryComponents: [
ThirdPage,
]
})
export class ThirdPageModule {}

View File

@@ -0,0 +1,21 @@
import { Component } from '@angular/core';
@Component({
template: `
<ion-header>
<ion-navbar>
<ion-title>
Third Page Comp
</ion-title>
</ion-navbar>
</ion-header>
<ion-content>
<h3>Sub Header Third Page</h3>
<ion-nav [root]="root"></ion-nav>
</ion-content>
`
})
export class ThirdPage {
root = 'FourthPage';
}