@@ -69,12 +69,12 @@ export class E2EPage {
`
})
-class AnotherPage {
- form: ControlGroup;
+export class AnotherPage {
+ form: any;
constructor(public navCtrl: NavController, public alertCtrl: AlertController, public loadingCtrl: LoadingController, public builder: FormBuilder) {
this.form = builder.group({
- name: builder.control('', Validators.compose([
+ firstName: builder.control('', Validators.compose([
Validators.required,
Validators.minLength(5)
]))
@@ -169,8 +169,23 @@ class AnotherPage {
@Component({
template: '
'
})
-class E2EApp {
+export class E2EApp {
root = E2EPage;
}
-ionicBootstrap(E2EApp);
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage,
+ AnotherPage
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EPage,
+ AnotherPage
+ ]
+})
+export class AppModule {}
diff --git a/src/components/app/test/animations/index.ts b/src/components/app/test/animations/app-module.ts
similarity index 68%
rename from src/components/app/test/animations/index.ts
rename to src/components/app/test/animations/app-module.ts
index 2687c1e00f..f1ed06c7a5 100644
--- a/src/components/app/test/animations/index.ts
+++ b/src/components/app/test/animations/app-module.ts
@@ -1,11 +1,11 @@
-import { Component } from '@angular/core';
-import { ionicBootstrap, Config, Animation } from '../../../../../src';
+import { Component, NgModule } from '@angular/core';
+import { IonicApp, IonicModule, Config, Animation } from '../../../..';
@Component({
templateUrl: 'main.html'
})
-class E2EPage {
+export class E2EPage {
duration: string;
easing: string;
@@ -19,7 +19,7 @@ class E2EPage {
playGreen() {
let a = new Animation('.green');
a.fromTo('translateX', '0px', '200px');
- a.duration(parseInt(this.duration));
+ a.duration(parseInt(this.duration, 10));
a.easing(this.easing);
a.play();
}
@@ -39,7 +39,7 @@ class E2EPage {
let a = new Animation('.green');
a.fromTo('translateX', '0px', '200px');
- a.duration(parseInt(self.duration));
+ a.duration(parseInt(self.duration, 10));
a.easing(self.easing);
a.onFinish((animation: Animation) => {
setTimeout(() => {
@@ -58,10 +58,22 @@ class E2EPage {
@Component({
template: '
'
})
-class E2EApp {
+export class E2EApp {
root = E2EPage;
}
-ionicBootstrap(E2EApp, null, {
- prodMode: true
-});
+
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EPage
+ ]
+})
+export class AppModule {}
diff --git a/src/components/app/test/app.spec.ts b/src/components/app/test/app.spec.ts
index 4a429bf55f..40012e6002 100644
--- a/src/components/app/test/app.spec.ts
+++ b/src/components/app/test/app.spec.ts
@@ -1,8 +1,9 @@
-import { Component } from '@angular/core';
-import { App, Config, Nav, NavOptions, Platform, Tab, Tabs, ViewController } from '../../../../src';
-import { mockNavController, mockTab, mockTabs } from '../../../../src/util/mock-providers';
+import { App } from '../app';
+import { Config } from '../../../config/config';
+import { mockApp, mockConfig, mockNavController, mockPlatform, mockTab, mockTabs, mockView, mockViews } from '../../../util/mock-providers';
+import { OverlayPortal } from '../../nav/overlay-portal';
+import { Platform } from '../../../platform/platform';
-export function run() {
describe('App', () => {
@@ -10,9 +11,7 @@ describe('App', () => {
it('should select the previous tab', () => {
let nav = mockNavController();
- let portal = mockNavController();
- app.setPortal(portal);
- app.setRootNav(nav);
+ app._setRootNav(nav);
let tabs = mockTabs();
let tab1 = mockTab(tabs);
@@ -22,7 +21,7 @@ describe('App', () => {
tabs.select(tab1);
tabs.select(tab2);
- expect(tabs.selectHistory).toEqual([tab1.id, tab2.id]);
+ expect(tabs._selectHistory).toEqual([tab1.id, tab2.id]);
spyOn(platform, 'exitApp');
spyOn(tabs, 'select');
@@ -41,14 +40,12 @@ describe('App', () => {
it('should pop from the active tab, when tabs is nested is the root nav', () => {
let nav = mockNavController();
- let portal = mockNavController();
- app.setPortal(portal);
- app.setRootNav(nav);
+ app._setRootNav(nav);
let tabs = mockTabs();
- let tab1 = mockTab(tabs);
+ mockTab(tabs);
let tab2 = mockTab(tabs);
- let tab3 = mockTab(tabs);
+ mockTab(tabs);
nav.registerChildNav(tabs);
tab2.setSelected(true);
@@ -57,8 +54,8 @@ describe('App', () => {
spyOn(tab2, 'pop');
spyOn(portal, 'pop');
- let view1 = new ViewController();
- let view2 = new ViewController();
+ let view1 = mockView();
+ let view2 = mockView();
tab2._views = [view1, view2];
app.navPop();
@@ -70,18 +67,18 @@ describe('App', () => {
it('should pop from the active tab, when tabs is the root', () => {
let tabs = mockTabs();
- let tab1 = mockTab(tabs);
+ mockTab(tabs);
let tab2 = mockTab(tabs);
- let tab3 = mockTab(tabs);
- app.setRootNav(tabs);
+ mockTab(tabs);
+ app._setRootNav(tabs);
tab2.setSelected(true);
spyOn(platform, 'exitApp');
spyOn(tab2, 'pop');
- let view1 = new ViewController();
- let view2 = new ViewController();
+ let view1 = mockView();
+ let view2 = mockView();
tab2._views = [view1, view2];
app.navPop();
@@ -93,23 +90,21 @@ describe('App', () => {
it('should pop the root nav when nested nav has less than 2 views', () => {
let rootNav = mockNavController();
let nestedNav = mockNavController();
- let portal = mockNavController();
- app.setPortal(portal);
rootNav.registerChildNav(nestedNav);
nestedNav.parent = rootNav;
- app.setRootNav(rootNav);
+ app._setRootNav(rootNav);
spyOn(platform, 'exitApp');
spyOn(rootNav, 'pop');
spyOn(nestedNav, 'pop');
spyOn(portal, 'pop');
- let rootView1 = new ViewController();
- let rootView2 = new ViewController();
- rootNav._views = [rootView1, rootView2];
+ let rootView1 = mockView();
+ let rootView2 = mockView();
+ mockViews(rootNav, [rootView1, rootView2]);
- let nestedView1 = new ViewController();
- nestedNav._views = [nestedView1];
+ let nestedView1 = mockView();
+ mockViews(nestedNav, [nestedView1]);
app.navPop();
@@ -122,9 +117,7 @@ describe('App', () => {
it('should pop a view from the nested nav that has more than 1 view', () => {
let rootNav = mockNavController();
let nestedNav = mockNavController();
- let portal = mockNavController();
- app.setPortal(portal);
- app.setRootNav(rootNav);
+ app._setRootNav(rootNav);
rootNav.registerChildNav(nestedNav);
spyOn(platform, 'exitApp');
@@ -132,13 +125,13 @@ describe('App', () => {
spyOn(nestedNav, 'pop');
spyOn(portal, 'pop');
- let rootView1 = new ViewController();
- let rootView2 = new ViewController();
- rootNav._views = [rootView1, rootView2];
+ let rootView1 = mockView();
+ let rootView2 = mockView();
+ mockViews(rootNav, [rootView1, rootView2]);
- let nestedView1 = new ViewController();
- let nestedView2 = new ViewController();
- nestedNav._views = [nestedView1, nestedView2];
+ let nestedView1 = mockView();
+ let nestedView2 = mockView();
+ mockViews(nestedNav, [nestedView1, nestedView2]);
app.navPop();
@@ -150,20 +143,18 @@ describe('App', () => {
it('should pop the overlay in the portal of the root nav', () => {
let nav = mockNavController();
- let portal = mockNavController();
- app.setPortal(portal);
- app.setRootNav(nav);
+ app._setRootNav(nav);
spyOn(platform, 'exitApp');
spyOn(nav, 'pop');
spyOn(portal, 'pop');
- let view1 = new ViewController();
- let view2 = new ViewController();
- nav._views = [view1, view2];
+ let view1 = mockView();
+ let view2 = mockView();
+ mockViews(nav, [view1, view2]);
- let overlay = new ViewController();
- portal._views = [overlay];
+ let overlay1 = mockView();
+ mockViews(portal, [overlay1]);
app.navPop();
@@ -174,17 +165,15 @@ describe('App', () => {
it('should pop the second view in the root nav', () => {
let nav = mockNavController();
- let portal = mockNavController();
- app.setPortal(portal);
- app.setRootNav(nav);
+ app._setRootNav(nav);
spyOn(platform, 'exitApp');
spyOn(nav, 'pop');
spyOn(portal, 'pop');
- let view1 = new ViewController();
- let view2 = new ViewController();
- nav._views = [view1, view2];
+ let view1 = mockView();
+ let view2 = mockView();
+ mockViews(nav, [view1, view2]);
app.navPop();
@@ -195,16 +184,14 @@ describe('App', () => {
it('should exit app when only one view in the root nav', () => {
let nav = mockNavController();
- let portal = mockNavController();
- app.setPortal(portal);
- app.setRootNav(nav);
+ app._setRootNav(nav);
spyOn(platform, 'exitApp');
spyOn(nav, 'pop');
spyOn(portal, 'pop');
- let view1 = new ViewController();
- nav._views = [view1];
+ let view1 = mockView();
+ mockViews(nav, [view1]);
expect(app.getActiveNav()).toBe(nav);
expect(nav.first()).toBe(view1);
@@ -218,9 +205,7 @@ describe('App', () => {
it('should not exit app when only one view in the root nav, but navExitApp config set', () => {
let nav = mockNavController();
- let portal = mockNavController();
- app.setPortal(portal);
- app.setRootNav(nav);
+ app._setRootNav(nav);
spyOn(platform, 'exitApp');
spyOn(nav, 'pop');
@@ -228,8 +213,8 @@ describe('App', () => {
config.set('navExitApp', false);
- let view1 = new ViewController();
- nav._views = [view1];
+ let view1 = mockView();
+ mockViews(nav, [view1]);
expect(app.getActiveNav()).toBe(nav);
expect(nav.first()).toBe(view1);
@@ -243,16 +228,14 @@ describe('App', () => {
it('should not go back if app is not enabled', () => {
let nav = mockNavController();
- let portal = mockNavController();
- app.setPortal(portal);
- app.setRootNav(nav);
+ app._setRootNav(nav);
spyOn(platform, 'exitApp');
spyOn(nav, 'pop');
spyOn(portal, 'pop');
- let view1 = new ViewController();
- nav._views = [view1];
+ let view1 = mockView();
+ mockViews(nav, [view1]);
app.setEnabled(false, 10000);
@@ -277,7 +260,7 @@ describe('App', () => {
it('should get active NavController when using tabs with nested nav', () => {
let nav = mockNavController();
- app.setRootNav(nav);
+ app._setRootNav(nav);
let tabs = mockTabs();
let tab1 = mockTab(tabs);
@@ -297,10 +280,10 @@ describe('App', () => {
it('should get active NavController when using tabs, nested in a root nav', () => {
let nav = mockNavController();
- app.setRootNav(nav);
+ app._setRootNav(nav);
let tabs = mockTabs();
- let tab1 = mockTab(tabs);
+ mockTab(tabs);
let tab2 = mockTab(tabs);
let tab3 = mockTab(tabs);
nav.registerChildNav(tabs);
@@ -316,10 +299,10 @@ describe('App', () => {
it('should get active tab NavController when using tabs, and tabs is the root', () => {
let tabs = mockTabs();
- let tab1 = mockTab(tabs);
+ mockTab(tabs);
let tab2 = mockTab(tabs);
let tab3 = mockTab(tabs);
- app.setRootNav(tabs);
+ app._setRootNav(tabs);
tab2.setSelected(true);
@@ -334,7 +317,7 @@ describe('App', () => {
let nav1 = mockNavController();
let nav2 = mockNavController();
let nav3 = mockNavController();
- app.setRootNav(nav1);
+ app._setRootNav(nav1);
nav1.registerChildNav(nav2);
nav2.registerChildNav(nav3);
@@ -345,7 +328,7 @@ describe('App', () => {
it('should get active NavController when nested 2 deep', () => {
let nav1 = mockNavController();
let nav2 = mockNavController();
- app.setRootNav(nav1);
+ app._setRootNav(nav1);
nav1.registerChildNav(nav2);
expect(app.getActiveNav()).toBe(nav2);
@@ -353,13 +336,13 @@ describe('App', () => {
it('should get active NavController when only one nav controller', () => {
let nav = mockNavController();
- app.setRootNav(nav);
+ app._setRootNav(nav);
expect(app.getActiveNav()).toBe(nav);
});
it('should set/get the root nav controller', () => {
let nav = mockNavController();
- app.setRootNav(nav);
+ app._setRootNav(nav);
expect(app.getRootNav()).toBe(nav);
});
@@ -378,7 +361,7 @@ describe('App', () => {
spyOn(mockClickBlock, 'activate');
- app.clickBlock = mockClickBlock;
+ app._clickBlock = mockClickBlock;
// act
app.setEnabled(true);
@@ -395,7 +378,7 @@ describe('App', () => {
spyOn(mockClickBlock, 'activate');
- app.clickBlock = mockClickBlock;
+ app._clickBlock = mockClickBlock;
// act
app.setEnabled(false, 20);
@@ -412,7 +395,7 @@ describe('App', () => {
spyOn(mockClickBlock, 'activate');
- app.clickBlock = mockClickBlock;
+ app._clickBlock = mockClickBlock;
// act
app.setEnabled(false, 200);
@@ -429,7 +412,7 @@ describe('App', () => {
spyOn(mockClickBlock, 'activate');
- app.clickBlock = mockClickBlock;
+ app._clickBlock = mockClickBlock;
// act
app.setEnabled(false);
@@ -443,13 +426,13 @@ describe('App', () => {
var app: App;
var config: Config;
var platform: Platform;
+ var portal: OverlayPortal;
beforeEach(() => {
- config = new Config();
- platform = new Platform();
- app = new App(config, platform);
+ config = mockConfig();
+ platform = mockPlatform();
+ app = mockApp(config, platform);
+ portal = app._appRoot._getPortal();
});
});
-
-}
diff --git a/src/components/app/test/cordova/index.ts b/src/components/app/test/cordova/app-module.ts
similarity index 77%
rename from src/components/app/test/cordova/index.ts
rename to src/components/app/test/cordova/app-module.ts
index d0352a99ec..d55f195c91 100644
--- a/src/components/app/test/cordova/index.ts
+++ b/src/components/app/test/cordova/app-module.ts
@@ -1,5 +1,5 @@
-import { Component } from '@angular/core';
-import { ionicBootstrap, NavController, ModalController, ViewController } from '../../../../../src';
+import { Component, NgModule } from '@angular/core';
+import { IonicApp, IonicModule, NavController, ModalController, ViewController } from '../../../..';
import { Injectable } from '@angular/core';
@@ -44,7 +44,7 @@ export class OtherData {
`
})
-class MyModal {
+export class MyModal {
constructor(public viewCtrl: ViewController) {}
dismissModal() {
@@ -56,7 +56,7 @@ class MyModal {
@Component({
templateUrl: 'page1.html'
})
-class Page1 {
+export class Page1 {
page2 = Page2;
sort: string = 'all';
@@ -74,7 +74,7 @@ class Page1 {
@Component({
templateUrl: 'page2.html'
})
-class Page2 {
+export class Page2 {
page1 = Page1;
page3 = Page3;
@@ -89,7 +89,7 @@ class Page2 {
@Component({
templateUrl: 'page3.html'
})
-class Page3 {
+export class Page3 {
constructor(public navCtrl: NavController) {}
goBack() {
@@ -118,13 +118,12 @@ class Page3 {
`
})
-class TabPage1 {}
-
+export class TabPage1 {}
@Component({
templateUrl: 'tabs.html'
})
-class TabsPage {
+export class TabsPage {
tab1Root = TabPage1;
tab2Root = Page2;
tab3Root = Page3;
@@ -140,10 +139,35 @@ class TabsPage {
@Component({
templateUrl: `./app.html`
})
-class E2EApp {
+export class E2EApp {
root = Page1;
}
-ionicBootstrap(E2EApp, [SomeData, OtherData], {
- statusbarPadding: true
-});
+
+@NgModule({
+ declarations: [
+ E2EApp,
+ TabsPage,
+ TabPage1,
+ Page1,
+ Page2,
+ Page3,
+ MyModal
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp, {
+ statusbarPadding: true
+ })
+ ],
+ providers: [SomeData, OtherData],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ TabsPage,
+ TabPage1,
+ Page1,
+ Page2,
+ Page3,
+ MyModal
+ ]
+})
+export class AppModule {}
diff --git a/src/components/app/test/gesture-collision/index.ts b/src/components/app/test/gesture-collision/app-module.ts
similarity index 74%
rename from src/components/app/test/gesture-collision/index.ts
rename to src/components/app/test/gesture-collision/app-module.ts
index 37d99e29c2..e24156c74d 100644
--- a/src/components/app/test/gesture-collision/index.ts
+++ b/src/components/app/test/gesture-collision/app-module.ts
@@ -1,11 +1,11 @@
-import { Component, ViewChild } from '@angular/core';
-import { ionicBootstrap, MenuController, NavController, AlertController, Nav, Refresher } from '../../../../../src';
+import { Component, ViewChild, NgModule } from '@angular/core';
+import { IonicApp, IonicModule, MenuController, NavController, AlertController, Nav, Refresher } from '../../../..';
@Component({
templateUrl: 'page1.html'
})
-class Page1 {
+export class Page1 {
constructor(public navCtrl: NavController, public alertCtrl: AlertController) {}
presentAlert() {
@@ -33,7 +33,7 @@ class Page1 {
@Component({
templateUrl: 'main.html'
})
-class E2EPage {
+export class E2EPage {
rootPage: any;
changeDetectionCount: number = 0;
pages: Array<{title: string, component: any}>;
@@ -63,8 +63,24 @@ class E2EPage {
@Component({
template: '
'
})
-class E2EApp {
+export class E2EApp {
rootPage = E2EPage;
}
-ionicBootstrap(E2EApp);
+
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage,
+ Page1
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EPage,
+ Page1
+ ]
+})
+export class AppModule {}
diff --git a/src/components/app/test/gesture-collision/page1.html b/src/components/app/test/gesture-collision/page1.html
index ee70532ca0..0b2df6e34e 100644
--- a/src/components/app/test/gesture-collision/page1.html
+++ b/src/components/app/test/gesture-collision/page1.html
@@ -95,6 +95,6 @@
-
+
diff --git a/src/components/app/test/gestures/app-module.ts b/src/components/app/test/gestures/app-module.ts
new file mode 100644
index 0000000000..3e85659317
--- /dev/null
+++ b/src/components/app/test/gestures/app-module.ts
@@ -0,0 +1,37 @@
+import { Component, NgModule } from '@angular/core';
+import { IonicApp, IonicModule } from '../../../..';
+
+
+@Component({
+ templateUrl: 'main.html'
+})
+export class E2EPage {
+
+ onTap(ev: any) {
+ console.log('onTap', ev);
+ }
+}
+
+
+@Component({
+ template: '
'
+})
+export class E2EApp {
+ root = E2EPage;
+}
+
+
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EPage
+ ]
+})
+export class AppModule {}
diff --git a/src/components/app/test/gestures/index.ts b/src/components/app/test/gestures/index.ts
deleted file mode 100644
index 18a5035a8e..0000000000
--- a/src/components/app/test/gestures/index.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-import { Component } from '@angular/core';
-import { ionicBootstrap } from '../../../../../src';
-
-
-@Component({
- templateUrl: 'main.html'
-})
-class E2EPage {
-
- onTap(ev) {
- console.log('onTap', ev);
- }
-
-}
-
-
-@Component({
- template: '
'
-})
-class E2EApp {
- root = E2EPage;
-}
-
-ionicBootstrap(E2EApp);
diff --git a/src/components/app/test/ion.spec.ts b/src/components/app/test/ion.spec.ts
new file mode 100644
index 0000000000..3b3a614b27
--- /dev/null
+++ b/src/components/app/test/ion.spec.ts
@@ -0,0 +1,57 @@
+import { Ion } from '../../ion';
+import { mockConfig, mockElementRef, mockRenderer } from '../../../util/mock-providers';
+
+
+describe('Ion', () => {
+
+ describe('color', () => {
+
+ it('should set color when it hasnt been set yet', () => {
+ ion._setColor('icon', 'primary');
+ expect(hasClass(ion, 'icon-primary')).toEqual(true);
+ });
+
+ it('should remove color when it has already been set', () => {
+ ion._setColor('icon', 'primary');
+ ion._setColor('icon', null);
+ expect(hasClass(ion, 'icon-primary')).toEqual(false);
+ });
+
+ it('should update color when it has already been set', () => {
+ ion._setColor('icon', 'primary');
+ ion._setColor('icon', 'secondary');
+ expect(hasClass(ion, 'icon-primary')).toEqual(false);
+ expect(hasClass(ion, 'icon-secondary')).toEqual(true);
+ });
+
+ it('should not setElementClass if its the same value', () => {
+ ion._setColor('icon', 'primary');
+ spyOn(ion, 'setElementClass');
+
+ expect(ion.setElementClass).not.toHaveBeenCalled();
+ ion._setColor('icon', 'primary');
+
+ expect(hasClass(ion, 'icon-primary')).toEqual(true);
+ });
+
+ });
+
+ describe('mode', () => {
+
+ it('', () => {
+
+ });
+
+ });
+
+ var ion: Ion;
+
+ beforeEach(() => {
+ ion = new Ion(mockConfig(), mockElementRef(), mockRenderer());
+ });
+
+ function hasClass(ion: Ion, className: string) {
+ return ion._elementRef.nativeElement.classList.contains(className);
+ }
+
+});
diff --git a/src/components/app/test/storage/index.ts b/src/components/app/test/storage/app-module.ts
similarity index 71%
rename from src/components/app/test/storage/index.ts
rename to src/components/app/test/storage/app-module.ts
index 0b1ea2f458..b49a0f456b 100644
--- a/src/components/app/test/storage/index.ts
+++ b/src/components/app/test/storage/app-module.ts
@@ -1,11 +1,11 @@
-import { Component } from '@angular/core';
-import { ionicBootstrap, Storage, LocalStorage, SqlStorage } from '../../../../../src';
+import { Component, NgModule } from '@angular/core';
+import { IonicApp, IonicModule, Storage, LocalStorage, SqlStorage } from '../../../..';
@Component({
templateUrl: 'main.html'
})
-class E2EApp {
+export class E2EApp {
local: Storage;
sql: Storage;
@@ -49,4 +49,13 @@ class E2EApp {
}
}
-ionicBootstrap(E2EApp);
+@NgModule({
+ declarations: [
+ E2EApp
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp]
+})
+export class AppModule {}
diff --git a/src/components/app/test/typography/app-module.ts b/src/components/app/test/typography/app-module.ts
new file mode 100644
index 0000000000..889ca14aea
--- /dev/null
+++ b/src/components/app/test/typography/app-module.ts
@@ -0,0 +1,23 @@
+import { Component, NgModule } from '@angular/core';
+import { IonicApp, IonicModule, App } from '../../../..';
+
+
+@Component({
+ templateUrl: 'main.html'
+})
+export class E2EApp {
+ constructor(app: App) {
+ app.setTitle('Basic Buttons');
+ }
+}
+
+@NgModule({
+ declarations: [
+ E2EApp
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp]
+})
+export class AppModule {}
diff --git a/src/components/app/test/typography/main.html b/src/components/app/test/typography/main.html
new file mode 100644
index 0000000000..2a84763109
--- /dev/null
+++ b/src/components/app/test/typography/main.html
@@ -0,0 +1,40 @@
+
+
+
+ Typography
+
+
+
+
+
+
+
+ H1: The quick brown fox jumps over the lazy dog
+
+ H2: The quick brown fox jumps over the lazy dog
+
+ H3: The quick brown fox jumps over the lazy dog
+
+ H4: The quick brown fox jumps over the lazy dog
+
+ H5: The quick brown fox jumps over the lazy dog
+
+ H6: The quick brown fox jumps over the lazy dog
+
+
+ I saw a werewolf with a Chinese menu in his hand.
+ Walking through the streets of Soho in the rain.
+ He was looking for a place called Lee Ho Fook's.
+ Gonna get a big dish of beef chow mein.
+
+
+
+ He's the hairy-handed gent who ran amuck in Kent.
+ Lately he's been overheard in Mayfair.
+ Better stay away from him.
+ He'll rip your lungs out, Jim.
+ I'd like to meet his tailor.
+
+
+
+
\ No newline at end of file
diff --git a/src/components/badge/test/basic/app-module.ts b/src/components/badge/test/basic/app-module.ts
new file mode 100644
index 0000000000..4624b8ebc3
--- /dev/null
+++ b/src/components/badge/test/basic/app-module.ts
@@ -0,0 +1,62 @@
+import { Component, NgModule } from '@angular/core';
+import { IonicApp, IonicModule, Config } from '../../../..';
+
+
+@Component({
+ templateUrl: 'main.html'
+})
+export class E2EPage {
+ dynamicColor = 'primary';
+ dynamicMode: string;
+
+ constructor(config: Config) {
+ this.dynamicMode = config.get('mode');
+ }
+
+ toggleColor() {
+ if (this.dynamicColor === 'primary') {
+ this.dynamicColor = 'secondary';
+ } else if (this.dynamicColor === 'secondary') {
+ this.dynamicColor = 'danger';
+ } else {
+ this.dynamicColor = 'primary';
+ }
+ }
+
+ toggleMode() {
+ if (this.dynamicMode === 'ios') {
+ this.dynamicMode = 'md';
+ } else if (this.dynamicMode === 'md') {
+ this.dynamicMode = 'wp';
+ } else {
+ this.dynamicMode = 'ios';
+ }
+ }
+
+ toggleBoth() {
+ this.toggleColor();
+ this.toggleMode();
+ }
+}
+
+@Component({
+ template: '
'
+})
+export class E2EApp {
+ rootPage = E2EPage;
+}
+
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EPage
+ ]
+})
+export class AppModule {}
diff --git a/src/components/badge/test/basic/e2e.ts b/src/components/badge/test/basic/e2e.ts
index 94ed4bf5a5..1598470cd9 100644
--- a/src/components/badge/test/basic/e2e.ts
+++ b/src/components/badge/test/basic/e2e.ts
@@ -1,4 +1,4 @@
it('should toggle color', function() {
element(by.css('.e2eBadgeToggleColor')).click();
-});
\ No newline at end of file
+});
diff --git a/src/components/badge/test/basic/index.ts b/src/components/badge/test/basic/index.ts
deleted file mode 100644
index 50abaadae3..0000000000
--- a/src/components/badge/test/basic/index.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-import { Component } from '@angular/core';
-import { ionicBootstrap } from '../../../../../src';
-
-
-@Component({
- templateUrl: 'main.html'
-})
-class E2EPage {
- dynamicColor: string = 'secondary';
-
- toggleColor() {
- this.dynamicColor = (this.dynamicColor == 'secondary' ? 'danger' : 'secondary');
- }
-}
-
-@Component({
- template: '
'
-})
-class E2EApp {
- rootPage = E2EPage;
-}
-
-ionicBootstrap(E2EApp);
diff --git a/src/components/badge/test/basic/main.html b/src/components/badge/test/basic/main.html
index 15e9d99c28..0fd56bbfb2 100644
--- a/src/components/badge/test/basic/main.html
+++ b/src/components/badge/test/basic/main.html
@@ -38,8 +38,16 @@
99
+
+
@@ -72,8 +80,12 @@
99
+
diff --git a/src/components/button/test/attributes/index.ts b/src/components/button/test/attributes/app-module.ts
similarity index 75%
rename from src/components/button/test/attributes/index.ts
rename to src/components/button/test/attributes/app-module.ts
index b5f895acfc..c6c770065d 100644
--- a/src/components/button/test/attributes/index.ts
+++ b/src/components/button/test/attributes/app-module.ts
@@ -1,11 +1,11 @@
-import { Component } from '@angular/core';
-import { App, ionicBootstrap } from '../../../../../src';
+import { NgModule, Component } from '@angular/core';
+import { IonicApp, IonicModule } from '../../../..';
@Component({
templateUrl: 'main.html'
})
-class E2EPage {
+export class E2EPage {
isFull: boolean = true;
isBlock: boolean = true;
isBarClear: boolean = true;
@@ -20,10 +20,6 @@ class E2EPage {
isDanger: string = 'danger';
isDark: string = 'dark';
- constructor(app: App) {
-
- }
-
toggleBlock() {
this.isFull = !this.isFull;
this.isBlock = !this.isBlock;
@@ -50,15 +46,28 @@ class E2EPage {
removeColors() {
this.isSecondary = null;
this.isDanger = null;
- this.isDark = null;
+ this.isDark = null;
}
}
@Component({
template: '
'
})
-class E2EApp {
+export class E2EApp {
rootPage = E2EPage;
}
-ionicBootstrap(E2EApp);
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EPage
+ ]
+})
+export class AppModule {}
diff --git a/src/components/button/test/basic/index.ts b/src/components/button/test/basic/app-module.ts
similarity index 62%
rename from src/components/button/test/basic/index.ts
rename to src/components/button/test/basic/app-module.ts
index 1c5833fa99..bd7e2c8fe3 100644
--- a/src/components/button/test/basic/index.ts
+++ b/src/components/button/test/basic/app-module.ts
@@ -1,11 +1,11 @@
-import { Component } from '@angular/core';
-import { App, ionicBootstrap } from '../../../../../src';
+import { NgModule, Component } from '@angular/core';
+import { IonicApp, IonicModule, App } from '../../../..';
@Component({
templateUrl: 'main.html'
})
-class E2EPage {
+export class E2EPage {
btnColor: string;
testingColors = ['primary', 'secondary', 'danger', 'dark'];
testingColorIndex = 0;
@@ -25,8 +25,22 @@ class E2EPage {
@Component({
template: '
'
})
-class E2EApp {
+export class E2EApp {
rootPage = E2EPage;
}
-ionicBootstrap(E2EApp);
+
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EPage
+ ]
+})
+export class AppModule {}
diff --git a/src/components/button/test/block/app-module.ts b/src/components/button/test/block/app-module.ts
new file mode 100644
index 0000000000..c2c5e1381a
--- /dev/null
+++ b/src/components/button/test/block/app-module.ts
@@ -0,0 +1,38 @@
+import { Component, NgModule } from '@angular/core';
+import { IonicApp, IonicModule } from '../../../..';
+
+
+@Component({
+ templateUrl: 'main.html'
+})
+export class E2EPage {
+ blockButton = true;
+
+ toggleBlock() {
+ this.blockButton = !this.blockButton;
+ }
+}
+
+
+@Component({
+ template: '
'
+})
+export class E2EApp {
+ rootPage = E2EPage;
+}
+
+
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EPage
+ ]
+})
+export class AppModule {}
diff --git a/src/components/button/test/block/index.ts b/src/components/button/test/block/index.ts
deleted file mode 100644
index 11f64b96a5..0000000000
--- a/src/components/button/test/block/index.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-import { Component } from '@angular/core';
-import { ionicBootstrap } from '../../../../../src';
-
-
-@Component({
- templateUrl: 'main.html'
-})
-class E2EPage {
- blockButton = true;
-
- toggleBlock() {
- this.blockButton = !this.blockButton;
- }
-}
-
-@Component({
- template: '
'
-})
-class E2EApp {
- rootPage = E2EPage;
-}
-
-ionicBootstrap(E2EApp);
diff --git a/src/components/button/test/button.spec.ts b/src/components/button/test/button.spec.ts
index 9d70241ef7..b843336878 100644
--- a/src/components/button/test/button.spec.ts
+++ b/src/components/button/test/button.spec.ts
@@ -1,261 +1,251 @@
-import { Button, Config } from '../../../../src';
+import { Button } from '../button';
+import { Config } from '../../../config/config';
+import { mockConfig, mockElementRef, mockRenderer } from '../../../util/mock-providers';
-export function run() {
+describe('button', () => {
- describe('button', () => {
+ it('should set a different button role', () => {
+ let b = mockButton();
+ b.outline = true;
+ b.small = true;
+ b.full = true;
+ b.color = 'primary';
+ b.setRole('bar-button');
+ b._assignCss(true);
- it('should set a different button role', () => {
- let b = mockButton();
- b.outline = true;
- b.small = true;
- b.full = true;
- b.color = 'primary';
- b.setRole('bar-button');
- b._assignCss(true);
-
- expect(hasClass(b, 'bar-button-outline')).toEqual(true);
- expect(hasClass(b, 'bar-button-small')).toEqual(true);
- expect(hasClass(b, 'bar-button-full')).toEqual(true);
- expect(hasClass(b, 'bar-button-outline-primary')).toEqual(true);
-
- expect(hasClass(b, 'button-outline')).toEqual(false);
- expect(hasClass(b, 'button-small')).toEqual(false);
- expect(hasClass(b, 'button-full')).toEqual(false);
- expect(hasClass(b, 'button-primary')).toEqual(false);
- });
-
- it('should remove button color attributes and add different role', () => {
- let b = mockButton();
- b.outline = true;
- b.small = true;
- b.full = true;
- b.color = 'primary';
-
- b._assignCss(true);
- expect(hasClass(b, 'button-outline')).toEqual(true);
- expect(hasClass(b, 'button-small')).toEqual(true);
- expect(hasClass(b, 'button-full')).toEqual(true);
- expect(hasClass(b, 'button-outline-primary')).toEqual(true);
-
- b._assignCss(false);
- expect(hasClass(b, 'button-outline')).toEqual(false);
- expect(hasClass(b, 'button-small')).toEqual(false);
- expect(hasClass(b, 'button-full')).toEqual(false);
- expect(hasClass(b, 'button-outline-primary')).toEqual(false);
- });
-
- it('should read button color attributes with styles', () => {
- let b = mockButton();
- b.outline = true;
- b.small = true;
- b.full = true;
- b.color = 'primary';
-
- b._assignCss(true);
- expect(hasClass(b, 'button')).toEqual(true);
- expect(hasClass(b, 'button-outline')).toEqual(true);
- expect(hasClass(b, 'button-small')).toEqual(true);
- expect(hasClass(b, 'button-full')).toEqual(true);
- expect(hasClass(b, 'button-outline-primary')).toEqual(true);
-
- b = mockButton();
- b.clear = true;
- b.color = 'primary';
- b.color = 'secondary';
-
- b._assignCss(true);
- expect(hasClass(b, 'button')).toEqual(true);
- expect(hasClass(b, 'button-clear')).toEqual(true);
- expect(hasClass(b, 'button-clear-primary')).toEqual(false);
- expect(hasClass(b, 'button-clear-secondary')).toEqual(true);
-
- b = mockButton();
- b.solid = true;
- b.color = 'primary';
- b.color = 'secondary';
-
- b._assignCss(true);
- expect(hasClass(b, 'button')).toEqual(true);
- expect(hasClass(b, 'button-solid')).toEqual(true);
- expect(hasClass(b, 'button-primary')).toEqual(false);
- expect(hasClass(b, 'button-secondary')).toEqual(true);
-
- b = mockButton();
- b.solid = true;
- b.color = 'primary';
- b.color = 'secondary';
-
- b.setRole('bar-button');
- b._assignCss(true);
- expect(hasClass(b, 'bar-button-solid')).toEqual(true);
- expect(hasClass(b, 'bar-button-solid-primary')).toEqual(false);
- expect(hasClass(b, 'bar-button-solid-secondary')).toEqual(true);
- });
-
- it('should auto add the default style', () => {
- let b = mockButton();
- b._assignCss(true);
- expect(hasClass(b, 'button')).toEqual(true);
- expect(hasClass(b, 'button-default')).toEqual(true);
-
- b = mockButton();
- b.clear = true;
-
- b._assignCss(true);
- expect(hasClass(b, 'button')).toEqual(true);
- expect(hasClass(b, 'button-default')).toEqual(false);
- expect(hasClass(b, 'button-clear')).toEqual(true);
- });
-
- it('should read button color attributes', () => {
- let b = mockButton();
- b.color = 'primary';
- b._assignCss(true);
- expect(hasClass(b, 'button-primary')).toEqual(true);
-
- b = mockButton();
- b.color = 'primary';
- b.color = 'secondary';
- b._assignCss(true);
- expect(hasClass(b, 'button-primary')).toEqual(false);
- expect(hasClass(b, 'button-secondary')).toEqual(true);
- });
-
- it('should read button style attributes', () => {
- let b = mockButton();
- b.clear = true;
- b._assignCss(true);
- expect(hasClass(b, 'button-clear')).toEqual(true);
-
- b = mockButton();
- b.outline = true;
- b._assignCss(true);
- expect(hasClass(b, 'button-outline')).toEqual(true);
-
- b = mockButton();
- b.solid = true;
- b._assignCss(true);
- expect(hasClass(b, 'button-solid')).toEqual(true);
-
- b = mockButton();
- b.clear = true;
- b.outline = true;
- b.small = true;
- b.full = true;
- b._assignCss(true);
- expect(hasClass(b, 'button-clear')).toEqual(false);
- expect(hasClass(b, 'button-outline')).toEqual(true);
- expect(hasClass(b, 'button-small')).toEqual(true);
- expect(hasClass(b, 'button-full')).toEqual(true);
-
- b = mockButton();
- b.outline = true;
- b.setRole('bar-button');
- b._assignCss(true);
- expect(hasClass(b, 'bar-button-outline')).toEqual(true);
- });
-
- it('should read button shape attributes', () => {
- let b = mockButton();
- b.round = true;
- b._assignCss(true);
- expect(hasClass(b, 'button-round')).toEqual(true);
-
- b = mockButton();
- b.fab = true;
- b._assignCss(true);
- expect(hasClass(b, 'button-fab')).toEqual(true);
- });
-
- it('should read button display attributes', () => {
- let b = mockButton();
- b.block = true;
- b._assignCss(true);
- expect(hasClass(b, 'button-block')).toEqual(true);
-
- b = mockButton();
- b.full = true;
- b._assignCss(true);
- expect(hasClass(b, 'button-full')).toEqual(true);
-
- b = mockButton();
- b.block = true;
- b.full = true;
- b._assignCss(true);
- expect(hasClass(b, 'button-block')).toEqual(false);
- expect(hasClass(b, 'button-full')).toEqual(true);
- });
-
- it('should read button size attributes', () => {
- let b = mockButton();
- b.small = true;
- b._assignCss(true);
- expect(hasClass(b, 'button-small')).toEqual(true);
-
- b = mockButton();
- b.large = true;
- b._assignCss(true);
- expect(hasClass(b, 'button-large')).toEqual(true);
-
- b = mockButton();
- b.large = true;
- b.small = true;
- b._assignCss(true);
- expect(hasClass(b, 'button-large')).toEqual(false);
- expect(hasClass(b, 'button-small')).toEqual(true);
- });
-
- it('should add button css class', () => {
- let b = mockButton();
- b._assignCss(true);
- expect(hasClass(b, 'button')).toEqual(true);
- });
-
- it('should add disable-hover css class', () => {
- let config = new Config({
- hoverCSS: false
- });
- let b = mockButton(config);
-
- expect(hasClass(b, 'disable-hover')).toEqual(true);
- });
-
- it('should set defaults', () => {
- let b = mockButton();
- expect(b._role).toEqual('button');
- expect(b._size).toEqual(null);
- expect(b._color).toEqual(null);
- expect(b._style).toEqual('default');
- expect(b._display).toEqual(null);
- });
-
- it('should add alert-button css class', () => {
- let b = mockButton(null, 'alert-button');
- b._assignCss(true);
- expect(hasClass(b, 'alert-button')).toEqual(true);
- });
+ expect(hasClass(b, 'bar-button-outline')).toEqual(true);
+ expect(hasClass(b, 'bar-button-small')).toEqual(true);
+ expect(hasClass(b, 'bar-button-full')).toEqual(true);
+ expect(hasClass(b, 'bar-button-outline-primary')).toEqual(true);
+ expect(hasClass(b, 'button-outline')).toEqual(false);
+ expect(hasClass(b, 'button-small')).toEqual(false);
+ expect(hasClass(b, 'button-full')).toEqual(false);
+ expect(hasClass(b, 'button-primary')).toEqual(false);
});
- function mockButton(config?, ionButton?) {
- config = config || new Config();
- ionButton = ionButton || '';
- let elementRef = {
- nativeElement: document.createElement('button')
- };
- let renderer: any = {
- setElementClass: function(nativeElement, className, shouldAdd) {
- nativeElement.classList[shouldAdd ? 'add' : 'remove'](className);
- }
- };
- let b = new Button(null, ionButton, config, elementRef, renderer);
- b._init = true;
- return b;
- }
+ it('should remove button color attributes and add different role', () => {
+ let b = mockButton();
+ b.outline = true;
+ b.small = true;
+ b.full = true;
+ b.color = 'primary';
- function hasClass(button, className) {
- return button._elementRef.nativeElement.classList.contains(className);
- }
+ b._assignCss(true);
+ expect(hasClass(b, 'button-outline')).toEqual(true);
+ expect(hasClass(b, 'button-small')).toEqual(true);
+ expect(hasClass(b, 'button-full')).toEqual(true);
+ expect(hasClass(b, 'button-outline-primary')).toEqual(true);
+ b._assignCss(false);
+ expect(hasClass(b, 'button-outline')).toEqual(false);
+ expect(hasClass(b, 'button-small')).toEqual(false);
+ expect(hasClass(b, 'button-full')).toEqual(false);
+ expect(hasClass(b, 'button-outline-primary')).toEqual(false);
+ });
+
+ it('should read button color attributes with styles', () => {
+ let b = mockButton();
+ b.outline = true;
+ b.small = true;
+ b.full = true;
+ b.color = 'primary';
+
+ b._assignCss(true);
+ expect(hasClass(b, 'button')).toEqual(true);
+ expect(hasClass(b, 'button-outline')).toEqual(true);
+ expect(hasClass(b, 'button-small')).toEqual(true);
+ expect(hasClass(b, 'button-full')).toEqual(true);
+ expect(hasClass(b, 'button-outline-primary')).toEqual(true);
+
+ b = mockButton();
+ b.clear = true;
+ b.color = 'primary';
+ b.color = 'secondary';
+
+ b._assignCss(true);
+ expect(hasClass(b, 'button')).toEqual(true);
+ expect(hasClass(b, 'button-clear')).toEqual(true);
+ expect(hasClass(b, 'button-clear-primary')).toEqual(false);
+ expect(hasClass(b, 'button-clear-secondary')).toEqual(true);
+
+ b = mockButton();
+ b.solid = true;
+ b.color = 'primary';
+ b.color = 'secondary';
+
+ b._assignCss(true);
+ expect(hasClass(b, 'button')).toEqual(true);
+ expect(hasClass(b, 'button-solid')).toEqual(true);
+ expect(hasClass(b, 'button-primary')).toEqual(false);
+ expect(hasClass(b, 'button-secondary')).toEqual(true);
+
+ b = mockButton();
+ b.solid = true;
+ b.color = 'primary';
+ b.color = 'secondary';
+
+ b.setRole('bar-button');
+ b._assignCss(true);
+ expect(hasClass(b, 'bar-button-solid')).toEqual(true);
+ expect(hasClass(b, 'bar-button-solid-primary')).toEqual(false);
+ expect(hasClass(b, 'bar-button-solid-secondary')).toEqual(true);
+ });
+
+ it('should auto add the default style', () => {
+ let b = mockButton();
+ b._assignCss(true);
+ expect(hasClass(b, 'button')).toEqual(true);
+ expect(hasClass(b, 'button-default')).toEqual(true);
+
+ b = mockButton();
+ b.clear = true;
+
+ b._assignCss(true);
+ expect(hasClass(b, 'button')).toEqual(true);
+ expect(hasClass(b, 'button-default')).toEqual(false);
+ expect(hasClass(b, 'button-clear')).toEqual(true);
+ });
+
+ it('should read button color attributes', () => {
+ let b = mockButton();
+ b.color = 'primary';
+ b._assignCss(true);
+ expect(hasClass(b, 'button-primary')).toEqual(true);
+
+ b = mockButton();
+ b.color = 'primary';
+ b.color = 'secondary';
+ b._assignCss(true);
+ expect(hasClass(b, 'button-primary')).toEqual(false);
+ expect(hasClass(b, 'button-secondary')).toEqual(true);
+ });
+
+ it('should read button style attributes', () => {
+ let b = mockButton();
+ b.clear = true;
+ b._assignCss(true);
+ expect(hasClass(b, 'button-clear')).toEqual(true);
+
+ b = mockButton();
+ b.outline = true;
+ b._assignCss(true);
+ expect(hasClass(b, 'button-outline')).toEqual(true);
+
+ b = mockButton();
+ b.solid = true;
+ b._assignCss(true);
+ expect(hasClass(b, 'button-solid')).toEqual(true);
+
+ b = mockButton();
+ b.clear = true;
+ b.outline = true;
+ b.small = true;
+ b.full = true;
+ b._assignCss(true);
+ expect(hasClass(b, 'button-clear')).toEqual(false);
+ expect(hasClass(b, 'button-outline')).toEqual(true);
+ expect(hasClass(b, 'button-small')).toEqual(true);
+ expect(hasClass(b, 'button-full')).toEqual(true);
+
+ b = mockButton();
+ b.outline = true;
+ b.setRole('bar-button');
+ b._assignCss(true);
+ expect(hasClass(b, 'bar-button-outline')).toEqual(true);
+ });
+
+ it('should read button shape attributes', () => {
+ let b = mockButton();
+ b.round = true;
+ b._assignCss(true);
+ expect(hasClass(b, 'button-round')).toEqual(true);
+
+ b = mockButton();
+ b.fab = true;
+ b._assignCss(true);
+ expect(hasClass(b, 'button-fab')).toEqual(true);
+ });
+
+ it('should read button display attributes', () => {
+ let b = mockButton();
+ b.block = true;
+ b._assignCss(true);
+ expect(hasClass(b, 'button-block')).toEqual(true);
+
+ b = mockButton();
+ b.full = true;
+ b._assignCss(true);
+ expect(hasClass(b, 'button-full')).toEqual(true);
+
+ b = mockButton();
+ b.block = true;
+ b.full = true;
+ b._assignCss(true);
+ expect(hasClass(b, 'button-block')).toEqual(false);
+ expect(hasClass(b, 'button-full')).toEqual(true);
+ });
+
+ it('should read button size attributes', () => {
+ let b = mockButton();
+ b.small = true;
+ b._assignCss(true);
+ expect(hasClass(b, 'button-small')).toEqual(true);
+
+ b = mockButton();
+ b.large = true;
+ b._assignCss(true);
+ expect(hasClass(b, 'button-large')).toEqual(true);
+
+ b = mockButton();
+ b.large = true;
+ b.small = true;
+ b._assignCss(true);
+ expect(hasClass(b, 'button-large')).toEqual(false);
+ expect(hasClass(b, 'button-small')).toEqual(true);
+ });
+
+ it('should add button css class', () => {
+ let b = mockButton();
+ b._assignCss(true);
+ expect(hasClass(b, 'button')).toEqual(true);
+ });
+
+ it('should add disable-hover css class', () => {
+ let config = mockConfig({
+ hoverCSS: false
+ });
+ let b = mockButton(config);
+
+ expect(hasClass(b, 'disable-hover')).toEqual(true);
+ });
+
+ it('should set defaults', () => {
+ let b = mockButton();
+ expect(b._role).toEqual('button');
+ expect(b._size).toEqual(undefined);
+ expect(b._color).toEqual(undefined);
+ expect(b._style).toEqual('default');
+ expect(b._display).toEqual(undefined);
+ });
+
+ it('should add alert-button css class', () => {
+ let b = mockButton(null, 'alert-button');
+ b._assignCss(true);
+ expect(hasClass(b, 'alert-button')).toEqual(true);
+ });
+
+});
+
+function mockButton(config?: Config, ionButton?: string) {
+ config = config || mockConfig();
+ ionButton = ionButton || '';
+ let b = new Button(null, ionButton, config, mockElementRef(), mockRenderer());
+ b._init = true;
+ return b;
+}
+
+function hasClass(button, className) {
+ return button._elementRef.nativeElement.classList.contains(className);
}
diff --git a/src/components/button/test/clear/app-module.ts b/src/components/button/test/clear/app-module.ts
new file mode 100644
index 0000000000..174a81eacc
--- /dev/null
+++ b/src/components/button/test/clear/app-module.ts
@@ -0,0 +1,36 @@
+import { Component, NgModule } from '@angular/core';
+import { IonicApp, IonicModule } from '../../../..';
+
+
+@Component({
+ templateUrl: 'main.html'
+})
+export class E2EPage {
+ clearButton = true;
+
+ toggleClear() {
+ this.clearButton = !this.clearButton;
+ }
+}
+
+@Component({
+ template: '
'
+})
+export class E2EApp {
+ rootPage = E2EPage;
+}
+
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EPage
+ ]
+})
+export class AppModule {}
diff --git a/src/components/button/test/clear/index.ts b/src/components/button/test/clear/index.ts
deleted file mode 100644
index 4817194989..0000000000
--- a/src/components/button/test/clear/index.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-import { Component } from '@angular/core';
-import { ionicBootstrap } from '../../../../../src';
-
-
-@Component({
- templateUrl: 'main.html'
-})
-class E2EPage {
- clearButton = true;
-
- toggleClear() {
- this.clearButton = !this.clearButton;
- }
-}
-
-@Component({
- template: '
'
-})
-class E2EApp {
- rootPage = E2EPage;
-}
-
-ionicBootstrap(E2EApp);
diff --git a/src/components/button/test/dynamic/index.ts b/src/components/button/test/dynamic/app-module.ts
similarity index 74%
rename from src/components/button/test/dynamic/index.ts
rename to src/components/button/test/dynamic/app-module.ts
index 0a3df894a2..b4dfa95aba 100644
--- a/src/components/button/test/dynamic/index.ts
+++ b/src/components/button/test/dynamic/app-module.ts
@@ -1,11 +1,11 @@
-import { Component } from '@angular/core';
-import { ionicBootstrap } from '../../../../../src';
+import { Component, NgModule } from '@angular/core';
+import { IonicApp, IonicModule } from '../../../..';
@Component({
templateUrl: 'main.html'
})
-class E2EPage {
+export class E2EPage {
isDestructive: boolean;
isSecondary: boolean;
isCustom: boolean;
@@ -54,8 +54,21 @@ class E2EPage {
@Component({
template: '
'
})
-class E2EApp {
+export class E2EApp {
rootPage = E2EPage;
}
-ionicBootstrap(E2EApp);
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EPage
+ ]
+})
+export class AppModule {}
diff --git a/src/components/button/test/fab/app-module.ts b/src/components/button/test/fab/app-module.ts
new file mode 100644
index 0000000000..0bf1cc361b
--- /dev/null
+++ b/src/components/button/test/fab/app-module.ts
@@ -0,0 +1,30 @@
+import { Component, NgModule } from '@angular/core';
+import { IonicApp, IonicModule } from '../../../..';
+
+
+@Component({
+ templateUrl: 'main.html'
+})
+export class E2EPage {}
+
+@Component({
+ template: '
'
+})
+export class E2EApp {
+ rootPage = E2EPage;
+}
+
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EPage
+ ]
+})
+export class AppModule {}
diff --git a/src/components/button/test/fab/index.ts b/src/components/button/test/fab/index.ts
deleted file mode 100644
index 7b73dae881..0000000000
--- a/src/components/button/test/fab/index.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-import { Component } from '@angular/core';
-import { ionicBootstrap } from '../../../../../src';
-
-
-@Component({
- templateUrl: 'main.html'
-})
-class E2EPage {}
-
-@Component({
- template: '
'
-})
-class E2EApp {
- rootPage = E2EPage;
-}
-
-ionicBootstrap(E2EApp);
diff --git a/src/components/button/test/full/app-module.ts b/src/components/button/test/full/app-module.ts
new file mode 100644
index 0000000000..0bf1cc361b
--- /dev/null
+++ b/src/components/button/test/full/app-module.ts
@@ -0,0 +1,30 @@
+import { Component, NgModule } from '@angular/core';
+import { IonicApp, IonicModule } from '../../../..';
+
+
+@Component({
+ templateUrl: 'main.html'
+})
+export class E2EPage {}
+
+@Component({
+ template: '
'
+})
+export class E2EApp {
+ rootPage = E2EPage;
+}
+
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EPage
+ ]
+})
+export class AppModule {}
diff --git a/src/components/button/test/full/index.ts b/src/components/button/test/full/index.ts
deleted file mode 100644
index 7b73dae881..0000000000
--- a/src/components/button/test/full/index.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-import { Component } from '@angular/core';
-import { ionicBootstrap } from '../../../../../src';
-
-
-@Component({
- templateUrl: 'main.html'
-})
-class E2EPage {}
-
-@Component({
- template: '
'
-})
-class E2EApp {
- rootPage = E2EPage;
-}
-
-ionicBootstrap(E2EApp);
diff --git a/src/components/button/test/icons/app-module.ts b/src/components/button/test/icons/app-module.ts
new file mode 100644
index 0000000000..0bf1cc361b
--- /dev/null
+++ b/src/components/button/test/icons/app-module.ts
@@ -0,0 +1,30 @@
+import { Component, NgModule } from '@angular/core';
+import { IonicApp, IonicModule } from '../../../..';
+
+
+@Component({
+ templateUrl: 'main.html'
+})
+export class E2EPage {}
+
+@Component({
+ template: '
'
+})
+export class E2EApp {
+ rootPage = E2EPage;
+}
+
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EPage
+ ]
+})
+export class AppModule {}
diff --git a/src/components/button/test/icons/index.ts b/src/components/button/test/icons/index.ts
deleted file mode 100644
index 7b73dae881..0000000000
--- a/src/components/button/test/icons/index.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-import { Component } from '@angular/core';
-import { ionicBootstrap } from '../../../../../src';
-
-
-@Component({
- templateUrl: 'main.html'
-})
-class E2EPage {}
-
-@Component({
- template: '
'
-})
-class E2EApp {
- rootPage = E2EPage;
-}
-
-ionicBootstrap(E2EApp);
diff --git a/src/components/button/test/outline/app-module.ts b/src/components/button/test/outline/app-module.ts
new file mode 100644
index 0000000000..027f18e682
--- /dev/null
+++ b/src/components/button/test/outline/app-module.ts
@@ -0,0 +1,36 @@
+import { Component, NgModule } from '@angular/core';
+import { IonicApp, IonicModule } from '../../../..';
+
+
+@Component({
+ templateUrl: 'main.html'
+})
+export class E2EPage {
+ outlineButton = true;
+
+ toggleOutline() {
+ this.outlineButton = !this.outlineButton;
+ }
+}
+
+@Component({
+ template: '
'
+})
+export class E2EApp {
+ rootPage = E2EPage;
+}
+
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EPage
+ ]
+})
+export class AppModule {}
diff --git a/src/components/button/test/outline/index.ts b/src/components/button/test/outline/index.ts
deleted file mode 100644
index 33b7ef6003..0000000000
--- a/src/components/button/test/outline/index.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-import { Component } from '@angular/core';
-import { ionicBootstrap } from '../../../../../src';
-
-
-@Component({
- templateUrl: 'main.html'
-})
-class E2EPage {
- outlineButton = true;
-
- toggleOutline() {
- this.outlineButton = !this.outlineButton;
- }
-}
-
-@Component({
- template: '
'
-})
-class E2EApp {
- rootPage = E2EPage;
-}
-
-ionicBootstrap(E2EApp);
diff --git a/src/components/button/test/raised/app-module.ts b/src/components/button/test/raised/app-module.ts
new file mode 100644
index 0000000000..0bf1cc361b
--- /dev/null
+++ b/src/components/button/test/raised/app-module.ts
@@ -0,0 +1,30 @@
+import { Component, NgModule } from '@angular/core';
+import { IonicApp, IonicModule } from '../../../..';
+
+
+@Component({
+ templateUrl: 'main.html'
+})
+export class E2EPage {}
+
+@Component({
+ template: '
'
+})
+export class E2EApp {
+ rootPage = E2EPage;
+}
+
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EPage
+ ]
+})
+export class AppModule {}
diff --git a/src/components/button/test/raised/index.ts b/src/components/button/test/raised/index.ts
deleted file mode 100644
index 7b73dae881..0000000000
--- a/src/components/button/test/raised/index.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-import { Component } from '@angular/core';
-import { ionicBootstrap } from '../../../../../src';
-
-
-@Component({
- templateUrl: 'main.html'
-})
-class E2EPage {}
-
-@Component({
- template: '
'
-})
-class E2EApp {
- rootPage = E2EPage;
-}
-
-ionicBootstrap(E2EApp);
diff --git a/src/components/button/test/round/app-module.ts b/src/components/button/test/round/app-module.ts
new file mode 100644
index 0000000000..3990ca9a8a
--- /dev/null
+++ b/src/components/button/test/round/app-module.ts
@@ -0,0 +1,37 @@
+import { Component, NgModule } from '@angular/core';
+import { IonicApp, IonicModule } from '../../../..';
+
+
+@Component({
+ templateUrl: 'main.html'
+})
+export class E2EPage {
+ dynamicColor: string = 'secondary';
+
+ toggleColor() {
+ this.dynamicColor = (this.dynamicColor === 'secondary' ? 'danger' : 'secondary');
+ }
+}
+
+
+@Component({
+ template: '
'
+})
+export class E2EApp {
+ rootPage = E2EPage;
+}
+
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EPage
+ ]
+})
+export class AppModule {}
diff --git a/src/components/button/test/round/index.ts b/src/components/button/test/round/index.ts
deleted file mode 100644
index 7b73dae881..0000000000
--- a/src/components/button/test/round/index.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-import { Component } from '@angular/core';
-import { ionicBootstrap } from '../../../../../src';
-
-
-@Component({
- templateUrl: 'main.html'
-})
-class E2EPage {}
-
-@Component({
- template: '
'
-})
-class E2EApp {
- rootPage = E2EPage;
-}
-
-ionicBootstrap(E2EApp);
diff --git a/src/components/button/test/sizes/app-module.ts b/src/components/button/test/sizes/app-module.ts
new file mode 100644
index 0000000000..89068bf125
--- /dev/null
+++ b/src/components/button/test/sizes/app-module.ts
@@ -0,0 +1,31 @@
+import { Component, NgModule } from '@angular/core';
+import { IonicApp, IonicModule } from '../../../..';
+
+
+@Component({
+ templateUrl: 'main.html'
+})
+export class E2EPage {}
+
+
+@Component({
+ template: '
'
+})
+export class E2EApp {
+ rootPage = E2EPage;
+}
+
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EPage
+ ]
+})
+export class AppModule {}
diff --git a/src/components/button/test/sizes/index.ts b/src/components/button/test/sizes/index.ts
deleted file mode 100644
index 7b73dae881..0000000000
--- a/src/components/button/test/sizes/index.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-import { Component } from '@angular/core';
-import { ionicBootstrap } from '../../../../../src';
-
-
-@Component({
- templateUrl: 'main.html'
-})
-class E2EPage {}
-
-@Component({
- template: '
'
-})
-class E2EApp {
- rootPage = E2EPage;
-}
-
-ionicBootstrap(E2EApp);
diff --git a/src/components/card/test/advanced/app-module.ts b/src/components/card/test/advanced/app-module.ts
new file mode 100644
index 0000000000..0bf1cc361b
--- /dev/null
+++ b/src/components/card/test/advanced/app-module.ts
@@ -0,0 +1,30 @@
+import { Component, NgModule } from '@angular/core';
+import { IonicApp, IonicModule } from '../../../..';
+
+
+@Component({
+ templateUrl: 'main.html'
+})
+export class E2EPage {}
+
+@Component({
+ template: '
'
+})
+export class E2EApp {
+ rootPage = E2EPage;
+}
+
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EPage
+ ]
+})
+export class AppModule {}
diff --git a/src/components/card/test/advanced/index.ts b/src/components/card/test/advanced/index.ts
deleted file mode 100644
index 7b73dae881..0000000000
--- a/src/components/card/test/advanced/index.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-import { Component } from '@angular/core';
-import { ionicBootstrap } from '../../../../../src';
-
-
-@Component({
- templateUrl: 'main.html'
-})
-class E2EPage {}
-
-@Component({
- template: '
'
-})
-class E2EApp {
- rootPage = E2EPage;
-}
-
-ionicBootstrap(E2EApp);
diff --git a/src/components/card/test/basic/app-module.ts b/src/components/card/test/basic/app-module.ts
new file mode 100644
index 0000000000..0c7a8d2016
--- /dev/null
+++ b/src/components/card/test/basic/app-module.ts
@@ -0,0 +1,31 @@
+import { Component, NgModule } from '@angular/core';
+import { IonicApp, IonicModule } from '../../../..';
+
+
+@Component({
+ templateUrl: 'main.html'
+})
+export class E2EPage {}
+
+@Component({
+ template: '
'
+})
+export class E2EApp {
+ rootPage = E2EPage;
+}
+
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EPage
+ ]
+})
+export class AppModule {}
+
diff --git a/src/components/card/test/basic/index.ts b/src/components/card/test/basic/index.ts
deleted file mode 100644
index 7b73dae881..0000000000
--- a/src/components/card/test/basic/index.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-import { Component } from '@angular/core';
-import { ionicBootstrap } from '../../../../../src';
-
-
-@Component({
- templateUrl: 'main.html'
-})
-class E2EPage {}
-
-@Component({
- template: '
'
-})
-class E2EApp {
- rootPage = E2EPage;
-}
-
-ionicBootstrap(E2EApp);
diff --git a/src/components/card/test/images/app-module.ts b/src/components/card/test/images/app-module.ts
new file mode 100644
index 0000000000..0c7a8d2016
--- /dev/null
+++ b/src/components/card/test/images/app-module.ts
@@ -0,0 +1,31 @@
+import { Component, NgModule } from '@angular/core';
+import { IonicApp, IonicModule } from '../../../..';
+
+
+@Component({
+ templateUrl: 'main.html'
+})
+export class E2EPage {}
+
+@Component({
+ template: '
'
+})
+export class E2EApp {
+ rootPage = E2EPage;
+}
+
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EPage
+ ]
+})
+export class AppModule {}
+
diff --git a/src/components/card/test/images/index.ts b/src/components/card/test/images/index.ts
deleted file mode 100644
index 7b73dae881..0000000000
--- a/src/components/card/test/images/index.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-import { Component } from '@angular/core';
-import { ionicBootstrap } from '../../../../../src';
-
-
-@Component({
- templateUrl: 'main.html'
-})
-class E2EPage {}
-
-@Component({
- template: '
'
-})
-class E2EApp {
- rootPage = E2EPage;
-}
-
-ionicBootstrap(E2EApp);
diff --git a/src/components/card/test/list/app-module.ts b/src/components/card/test/list/app-module.ts
new file mode 100644
index 0000000000..0bf1cc361b
--- /dev/null
+++ b/src/components/card/test/list/app-module.ts
@@ -0,0 +1,30 @@
+import { Component, NgModule } from '@angular/core';
+import { IonicApp, IonicModule } from '../../../..';
+
+
+@Component({
+ templateUrl: 'main.html'
+})
+export class E2EPage {}
+
+@Component({
+ template: '
'
+})
+export class E2EApp {
+ rootPage = E2EPage;
+}
+
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EPage
+ ]
+})
+export class AppModule {}
diff --git a/src/components/card/test/list/index.ts b/src/components/card/test/list/index.ts
deleted file mode 100644
index 7b73dae881..0000000000
--- a/src/components/card/test/list/index.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-import { Component } from '@angular/core';
-import { ionicBootstrap } from '../../../../../src';
-
-
-@Component({
- templateUrl: 'main.html'
-})
-class E2EPage {}
-
-@Component({
- template: '
'
-})
-class E2EApp {
- rootPage = E2EPage;
-}
-
-ionicBootstrap(E2EApp);
diff --git a/src/components/card/test/map/app-module.ts b/src/components/card/test/map/app-module.ts
new file mode 100644
index 0000000000..0bf1cc361b
--- /dev/null
+++ b/src/components/card/test/map/app-module.ts
@@ -0,0 +1,30 @@
+import { Component, NgModule } from '@angular/core';
+import { IonicApp, IonicModule } from '../../../..';
+
+
+@Component({
+ templateUrl: 'main.html'
+})
+export class E2EPage {}
+
+@Component({
+ template: '
'
+})
+export class E2EApp {
+ rootPage = E2EPage;
+}
+
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EPage
+ ]
+})
+export class AppModule {}
diff --git a/src/components/card/test/map/index.ts b/src/components/card/test/map/index.ts
deleted file mode 100644
index 7b73dae881..0000000000
--- a/src/components/card/test/map/index.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-import { Component } from '@angular/core';
-import { ionicBootstrap } from '../../../../../src';
-
-
-@Component({
- templateUrl: 'main.html'
-})
-class E2EPage {}
-
-@Component({
- template: '
'
-})
-class E2EApp {
- rootPage = E2EPage;
-}
-
-ionicBootstrap(E2EApp);
diff --git a/src/components/card/test/social/app-module.ts b/src/components/card/test/social/app-module.ts
new file mode 100644
index 0000000000..0bf1cc361b
--- /dev/null
+++ b/src/components/card/test/social/app-module.ts
@@ -0,0 +1,30 @@
+import { Component, NgModule } from '@angular/core';
+import { IonicApp, IonicModule } from '../../../..';
+
+
+@Component({
+ templateUrl: 'main.html'
+})
+export class E2EPage {}
+
+@Component({
+ template: '
'
+})
+export class E2EApp {
+ rootPage = E2EPage;
+}
+
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EPage
+ ]
+})
+export class AppModule {}
diff --git a/src/components/card/test/social/index.ts b/src/components/card/test/social/index.ts
deleted file mode 100644
index 7b73dae881..0000000000
--- a/src/components/card/test/social/index.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-import { Component } from '@angular/core';
-import { ionicBootstrap } from '../../../../../src';
-
-
-@Component({
- templateUrl: 'main.html'
-})
-class E2EPage {}
-
-@Component({
- template: '
'
-})
-class E2EApp {
- rootPage = E2EPage;
-}
-
-ionicBootstrap(E2EApp);
diff --git a/src/components/checkbox/test/basic/index.ts b/src/components/checkbox/test/basic/app-module.ts
similarity index 61%
rename from src/components/checkbox/test/basic/index.ts
rename to src/components/checkbox/test/basic/app-module.ts
index 3aca511ad3..6db2907631 100644
--- a/src/components/checkbox/test/basic/index.ts
+++ b/src/components/checkbox/test/basic/app-module.ts
@@ -1,13 +1,12 @@
-import { Component } from '@angular/core';
+import { Component, NgModule } from '@angular/core';
import { FormControl, FormGroup } from '@angular/forms';
-import { ionicBootstrap, Checkbox } from '../../../../../src';
+import { IonicApp, IonicModule, Checkbox } from '../../../..';
@Component({
templateUrl: 'main.html'
})
-class E2EPage {
- fruitsForm: FormGroup;
+export class E2EPage {
grapeDisabled: boolean;
grapeChecked: boolean;
kiwiValue: boolean;
@@ -16,14 +15,19 @@ class E2EPage {
formResults: string;
dangerColor: string = 'danger';
- constructor() {
- this.fruitsForm = new FormGroup({
- 'appleCtrl': new FormControl(true),
- 'bananaCtrl': new FormControl(true),
- 'cherryCtrl': new FormControl(false),
- 'grapeCtrl': new FormControl(true)
- });
+ appleCtrl = new FormControl(true);
+ bananaCtrl = new FormControl(true);
+ cherryCtrl = new FormControl(false);
+ grapeCtrl = new FormControl(true);
+ fruitsForm = new FormGroup({
+ 'apple': this.appleCtrl,
+ 'banana': this.bananaCtrl,
+ 'cherry': this.cherryCtrl,
+ 'grape': this.grapeCtrl
+ });
+
+ constructor() {
this.grapeDisabled = true;
this.grapeChecked = true;
this.standAloneChecked = true;
@@ -57,8 +61,22 @@ class E2EPage {
@Component({
template: '
'
})
-class E2EApp {
+export class E2EApp {
rootPage = E2EPage;
}
-ionicBootstrap(E2EApp);
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EPage
+ ]
+})
+export class AppModule {}
+
diff --git a/src/components/checkbox/test/basic/e2e.ts b/src/components/checkbox/test/basic/e2e.ts
index baf77566e1..bbf32ab57e 100644
--- a/src/components/checkbox/test/basic/e2e.ts
+++ b/src/components/checkbox/test/basic/e2e.ts
@@ -1,6 +1,6 @@
it('should check apple, enable/check grape, submit form', function() {
- element(by.css('[formControlName=appleCtrl]')).click();
+ element(by.css('[formControlName=apple]')).click();
element(by.css('.e2eGrapeDisabled')).click();
element(by.css('.e2eGrapeChecked')).click();
element(by.css('.e2eSubmit')).click();
diff --git a/src/components/checkbox/test/basic/main.html b/src/components/checkbox/test/basic/main.html
index 6f19e34aac..5f403370ff 100644
--- a/src/components/checkbox/test/basic/main.html
+++ b/src/components/checkbox/test/basic/main.html
@@ -15,22 +15,22 @@
Apple, formControlName
-
+
Banana, formControlName
-
+
Cherry, formControlName, disabled
-
+
Grape, formControlName, checked, disabled
-
+
@@ -74,14 +74,14 @@
- appleCtrl.dirty: {{fruitsForm.controls.appleCtrl.dirty}}
- appleCtrl.value: {{fruitsForm.controls.appleCtrl.value}}
- bananaCtrl.dirty: {{fruitsForm.controls.bananaCtrl.dirty}}
- bananaCtrl.value: {{fruitsForm.controls.bananaCtrl.value}}
- cherry.dirty: {{fruitsForm.controls.cherryCtrl.dirty}}
- cherry.value: {{fruitsForm.controls.cherryCtrl.value}}
- grape.dirty: {{fruitsForm.controls.grapeCtrl.dirty}}
- grape.value: {{fruitsForm.controls.grapeCtrl.value}}
+ appleCtrl.dirty: {{appleCtrl.dirty}}
+ appleCtrl.value: {{appleCtrl.value}}
+ bananaCtrl.dirty: {{bananaCtrl.dirty}}
+ bananaCtrl.value: {{bananaCtrl.value}}
+ cherry.dirty: {{cherryCtrl.dirty}}
+ cherry.value: {{cherryCtrl.value}}
+ grape.dirty: {{grapeCtrl.dirty}}
+ grape.value: {{grapeCtrl.value}}
kiwiValue: {{kiwiValue}}
strawberryValue: {{strawberryValue}}
diff --git a/src/components/chip/test/basic/app-module.ts b/src/components/chip/test/basic/app-module.ts
new file mode 100644
index 0000000000..94d8cdd600
--- /dev/null
+++ b/src/components/chip/test/basic/app-module.ts
@@ -0,0 +1,34 @@
+import { Component, NgModule } from '@angular/core';
+import { IonicApp, IonicModule } from '../../../..';
+
+
+@Component({
+ templateUrl: 'main.html'
+})
+export class E2EPage {
+ delete(chip: Element) {
+ chip.remove();
+ }
+}
+
+@Component({
+ template: ''
+})
+export class E2EApp {
+ rootPage = E2EPage;
+}
+
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EPage
+ ]
+})
+export class AppModule {}
diff --git a/src/components/tabs/test/child-navs/e2e.ts b/src/components/chip/test/basic/e2e.ts
similarity index 100%
rename from src/components/tabs/test/child-navs/e2e.ts
rename to src/components/chip/test/basic/e2e.ts
diff --git a/src/components/chip/test/basic/index.ts b/src/components/chip/test/basic/index.ts
deleted file mode 100644
index a8201efd55..0000000000
--- a/src/components/chip/test/basic/index.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-import { Component } from '@angular/core';
-import { ionicBootstrap } from '../../../../../src';
-
-
-@Component({
- templateUrl: 'main.html'
-})
-class E2EPage {
- delete(chip: Element) {
- chip.remove();
- }
-}
-
-@Component({
- template: ''
-})
-class E2EApp {
- rootPage = E2EPage;
-}
-
-ionicBootstrap(E2EApp);
diff --git a/src/components/content/test/basic/index.ts b/src/components/content/test/basic/app-module.ts
similarity index 54%
rename from src/components/content/test/basic/index.ts
rename to src/components/content/test/basic/app-module.ts
index 1686469c15..f3b204d749 100644
--- a/src/components/content/test/basic/index.ts
+++ b/src/components/content/test/basic/app-module.ts
@@ -1,11 +1,10 @@
-import { Component, ViewChild } from '@angular/core';
-import { Content, ionicBootstrap } from '../../../../../src';
-
+import { Component, NgModule, ViewChild } from '@angular/core';
+import { IonicApp, IonicModule, Content } from '../../../..';
@Component({
templateUrl: 'tabs.html'
})
-class TabsPage {
+export class TabsPage {
main = E2EPage;
page1 = Page1;
page2 = Page2;
@@ -17,7 +16,7 @@ class TabsPage {
@Component({
templateUrl: 'page4.html'
})
-class Page4 {
+export class Page4 {
tabsPage = TabsPage;
}
@@ -25,7 +24,7 @@ class Page4 {
@Component({
templateUrl: 'page3.html'
})
-class Page3 {
+export class Page3 {
page4 = Page4;
}
@@ -33,7 +32,7 @@ class Page3 {
@Component({
templateUrl: 'page2.html'
})
-class Page2 {
+export class Page2 {
page3 = Page3;
}
@@ -41,7 +40,7 @@ class Page2 {
@Component({
templateUrl: 'page1.html'
})
-class Page1 {
+export class Page1 {
page2 = Page2;
}
@@ -49,7 +48,7 @@ class Page1 {
@Component({
templateUrl: 'main.html'
})
-class E2EPage {
+export class E2EPage {
@ViewChild(Content) content: Content;
page1 = Page1;
showToolbar: boolean = false;
@@ -64,8 +63,32 @@ class E2EPage {
@Component({
template: ''
})
-class E2EApp {
+export class E2EApp {
root = E2EPage;
}
-ionicBootstrap(E2EApp);
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage,
+ TabsPage,
+ Page1,
+ Page2,
+ Page3,
+ Page4
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EApp,
+ E2EPage,
+ TabsPage,
+ Page1,
+ Page2,
+ Page3,
+ Page4
+ ]
+})
+export class AppModule {}
diff --git a/src/components/content/test/fullscreen/app-module.ts b/src/components/content/test/fullscreen/app-module.ts
new file mode 100644
index 0000000000..5e1671d1b8
--- /dev/null
+++ b/src/components/content/test/fullscreen/app-module.ts
@@ -0,0 +1,88 @@
+import { Component, NgModule } from '@angular/core';
+import { IonicApp, IonicModule } from '../../../..';
+
+
+@Component({
+ templateUrl: 'tabs.html'
+})
+export class TabsPage {
+ main = E2EPage;
+ page1 = Page1;
+ page2 = Page2;
+ page3 = Page3;
+ page4 = Page4;
+}
+
+
+@Component({
+ templateUrl: 'page4.html'
+})
+export class Page4 {
+ tabsPage = TabsPage;
+}
+
+
+@Component({
+ templateUrl: 'page3.html'
+})
+export class Page3 {
+ page4 = Page4;
+}
+
+
+@Component({
+ templateUrl: 'page2.html'
+})
+export class Page2 {
+ page3 = Page3;
+}
+
+
+@Component({
+ templateUrl: 'page1.html'
+})
+export class Page1 {
+ page2 = Page2;
+}
+
+
+@Component({
+ templateUrl: 'main.html'
+})
+export class E2EPage {
+ page1 = Page1;
+}
+
+
+@Component({
+ template: ''
+})
+export class E2EApp {
+ root = E2EPage;
+}
+
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage,
+ TabsPage,
+ Page1,
+ Page2,
+ Page3,
+ Page4
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EApp,
+ E2EPage,
+ TabsPage,
+ Page1,
+ Page2,
+ Page3,
+ Page4
+ ]
+})
+export class AppModule {}
diff --git a/src/components/content/test/fullscreen/index.ts b/src/components/content/test/fullscreen/index.ts
deleted file mode 100644
index e6becc4968..0000000000
--- a/src/components/content/test/fullscreen/index.ts
+++ /dev/null
@@ -1,64 +0,0 @@
-import { Component } from '@angular/core';
-import { ionicBootstrap } from '../../../../../src';
-
-
-@Component({
- templateUrl: 'tabs.html'
-})
-class TabsPage {
- main = E2EPage;
- page1 = Page1;
- page2 = Page2;
- page3 = Page3;
- page4 = Page4;
-}
-
-
-@Component({
- templateUrl: 'page4.html'
-})
-class Page4 {
- tabsPage = TabsPage;
-}
-
-
-@Component({
- templateUrl: 'page3.html'
-})
-class Page3 {
- page4 = Page4;
-}
-
-
-@Component({
- templateUrl: 'page2.html'
-})
-class Page2 {
- page3 = Page3;
-}
-
-
-@Component({
- templateUrl: 'page1.html'
-})
-class Page1 {
- page2 = Page2;
-}
-
-
-@Component({
- templateUrl: 'main.html'
-})
-class E2EPage {
- page1 = Page1;
-}
-
-
-@Component({
- template: ''
-})
-class E2EApp {
- root = E2EPage;
-}
-
-ionicBootstrap(E2EApp);
diff --git a/src/components/datetime/test/basic/index.ts b/src/components/datetime/test/basic/app-module.ts
similarity index 71%
rename from src/components/datetime/test/basic/index.ts
rename to src/components/datetime/test/basic/app-module.ts
index 0e4cda566d..ed294d8c2a 100644
--- a/src/components/datetime/test/basic/index.ts
+++ b/src/components/datetime/test/basic/app-module.ts
@@ -1,11 +1,12 @@
-import { Component } from '@angular/core';
-import { ionicBootstrap } from '../../../../../src';
+import { Component, NgModule } from '@angular/core';
+import { IonicApp, IonicModule } from '../../../..';
+
@Component({
templateUrl: 'main.html'
})
-class E2EPage {
+export class E2EPage {
myDate: any;
wwwInvented = '1989';
time = '13:47:00';
@@ -51,8 +52,21 @@ class E2EPage {
@Component({
template: ''
})
-class E2EApp {
+export class E2EApp {
root = E2EPage;
}
-ionicBootstrap(E2EApp);
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EPage
+ ]
+})
+export class AppModule {}
diff --git a/src/components/datetime/test/basic/e2e.ts b/src/components/datetime/test/basic/e2e.ts
index d572f477d2..62a3507105 100644
--- a/src/components/datetime/test/basic/e2e.ts
+++ b/src/components/datetime/test/basic/e2e.ts
@@ -4,5 +4,5 @@ it('should open basic datetime picker', function() {
});
it('should close with Done button click', function() {
- element(by.css('.picker-button:last-child')).click();
+ element(by.css('.picker-toolbar-button:last-child .button')).click();
});
diff --git a/src/components/datetime/test/datetime.spec.ts b/src/components/datetime/test/datetime.spec.ts
index 85650bf438..696adaef73 100644
--- a/src/components/datetime/test/datetime.spec.ts
+++ b/src/components/datetime/test/datetime.spec.ts
@@ -1,7 +1,10 @@
-import { DateTime, Form, Picker, Config, NavController } from '../../../../src';
-import * as datetime from '../../../../src/util/datetime-util';
-export function run() {
+import { DateTime } from '../datetime';
+import { Form } from '../../../util/form';
+import { Picker, PickerController } from '../../picker/picker';
+import * as datetime from '../../../util/datetime-util';
+import { mockApp, mockConfig, mockElementRef, mockRenderer } from '../../../util/mock-providers';
+
describe('DateTime', () => {
@@ -11,7 +14,7 @@ describe('DateTime', () => {
datetime.max = '2001-12-15';
datetime.min = '2000-01-15';
datetime.pickerFormat = 'MM DD YYYY';
- var picker = new Picker();
+ var picker = new Picker(mockApp());
datetime.generate(picker);
var columns = picker.getColumns();
@@ -41,7 +44,7 @@ describe('DateTime', () => {
datetime.max = '2010-11-15';
datetime.min = '2000-02-15';
datetime.pickerFormat = 'MM DD YYYY';
- var picker = new Picker();
+ var picker = new Picker(mockApp());
datetime.generate(picker);
var columns = picker.getColumns();
@@ -69,7 +72,7 @@ describe('DateTime', () => {
datetime.min = '2000-01-01';
datetime.pickerFormat = 'MM DD YYYY';
- var picker = new Picker();
+ var picker = new Picker(mockApp());
datetime.generate(picker);
var columns = picker.getColumns();
@@ -112,7 +115,7 @@ describe('DateTime', () => {
datetime.pickerFormat = 'MMM YYYY';
datetime.setValue('1994-12-15T13:47:20.789Z');
- var picker = new Picker();
+ var picker = new Picker(mockApp());
datetime.generate(picker);
var columns = picker.getColumns();
@@ -128,7 +131,7 @@ describe('DateTime', () => {
datetime.pickerFormat = 'MMMM YYYY';
datetime.setValue('1994-12-15T13:47:20.789Z');
- var picker = new Picker();
+ var picker = new Picker(mockApp());
datetime.generate(picker);
var columns = picker.getColumns();
@@ -142,7 +145,7 @@ describe('DateTime', () => {
datetime.pickerFormat = 'DDDD D M YYYY';
datetime.setValue('1994-12-15T13:47:20.789Z');
- var picker = new Picker();
+ var picker = new Picker(mockApp());
datetime.generate(picker);
var columns = picker.getColumns();
@@ -156,7 +159,7 @@ describe('DateTime', () => {
datetime.pickerFormat = 'DDDD M YYYY';
datetime.setValue('1994-12-15T13:47:20.789Z');
- var picker = new Picker();
+ var picker = new Picker(mockApp());
datetime.generate(picker);
var columns = picker.getColumns();
@@ -171,7 +174,7 @@ describe('DateTime', () => {
datetime.min = '2000-01-01';
datetime.pickerFormat = 'MM DD YYYY';
- var picker = new Picker();
+ var picker = new Picker(mockApp());
datetime.generate(picker);
var columns = picker.getColumns();
@@ -194,7 +197,7 @@ describe('DateTime', () => {
datetime.min = '2000-01-01';
datetime.pickerFormat = 'YYYY';
- var picker = new Picker();
+ var picker = new Picker(mockApp());
datetime.generate(picker);
var columns = picker.getColumns();
@@ -472,7 +475,7 @@ describe('DateTime', () => {
var datetime: DateTime;
beforeEach(() => {
- datetime = new DateTime(new Form(), new Config(), null, {});
+ datetime = new DateTime(new Form(), mockConfig(), mockElementRef(), mockRenderer(), null, {});
});
console.warn = function(){};
@@ -528,5 +531,3 @@ describe('DateTime', () => {
};
});
-
-}
diff --git a/src/components/datetime/test/labels/app-module.ts b/src/components/datetime/test/labels/app-module.ts
new file mode 100644
index 0000000000..02f511a4ec
--- /dev/null
+++ b/src/components/datetime/test/labels/app-module.ts
@@ -0,0 +1,41 @@
+import { Component, NgModule } from '@angular/core';
+import { IonicApp, IonicModule } from '../../../..';
+
+
+
+@Component({
+ templateUrl: 'main.html'
+})
+export class E2EPage {
+ stacked1 = '1994-12-15T13:47:20.789';
+ stacked2 = '1994-12-15T13:47:20.789';
+ floating1 = '1995-04-15';
+ floating2 = '1995-04-15';
+ fixed1 = '2002-09-23T15:03:46.789';
+ fixed2 = '2002-09-23T15:03:46.789';
+ inline1 = '2005-06-17T11:06Z';
+ inline2 = '2005-06-17T11:06Z';
+}
+
+
+@Component({
+ template: ''
+})
+export class E2EApp {
+ root = E2EPage;
+}
+
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EPage
+ ]
+})
+export class AppModule {}
diff --git a/src/components/datetime/test/labels/index.ts b/src/components/datetime/test/labels/index.ts
deleted file mode 100644
index 2302fd981b..0000000000
--- a/src/components/datetime/test/labels/index.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-import { Component } from '@angular/core';
-import { ionicBootstrap } from '../../../../../src';
-
-
-@Component({
- templateUrl: 'main.html'
-})
-class E2EPage {
- stacked2 = '1994-12-15T13:47:20.789';
- floating2 = '1995-04-15';
- fixed2 = '2002-09-23T15:03:46.789';
- inline2 = '2005-06-17T11:06Z';
-}
-
-
-@Component({
- template: ''
-})
-class E2EApp {
- root = E2EPage;
-}
-
-ionicBootstrap(E2EApp);
diff --git a/src/components/grid/test/alignment/app-module.ts b/src/components/grid/test/alignment/app-module.ts
new file mode 100644
index 0000000000..585d1e6adb
--- /dev/null
+++ b/src/components/grid/test/alignment/app-module.ts
@@ -0,0 +1,33 @@
+import { Component, NgModule } from '@angular/core';
+import { IonicApp, IonicModule } from '../../../..';
+
+
+@Component({
+ templateUrl: 'main.html'
+})
+export class E2EPage {}
+
+
+@Component({
+ template: ''
+})
+export class E2EApp {
+ rootPage = E2EPage;
+}
+
+
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EApp,
+ E2EPage
+ ]
+})
+export class AppModule {}
diff --git a/src/components/grid/test/alignment/index.ts b/src/components/grid/test/alignment/index.ts
deleted file mode 100644
index 7b73dae881..0000000000
--- a/src/components/grid/test/alignment/index.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-import { Component } from '@angular/core';
-import { ionicBootstrap } from '../../../../../src';
-
-
-@Component({
- templateUrl: 'main.html'
-})
-class E2EPage {}
-
-@Component({
- template: ''
-})
-class E2EApp {
- rootPage = E2EPage;
-}
-
-ionicBootstrap(E2EApp);
diff --git a/src/components/grid/test/basic/app-module.ts b/src/components/grid/test/basic/app-module.ts
new file mode 100644
index 0000000000..0b1da1f6aa
--- /dev/null
+++ b/src/components/grid/test/basic/app-module.ts
@@ -0,0 +1,31 @@
+import { Component, NgModule } from '@angular/core';
+import { IonicApp, IonicModule } from '../../../..';
+
+
+@Component({
+ templateUrl: 'main.html'
+})
+export class E2EPage {}
+
+@Component({
+ template: ''
+})
+export class E2EApp {
+ rootPage = E2EPage;
+}
+
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EPage,
+ E2EApp
+ ]
+})
+export class AppModule {}
diff --git a/src/components/grid/test/basic/index.ts b/src/components/grid/test/basic/index.ts
deleted file mode 100644
index 7b73dae881..0000000000
--- a/src/components/grid/test/basic/index.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-import { Component } from '@angular/core';
-import { ionicBootstrap } from '../../../../../src';
-
-
-@Component({
- templateUrl: 'main.html'
-})
-class E2EPage {}
-
-@Component({
- template: ''
-})
-class E2EApp {
- rootPage = E2EPage;
-}
-
-ionicBootstrap(E2EApp);
diff --git a/src/components/grid/test/full/app-module.ts b/src/components/grid/test/full/app-module.ts
new file mode 100644
index 0000000000..0b1da1f6aa
--- /dev/null
+++ b/src/components/grid/test/full/app-module.ts
@@ -0,0 +1,31 @@
+import { Component, NgModule } from '@angular/core';
+import { IonicApp, IonicModule } from '../../../..';
+
+
+@Component({
+ templateUrl: 'main.html'
+})
+export class E2EPage {}
+
+@Component({
+ template: ''
+})
+export class E2EApp {
+ rootPage = E2EPage;
+}
+
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EPage,
+ E2EApp
+ ]
+})
+export class AppModule {}
diff --git a/src/components/grid/test/full/index.ts b/src/components/grid/test/full/index.ts
deleted file mode 100644
index 7b73dae881..0000000000
--- a/src/components/grid/test/full/index.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-import { Component } from '@angular/core';
-import { ionicBootstrap } from '../../../../../src';
-
-
-@Component({
- templateUrl: 'main.html'
-})
-class E2EPage {}
-
-@Component({
- template: ''
-})
-class E2EApp {
- rootPage = E2EPage;
-}
-
-ionicBootstrap(E2EApp);
diff --git a/src/components/icon/test/basic/index.ts b/src/components/icon/test/basic/app-module.ts
similarity index 62%
rename from src/components/icon/test/basic/index.ts
rename to src/components/icon/test/basic/app-module.ts
index 5abd534d8b..def52a70a4 100644
--- a/src/components/icon/test/basic/index.ts
+++ b/src/components/icon/test/basic/app-module.ts
@@ -1,10 +1,10 @@
-import { Component } from '@angular/core';
-import { ionicBootstrap } from '../../../../../src';
+import { Component, NgModule } from '@angular/core';
+import { IonicApp, IonicModule } from '../../../..';
@Component({
templateUrl: 'main.html'
})
-class E2EPage {
+export class E2EPage {
homeIcon = 'home';
isActive = false;
iconIndex = 0;
@@ -35,8 +35,21 @@ class E2EPage {
@Component({
template: ''
})
-class E2EApp {
+export class E2EApp {
rootPage = E2EPage;
}
-ionicBootstrap(E2EApp);
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EPage
+ ]
+})
+export class AppModule {}
diff --git a/src/components/infinite-scroll/test/basic/index.ts b/src/components/infinite-scroll/test/basic/app-module.ts
similarity index 75%
rename from src/components/infinite-scroll/test/basic/index.ts
rename to src/components/infinite-scroll/test/basic/app-module.ts
index 6155dabbfa..03c4220ff9 100644
--- a/src/components/infinite-scroll/test/basic/index.ts
+++ b/src/components/infinite-scroll/test/basic/app-module.ts
@@ -1,11 +1,11 @@
-import { Component, ViewChild } from '@angular/core';
-import { ionicBootstrap, InfiniteScroll, NavController } from '../../../../../src';
+import { Component, ViewChild, NgModule } from '@angular/core';
+import { IonicApp, IonicModule, InfiniteScroll, NavController } from '../../../..';
@Component({
templateUrl: 'main.html'
})
-class E2EPage1 {
+export class E2EPage1 {
@ViewChild(InfiniteScroll) infiniteScroll: InfiniteScroll;
items: number[] = [];
enabled: boolean = true;
@@ -48,7 +48,7 @@ class E2EPage1 {
@Component({
template: ''
})
-class E2EPage2 {
+export class E2EPage2 {
constructor(public navCtrl: NavController) {}
}
@@ -56,11 +56,27 @@ class E2EPage2 {
@Component({
template: ''
})
-class E2EApp {
+export class E2EApp {
root = E2EPage1;
}
-ionicBootstrap(E2EApp);
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage1,
+ E2EPage2
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EApp,
+ E2EPage1,
+ E2EPage2
+ ]
+})
+export class AppModule {}
function getAsyncData(): Promise {
diff --git a/src/components/infinite-scroll/test/infinite-scroll.spec.ts b/src/components/infinite-scroll/test/infinite-scroll.spec.ts
index 457c50ad06..8c4682d2a9 100644
--- a/src/components/infinite-scroll/test/infinite-scroll.spec.ts
+++ b/src/components/infinite-scroll/test/infinite-scroll.spec.ts
@@ -1,6 +1,7 @@
-import { InfiniteScroll, Content, Config } from '../../../../src';
+import { Content } from '../../content/content';
+import { InfiniteScroll } from '../infinite-scroll';
+import { mockConfig, mockElementRef, mockRenderer, mockZone } from '../../../util/mock-providers';
-export function run() {
describe('Infinite Scroll', () => {
@@ -9,56 +10,57 @@ describe('Infinite Scroll', () => {
it('should not set loading state when does not meet threshold', () => {
setInfiniteScrollHeight(25);
content.getContentDimensions = function() {
- return { scrollHeight: 1000, scrollTop: 350, contentHeight: 500 };
+ return mockGetContentDimensions(1000, 350, 500);
};
+
inf.threshold = '100px';
setInfiniteScrollTop(300);
- var result = inf._onScroll(scrollEv());
+ var result = inf._onScroll();
expect(result).toEqual(6);
});
it('should set loading state when meets threshold', () => {
setInfiniteScrollHeight(25);
content.getContentDimensions = function() {
- return { scrollHeight: 1000, scrollTop: 500, contentHeight: 500 };
+ return mockGetContentDimensions(1000, 500, 500);
};
inf.threshold = '100px';
setInfiniteScrollTop(300);
- var result = inf._onScroll(scrollEv());
+ var result = inf._onScroll();
expect(result).toEqual(5);
});
it('should not run if there is not infinite element height', () => {
setInfiniteScrollTop(0);
- var result = inf._onScroll(scrollEv());
+ var result = inf._onScroll();
expect(result).toEqual(3);
});
it('should not run again if ran less than 32ms ago', () => {
inf._lastCheck = Date.now();
- var result = inf._onScroll(scrollEv());
+ var result = inf._onScroll();
expect(result).toEqual(2);
});
it('should not run if state is disabled', () => {
inf.state = 'disabled';
- var result = inf._onScroll(scrollEv());
+ var result = inf._onScroll();
expect(result).toEqual(1);
});
it('should not run if state is loading', () => {
inf.state = 'loading';
- var result = inf._onScroll(scrollEv());
+ var result = inf._onScroll();
expect(result).toEqual(1);
});
it('should not run if not enabled', () => {
inf.state = 'disabled';
- var result = inf._onScroll(scrollEv());
+ var result = inf._onScroll();
expect(result).toEqual(1);
});
@@ -88,39 +90,22 @@ describe('Infinite Scroll', () => {
});
- let config = new Config();
+ let config = mockConfig();
let inf: InfiniteScroll;
let content: Content;
let contentElementRef;
let infiniteElementRef;
- let zone = {
- run: function(cb) {cb()},
- runOutsideAngular: function(cb) {cb()}
- };
beforeEach(() => {
contentElementRef = mockElementRef();
- content = new Content(contentElementRef, config, null, null, null);
- content.scrollElement = document.createElement('scroll-content');
+ content = new Content(config, contentElementRef, mockRenderer(), null, null, null, null, null);
+ content._scrollEle = document.createElement('div');
+ content._scrollEle.className = 'scroll-content';
infiniteElementRef = mockElementRef();
- inf = new InfiniteScroll(content, zone, infiniteElementRef);
+ inf = new InfiniteScroll(content, mockZone(), infiniteElementRef);
});
- function scrollEv() {
- return {}
- }
-
- function mockElementRef() {
- return {
- nativeElement: {
- classList: { add: function(){}, remove: function(){} },
- scrollTop: 0,
- hasAttribute: function(){}
- }
- }
- }
-
function setInfiniteScrollTop(scrollTop) {
infiniteElementRef.nativeElement.scrollTop = scrollTop;
}
@@ -129,10 +114,22 @@ describe('Infinite Scroll', () => {
infiniteElementRef.nativeElement.scrollHeight = scrollHeight;
}
- function getScrollElementStyles() {
- return content.scrollElement.style;
+ function mockGetContentDimensions(scrollHeight, scrollTop, contentHeight) {
+ return {
+ scrollHeight: scrollHeight,
+ scrollTop: scrollTop,
+ contentHeight: contentHeight,
+
+ contentTop: null,
+ contentBottom: null,
+ contentWidth: null,
+ contentLeft: null,
+ contentRight: null,
+ scrollBottom: null,
+ scrollWidth: null,
+ scrollLeft: null,
+ scrollRight: null
+ };
}
});
-
-}
diff --git a/src/components/infinite-scroll/test/short-list/index.ts b/src/components/infinite-scroll/test/short-list/app-module.ts
similarity index 72%
rename from src/components/infinite-scroll/test/short-list/index.ts
rename to src/components/infinite-scroll/test/short-list/app-module.ts
index 83a7e8a3bd..d1520e66a0 100644
--- a/src/components/infinite-scroll/test/short-list/index.ts
+++ b/src/components/infinite-scroll/test/short-list/app-module.ts
@@ -1,11 +1,11 @@
-import { Component, ViewChild } from '@angular/core';
-import { ionicBootstrap, InfiniteScroll } from '../../../../../src';
+import { Component, NgModule } from '@angular/core';
+import { IonicApp, IonicModule, InfiniteScroll } from '../../../..';
@Component({
templateUrl: 'main.html'
})
-class E2EPage {
+export class E2EPage {
items: number[] = [];
constructor() {
@@ -36,11 +36,24 @@ class E2EPage {
@Component({
template: ''
})
-class E2EApp {
+export class E2EApp {
rootPage = E2EPage;
}
-ionicBootstrap(E2EApp);
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EPage
+ ]
+})
+export class AppModule {}
function getAsyncData(): Promise {
// async return mock data
diff --git a/src/components/input/test/clear-input/app-module.ts b/src/components/input/test/clear-input/app-module.ts
new file mode 100644
index 0000000000..75ad236e29
--- /dev/null
+++ b/src/components/input/test/clear-input/app-module.ts
@@ -0,0 +1,36 @@
+import { Component, NgModule } from '@angular/core';
+import { IonicApp, IonicModule } from '../../../..';
+
+
+@Component({
+ templateUrl: 'main.html'
+})
+export class E2EPage {
+ myValue = 'value';
+
+ clicked() {
+ console.log('clicked button');
+ }
+}
+
+@Component({
+ template: ''
+})
+export class E2EApp {
+ rootPage = E2EPage;
+}
+
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EPage
+ ]
+})
+export class AppModule {}
diff --git a/src/components/input/test/clear-input/index.ts b/src/components/input/test/clear-input/index.ts
deleted file mode 100644
index 30e90230e5..0000000000
--- a/src/components/input/test/clear-input/index.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-import { Component } from '@angular/core';
-import { ionicBootstrap } from '../../../../../src';
-
-
-@Component({
- templateUrl: 'main.html'
-})
-class E2EPage {
- myValue = 'value';
-
- clicked() {
- console.log('clicked button');
- }
-}
-
-@Component({
- template: ''
-})
-class E2EApp {
- rootPage = E2EPage;
-}
-
-ionicBootstrap(E2EApp);
diff --git a/src/components/input/test/fixed-inline-labels/app-module.ts b/src/components/input/test/fixed-inline-labels/app-module.ts
new file mode 100644
index 0000000000..cea93c0862
--- /dev/null
+++ b/src/components/input/test/fixed-inline-labels/app-module.ts
@@ -0,0 +1,37 @@
+import { Component, NgModule } from '@angular/core';
+import { IonicApp, IonicModule } from '../../../..';
+
+
+@Component({
+ templateUrl: 'main.html'
+})
+export class PageOne {
+ url: string;
+ input1: string = 'Text 1';
+
+ onEvent(event: any) {
+ console.log('Did Event:', event.type);
+ }
+}
+
+@Component({
+ template: ''
+})
+export class E2EApp {
+ root = PageOne;
+}
+
+@NgModule({
+ declarations: [
+ E2EApp,
+ PageOne
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ PageOne
+ ]
+})
+export class AppModule {}
diff --git a/src/components/input/test/fixed-inline-labels/index.ts b/src/components/input/test/fixed-inline-labels/index.ts
deleted file mode 100644
index c85dfe5e09..0000000000
--- a/src/components/input/test/fixed-inline-labels/index.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-import { Component } from '@angular/core';
-import { ionicBootstrap } from '../../../../../src';
-
-
-@Component({
- templateUrl: 'main.html'
-})
-class PageOne {
- url: string;
- input1: string = 'Text 1';
-
- onEvent(event: any) {
- console.log('Did Event:', event.type);
- }
-}
-
-@Component({
- template: ''
-})
-class E2EApp {
- root = PageOne;
-}
-
-ionicBootstrap(E2EApp);
diff --git a/src/components/input/test/floating-labels/app-module.ts b/src/components/input/test/floating-labels/app-module.ts
new file mode 100644
index 0000000000..6c4470b8da
--- /dev/null
+++ b/src/components/input/test/floating-labels/app-module.ts
@@ -0,0 +1,37 @@
+import { Component, NgModule } from '@angular/core';
+import { IonicApp, IonicModule } from '../../../..';
+
+
+@Component({
+ templateUrl: 'main.html'
+})
+export class E2EPage {
+ myParam = '';
+
+ myValues = {
+ value1: 'Dynamic Input',
+ value2: 'Dynamic Textarea'
+ };
+}
+
+@Component({
+ template: ''
+})
+export class E2EApp {
+ rootPage = E2EPage;
+}
+
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EPage
+ ]
+})
+export class AppModule {}
diff --git a/src/components/input/test/floating-labels/index.ts b/src/components/input/test/floating-labels/index.ts
deleted file mode 100644
index f87a5e542a..0000000000
--- a/src/components/input/test/floating-labels/index.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-import { Component } from '@angular/core';
-import { ionicBootstrap } from '../../../../../src';
-
-
-@Component({
- templateUrl: 'main.html'
-})
-class E2EPage {
- myParam = '';
-
- myValues = {
- value1: 'Dynamic Input',
- value2: 'Dynamic Textarea'
- };
-}
-
-@Component({
- template: ''
-})
-class E2EApp {
- rootPage = E2EPage;
-}
-
-ionicBootstrap(E2EApp);
diff --git a/src/components/input/test/form-inputs/index.ts b/src/components/input/test/form-inputs/app-module.ts
similarity index 71%
rename from src/components/input/test/form-inputs/index.ts
rename to src/components/input/test/form-inputs/app-module.ts
index 69b19ec985..0d6e7e6684 100644
--- a/src/components/input/test/form-inputs/index.ts
+++ b/src/components/input/test/form-inputs/app-module.ts
@@ -1,18 +1,21 @@
-import { Component } from '@angular/core';
-import { FormBuilder, Validators } from '@angular/common';
-import { ionicBootstrap } from '../../../../../src';
+import { FormBuilder, Validators } from '@angular/forms';
+import { Component, NgModule } from '@angular/core';
+import { IonicApp, IonicModule } from '../../../..';
@Component({
templateUrl: 'main.html'
})
-class E2EPage {
+export class E2EPage {
loginForm: any;
userForm: any;
login = {
email: 'help@ionic.io',
- username: 'admin'
+ username: 'admin',
+ password: '',
+ gender: '',
+ comments: ''
};
user = {
@@ -63,8 +66,21 @@ class E2EPage {
@Component({
template: ''
})
-class E2EApp {
+export class E2EApp {
root = E2EPage;
}
-ionicBootstrap(E2EApp);
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EPage
+ ]
+})
+export class AppModule {}
diff --git a/src/components/input/test/highlight/index.ts b/src/components/input/test/highlight/app-module.ts
similarity index 66%
rename from src/components/input/test/highlight/index.ts
rename to src/components/input/test/highlight/app-module.ts
index 83c362040f..9b75b182d6 100644
--- a/src/components/input/test/highlight/index.ts
+++ b/src/components/input/test/highlight/app-module.ts
@@ -1,17 +1,20 @@
-import { Component } from '@angular/core';
-import { FormBuilder, Validators } from '@angular/common';
-import { ionicBootstrap } from '../../../../../src';
+import { FormBuilder, Validators } from '@angular/forms';
+import { Component, NgModule } from '@angular/core';
+import { IonicApp, IonicModule } from '../../../..';
@Component({
templateUrl: 'main.html'
})
-class E2EPage {
+export class E2EPage {
loginForm: any;
login = {
email: 'help@ionic.io',
username: 'admin',
+ password: '',
+ comments: '',
+ inset: ''
};
submitted: boolean = false;
@@ -47,8 +50,22 @@ class E2EPage {
@Component({
template: ''
})
-class E2EApp {
+export class E2EApp {
root = E2EPage;
}
-ionicBootstrap(E2EApp);
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EApp,
+ E2EPage
+ ]
+})
+export class AppModule {}
diff --git a/src/components/input/test/inline-labels/app-module.ts b/src/components/input/test/inline-labels/app-module.ts
new file mode 100644
index 0000000000..9d80310226
--- /dev/null
+++ b/src/components/input/test/inline-labels/app-module.ts
@@ -0,0 +1,35 @@
+import { Component, NgModule } from '@angular/core';
+import { IonicApp, IonicModule } from '../../../..';
+
+
+@Component({
+ templateUrl: 'main.html'
+})
+export class E2EPage {
+
+ submit(ev: any) {
+ console.debug('submit', ev);
+ }
+}
+
+@Component({
+ template: ''
+})
+export class E2EApp {
+ rootPage = E2EPage;
+}
+
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EPage
+ ]
+})
+export class AppModule {}
diff --git a/src/components/input/test/inline-labels/index.ts b/src/components/input/test/inline-labels/index.ts
deleted file mode 100644
index 40d8dc5acf..0000000000
--- a/src/components/input/test/inline-labels/index.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-import { Component } from '@angular/core';
-import { ionicBootstrap } from '../../../../../src';
-
-
-@Component({
- templateUrl: 'main.html'
-})
-class E2EPage {
-
- submit(ev: any) {
- console.debug('submit', ev);
- }
-}
-
-@Component({
- template: ''
-})
-class E2EApp {
- rootPage = E2EPage;
-}
-
-ionicBootstrap(E2EApp);
diff --git a/src/components/input/test/input-focus/index.ts b/src/components/input/test/input-focus/app-module.ts
similarity index 76%
rename from src/components/input/test/input-focus/index.ts
rename to src/components/input/test/input-focus/app-module.ts
index ec023ce30d..fe46ea35dc 100644
--- a/src/components/input/test/input-focus/index.ts
+++ b/src/components/input/test/input-focus/app-module.ts
@@ -1,11 +1,11 @@
-import { Component } from '@angular/core';
-import { ionicBootstrap } from '../../../../../src';
+import { Component, NgModule } from '@angular/core';
+import { IonicApp, IonicModule } from '../../../..';
@Component({
templateUrl: 'main.html'
})
-class E2EPage {
+export class E2EPage {
reload() {
window.location.reload();
}
@@ -36,8 +36,21 @@ document.addEventListener('focusout', (ev: any) => {
@Component({
template: ''
})
-class E2EApp {
+export class E2EApp {
rootPage = E2EPage;
}
-ionicBootstrap(E2EApp);
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EPage
+ ]
+})
+export class AppModule {}
diff --git a/src/components/input/test/input-focus/main.html b/src/components/input/test/input-focus/main.html
index 8b792fab6b..6641f0ef83 100644
--- a/src/components/input/test/input-focus/main.html
+++ b/src/components/input/test/input-focus/main.html
@@ -33,7 +33,7 @@
-
-
+
diff --git a/src/components/list/test/headers/app-module.ts b/src/components/list/test/headers/app-module.ts
new file mode 100644
index 0000000000..1286436e7c
--- /dev/null
+++ b/src/components/list/test/headers/app-module.ts
@@ -0,0 +1,31 @@
+import { Component, NgModule } from '@angular/core';
+import { IonicApp, IonicModule } from '../../../..';
+
+
+@Component({
+ templateUrl: 'main.html'
+})
+export class E2EPage {}
+
+@Component({
+ template: ''
+})
+export class E2EApp {
+ rootPage = E2EPage;
+}
+
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EApp,
+ E2EPage
+ ]
+})
+export class AppModule {}
diff --git a/src/components/list/test/headers/index.ts b/src/components/list/test/headers/index.ts
deleted file mode 100644
index 7b73dae881..0000000000
--- a/src/components/list/test/headers/index.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-import { Component } from '@angular/core';
-import { ionicBootstrap } from '../../../../../src';
-
-
-@Component({
- templateUrl: 'main.html'
-})
-class E2EPage {}
-
-@Component({
- template: ''
-})
-class E2EApp {
- rootPage = E2EPage;
-}
-
-ionicBootstrap(E2EApp);
diff --git a/src/components/list/test/inset/app-module.ts b/src/components/list/test/inset/app-module.ts
new file mode 100644
index 0000000000..1286436e7c
--- /dev/null
+++ b/src/components/list/test/inset/app-module.ts
@@ -0,0 +1,31 @@
+import { Component, NgModule } from '@angular/core';
+import { IonicApp, IonicModule } from '../../../..';
+
+
+@Component({
+ templateUrl: 'main.html'
+})
+export class E2EPage {}
+
+@Component({
+ template: ''
+})
+export class E2EApp {
+ rootPage = E2EPage;
+}
+
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EApp,
+ E2EPage
+ ]
+})
+export class AppModule {}
diff --git a/src/components/list/test/inset/index.ts b/src/components/list/test/inset/index.ts
deleted file mode 100644
index 7b73dae881..0000000000
--- a/src/components/list/test/inset/index.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-import { Component } from '@angular/core';
-import { ionicBootstrap } from '../../../../../src';
-
-
-@Component({
- templateUrl: 'main.html'
-})
-class E2EPage {}
-
-@Component({
- template: ''
-})
-class E2EApp {
- rootPage = E2EPage;
-}
-
-ionicBootstrap(E2EApp);
diff --git a/src/components/list/test/no-lines/app-module.ts b/src/components/list/test/no-lines/app-module.ts
new file mode 100644
index 0000000000..1286436e7c
--- /dev/null
+++ b/src/components/list/test/no-lines/app-module.ts
@@ -0,0 +1,31 @@
+import { Component, NgModule } from '@angular/core';
+import { IonicApp, IonicModule } from '../../../..';
+
+
+@Component({
+ templateUrl: 'main.html'
+})
+export class E2EPage {}
+
+@Component({
+ template: ''
+})
+export class E2EApp {
+ rootPage = E2EPage;
+}
+
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EApp,
+ E2EPage
+ ]
+})
+export class AppModule {}
diff --git a/src/components/list/test/no-lines/index.ts b/src/components/list/test/no-lines/index.ts
deleted file mode 100644
index 7b73dae881..0000000000
--- a/src/components/list/test/no-lines/index.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-import { Component } from '@angular/core';
-import { ionicBootstrap } from '../../../../../src';
-
-
-@Component({
- templateUrl: 'main.html'
-})
-class E2EPage {}
-
-@Component({
- template: ''
-})
-class E2EApp {
- rootPage = E2EPage;
-}
-
-ionicBootstrap(E2EApp);
diff --git a/src/components/list/test/repeat-headers/app-module.ts b/src/components/list/test/repeat-headers/app-module.ts
new file mode 100644
index 0000000000..25a84e2536
--- /dev/null
+++ b/src/components/list/test/repeat-headers/app-module.ts
@@ -0,0 +1,37 @@
+import { Component, NgModule } from '@angular/core';
+import { IonicApp, IonicModule } from '../../../..';
+
+
+@Component({
+ templateUrl: 'main.html'
+})
+export class E2EPage {
+ people = [
+ {'name': 'Burt', 'components': [ 'all the things']},
+ {'name': 'Mary', 'components': [ 'checkbox', 'content', 'form']},
+ {'name': 'Albert', 'components': [ 'tabs']}
+ ];
+}
+
+@Component({
+ template: ''
+})
+export class E2EApp {
+ rootPage = E2EPage;
+}
+
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EApp,
+ E2EPage
+ ]
+})
+export class AppModule {}
diff --git a/src/components/list/test/repeat-headers/index.ts b/src/components/list/test/repeat-headers/index.ts
deleted file mode 100644
index cf6f2df084..0000000000
--- a/src/components/list/test/repeat-headers/index.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-import { Component } from '@angular/core';
-import { ionicBootstrap } from '../../../../../src';
-
-
-@Component({
- templateUrl: 'main.html'
-})
-class E2EPage {
- people = [
- {'name': 'Burt', 'components': [ 'all the things']},
- {'name': 'Mary', 'components': [ 'checkbox', 'content', 'form']},
- {'name': 'Albert', 'components': [ 'tabs']}
- ];
-}
-
-@Component({
- template: ''
-})
-class E2EApp {
- rootPage = E2EPage;
-}
-
-ionicBootstrap(E2EApp);
diff --git a/src/components/list/test/sticky/index.ts b/src/components/list/test/sticky/app-module.ts
similarity index 59%
rename from src/components/list/test/sticky/index.ts
rename to src/components/list/test/sticky/app-module.ts
index 8d1fa7569e..ab8c90675c 100644
--- a/src/components/list/test/sticky/index.ts
+++ b/src/components/list/test/sticky/app-module.ts
@@ -1,11 +1,11 @@
-import { Component } from '@angular/core';
-import { ionicBootstrap } from '../../../../../src';
+import { Component, NgModule } from '@angular/core';
+import { IonicApp, IonicModule } from '../../../..';
@Component({
templateUrl: 'main.html'
})
-class E2EPage {
+export class E2EPage {
groups: any[] = [];
constructor() {
@@ -31,8 +31,22 @@ class E2EPage {
@Component({
template: ''
})
-class E2EApp {
+export class E2EApp {
rootPage = E2EPage;
}
-ionicBootstrap(E2EApp);
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EApp,
+ E2EPage
+ ]
+})
+export class AppModule {}
diff --git a/src/components/loading/test/basic/index.ts b/src/components/loading/test/basic/app-module.ts
similarity index 78%
rename from src/components/loading/test/basic/index.ts
rename to src/components/loading/test/basic/app-module.ts
index 3ce0109487..f05a10fd3e 100644
--- a/src/components/loading/test/basic/index.ts
+++ b/src/components/loading/test/basic/app-module.ts
@@ -1,11 +1,11 @@
-import { Component, ViewEncapsulation } from '@angular/core';
-import { ionicBootstrap, LoadingController, NavController } from '../../../../../src';
+import { Component, ViewEncapsulation, NgModule } from '@angular/core';
+import { IonicApp, IonicModule, LoadingController, NavController } from '../../../..';
@Component({
templateUrl: 'main.html'
})
-class E2EPage {
+export class E2EPage {
constructor(public loadingCtrl: LoadingController, public navCtrl: NavController) {}
presentLoadingIos() {
@@ -88,7 +88,7 @@ class E2EPage {
loading.present();
setTimeout(() => {
- loading.setContent("Loaded!");
+ loading.setContent('Loaded!');
}, 1000);
setTimeout(() => {
loading.dismiss();
@@ -141,53 +141,32 @@ class E2EPage {
setTimeout(() => {
loading3.present();
- setTimeout(() => {
- loading3.dismiss();
- }, 1000);
+ loading3.dismiss();
+ loading2.dismiss();
+ loading.dismiss();
- setTimeout(() => {
- loading2.dismiss();
- }, 2000);
-
- setTimeout(() => {
- loading.dismiss();
- }, 3000);
}, 2000);
}
presentLoadingMultipleNav() {
- let loading = this.loadingCtrl.create({
+ this.loadingCtrl.create({
spinner: 'hide',
content: 'Loading 1 Please Wait...',
dismissOnPageChange: true
- });
-
- loading.present();
-
- let loading2 = this.loadingCtrl.create({
- spinner: 'hide',
- content: 'Loading 2 Please Wait...',
- dismissOnPageChange: true
- });
+ }).present();
setTimeout(() => {
- loading2.present();
+
+ this.loadingCtrl.create({
+ spinner: 'hide',
+ content: 'Loading 2 Please Wait...',
+ dismissOnPageChange: true
+ }).present();
+
+ this.navCtrl.push(Page2);
+
}, 500);
-
- let loading3 = this.loadingCtrl.create({
- spinner: 'hide',
- content: 'Loading 3 Please Wait...',
- dismissOnPageChange: true
- });
-
- setTimeout(() => {
- loading3.present();
-
- setTimeout(() => {
- this.navCtrl.push(Page2);
- }, 1000);
- }, 1000);
}
}
@@ -211,10 +190,10 @@ class E2EPage {
`
})
-class Page2 {
+export class Page2 {
constructor(public navCtrl: NavController) {}
- ionViewLoaded() {
+ ionViewDidLoad() {
setTimeout(() => {
this.navCtrl.push(Page3);
}, 1000);
@@ -235,17 +214,34 @@ class Page2 {
Some content
`
})
-class Page3 {}
+export class Page3 {}
@Component({
template: `
-
`,
encapsulation: ViewEncapsulation.None
})
-class E2EApp {
+export class E2EApp {
root = E2EPage;
}
-ionicBootstrap(E2EApp);
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage,
+ Page2,
+ Page3
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EApp,
+ E2EPage,
+ Page2,
+ Page3
+ ]
+})
+export class AppModule {}
diff --git a/src/components/loading/test/basic/main.html b/src/components/loading/test/basic/main.html
index 98cf0bb978..0e67e1549a 100644
--- a/src/components/loading/test/basic/main.html
+++ b/src/components/loading/test/basic/main.html
@@ -1,3 +1,5 @@
+
+
@@ -35,3 +37,5 @@
+
+
diff --git a/src/components/loading/test/basic/styles.css b/src/components/loading/test/basic/styles.css
deleted file mode 100644
index 93f3d0c388..0000000000
--- a/src/components/loading/test/basic/styles.css
+++ /dev/null
@@ -1,61 +0,0 @@
-/* Fix the spinner used in e2e */
-.fixed-spinner svg {
- animation: none;
-}
-
-.custom-spinner-container {
- position: relative;
- display: inline-block;
- box-sizing: border-box;
-}
-
-.custom-spinner-box {
- position: relative;
- box-sizing: border-box;
- border: 4px solid #000;
- width: 60px;
- height: 60px;
- animation: spin 3s infinite linear;
-}
-
-.custom-spinner-box:before {
- content: '';
- position: absolute;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
- box-sizing: border-box;
- border: 4px solid #000;
- width: 40px;
- height: 40px;
- animation: pulse 1.5s infinite ease;
-}
-
-.wp .custom-spinner-box,
-.wp .custom-spinner-box:before {
- border-color: #fff;
-}
-
-@-webkit-keyframes pulse {
- 50% {
- border-width: 20px;
- }
-}
-@keyframes pulse {
- 50% {
- border-width: 20px;
- }
-}
-
-@-webkit-keyframes spin {
- 100% {
- -webkit-transform: rotate(360deg);
- transform: rotate(360deg);
- }
-}
-@keyframes spin {
- 100% {
- -webkit-transform: rotate(360deg);
- transform: rotate(360deg);
- }
-}
diff --git a/src/components/loading/test/tabs/index.ts b/src/components/loading/test/tabs/app-module.ts
similarity index 69%
rename from src/components/loading/test/tabs/index.ts
rename to src/components/loading/test/tabs/app-module.ts
index 6da24d853e..680bbf89d6 100644
--- a/src/components/loading/test/tabs/index.ts
+++ b/src/components/loading/test/tabs/app-module.ts
@@ -1,11 +1,11 @@
-import { Component } from '@angular/core';
-import { ionicBootstrap, LoadingController, NavController } from '../../../../../src';
+import { Component, NgModule } from '@angular/core';
+import { IonicApp, IonicModule, LoadingController, NavController } from '../../../..';
@Component({
templateUrl: 'main.html'
})
-class E2EPage {
+export class E2EPage {
constructor(public loadingCtrl: LoadingController, public navCtrl: NavController) {}
presentLoading() {
@@ -46,7 +46,7 @@ class E2EPage {
Some content
`
})
-class Page2 {}
+export class Page2 {}
@Component({
template: `
@@ -58,16 +58,34 @@ class Page2 {}
`
})
export class TabsPage {
- private root1 = E2EPage;
- private root2 = Page2;
- private root3 = E2EPage;
+ root1 = E2EPage;
+ root2 = Page2;
+ root3 = E2EPage;
}
@Component({
template: ''
})
-class E2EApp {
+export class E2EApp {
root = TabsPage;
}
-ionicBootstrap(E2EApp);
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage,
+ TabsPage,
+ Page2
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EApp,
+ E2EPage,
+ TabsPage,
+ Page2
+ ]
+})
+export class AppModule {}
diff --git a/src/components/menu/test/basic/index.ts b/src/components/menu/test/basic/app-module.ts
similarity index 77%
rename from src/components/menu/test/basic/index.ts
rename to src/components/menu/test/basic/app-module.ts
index 3d80a790dc..f71fc9be59 100644
--- a/src/components/menu/test/basic/index.ts
+++ b/src/components/menu/test/basic/app-module.ts
@@ -1,11 +1,11 @@
-import { Component, ViewChild } from '@angular/core';
-import { ionicBootstrap, MenuController, NavController, AlertController, Nav } from '../../../../../src';
+import { Component, ViewChild, NgModule } from '@angular/core';
+import { IonicApp, IonicModule, MenuController, NavController, AlertController, Nav } from '../../../..';
@Component({
templateUrl: 'page1.html'
})
-class Page1 {
+export class Page1 {
constructor(public navCtrl: NavController, public alertCtrl: AlertController) {}
presentAlert() {
@@ -25,11 +25,11 @@ class Page1 {
@Component({templateUrl: 'page3.html'})
-class Page3 {}
+export class Page3 {}
@Component({templateUrl: 'page2.html'})
-class Page2 {
+export class Page2 {
constructor(public navCtrl: NavController) {}
page3() {
@@ -41,7 +41,7 @@ class Page2 {
@Component({
templateUrl: 'main.html'
})
-class E2EPage {
+export class E2EPage {
rootPage: any;
changeDetectionCount: number = 0;
pages: Array<{title: string, component: any}>;
@@ -96,8 +96,28 @@ class E2EPage {
@Component({
template: ''
})
-class E2EApp {
+export class E2EApp {
rootPage = E2EPage;
}
-ionicBootstrap(E2EApp);
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage,
+ Page1,
+ Page2,
+ Page3
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EApp,
+ E2EPage,
+ Page1,
+ Page2,
+ Page3
+ ]
+})
+export class AppModule {}
diff --git a/src/components/menu/test/basic/page1.html b/src/components/menu/test/basic/page1.html
index 9f14c9ad3e..c340af5241 100644
--- a/src/components/menu/test/basic/page1.html
+++ b/src/components/menu/test/basic/page1.html
@@ -68,6 +68,6 @@
Go to Page 2
-
+
diff --git a/src/components/menu/test/basic/page3.html b/src/components/menu/test/basic/page3.html
index 881f39bd0c..513b043e82 100644
--- a/src/components/menu/test/basic/page3.html
+++ b/src/components/menu/test/basic/page3.html
@@ -23,6 +23,6 @@
Toggle Right Menu
-
+
diff --git a/src/components/menu/test/disable-swipe/index.ts b/src/components/menu/test/disable-swipe/app-module.ts
similarity index 60%
rename from src/components/menu/test/disable-swipe/index.ts
rename to src/components/menu/test/disable-swipe/app-module.ts
index b29524d87e..7fd8a225f0 100644
--- a/src/components/menu/test/disable-swipe/index.ts
+++ b/src/components/menu/test/disable-swipe/app-module.ts
@@ -1,11 +1,11 @@
-import { Component } from '@angular/core';
-import { ionicBootstrap, NavController, MenuController } from '../../../../../src';
+import { Component, NgModule } from '@angular/core';
+import { IonicApp, IonicModule, MenuController } from '../../../..';
@Component({
templateUrl: 'page1.html'
})
-class Page1 {
+export class Page1 {
leftMenuSwipeEnabled: boolean = true;
rightMenuSwipeEnabled: boolean = false;
@@ -28,6 +28,22 @@ class Page1 {
@Component({
templateUrl: 'main.html'
})
-class E2EApp {
+export class E2EApp {
root = Page1;
}
+
+@NgModule({
+ declarations: [
+ E2EApp,
+ Page1
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EApp,
+ Page1
+ ]
+})
+export class AppModule {}
diff --git a/src/components/menu/test/enable-disable/index.ts b/src/components/menu/test/enable-disable/app-module.ts
similarity index 66%
rename from src/components/menu/test/enable-disable/index.ts
rename to src/components/menu/test/enable-disable/app-module.ts
index c7ca761cc3..7233423ca4 100644
--- a/src/components/menu/test/enable-disable/index.ts
+++ b/src/components/menu/test/enable-disable/app-module.ts
@@ -1,24 +1,24 @@
-import { Component, ViewChild } from '@angular/core';
-import { ionicBootstrap, App, MenuController, Nav } from '../../../../../src';
+import { Component, ViewChild, NgModule } from '@angular/core';
+import { IonicApp, IonicModule, App, MenuController, Nav } from '../../../..';
@Component({
templateUrl: 'page1.html'
})
-class Page1 {
+export class Page1 {
}
@Component({
templateUrl: 'page2.html'
})
-class Page2 {
+export class Page2 {
}
@Component({
templateUrl: 'main.html'
})
-class E2EApp {
+export class E2EApp {
@ViewChild(Nav) nav: Nav;
activeMenu: string;
@@ -52,4 +52,20 @@ class E2EApp {
}
}
-ionicBootstrap(E2EApp);
+@NgModule({
+ declarations: [
+ E2EApp,
+ Page1,
+ Page2
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EApp,
+ Page1,
+ Page2
+ ]
+})
+export class AppModule {}
diff --git a/src/components/menu/test/menu.spec.ts b/src/components/menu/test/menu.spec.ts
index 13ac200acf..8538f1e638 100644
--- a/src/components/menu/test/menu.spec.ts
+++ b/src/components/menu/test/menu.spec.ts
@@ -1,250 +1,246 @@
-import { MenuController, Menu } from '../../../../src';
+import { MenuController } from '../menu-controller';
+import { mockMenu } from '../../../util/mock-providers';
-export function run() {
- describe('MenuController', () => {
- describe('get() without menuId', () => {
+describe('MenuController', () => {
- it('should not get a menu if no menus', () => {
- let menu = menuCtrl.get();
- expect(menu).toEqual(null);
- });
-
- it('should get the only menu', () => {
- let someMenu = mockMenu();
- menuCtrl.register(someMenu);
-
- let menu = menuCtrl.get();
- expect(menu).toEqual(someMenu);
- });
-
- it('should get the only menu if menuId === ""', () => {
- let someMenu = mockMenu();
- menuCtrl.register(someMenu);
-
- let menu = menuCtrl.get('');
- expect(menu).toEqual(someMenu);
- });
-
- it('should get the enabled menu when multiple menus', () => {
- let someMenu1 = mockMenu();
- someMenu1.enabled = false;
- menuCtrl.register(someMenu1);
-
- let someMenu2 = mockMenu();
- someMenu2.enabled = true;
- menuCtrl.register(someMenu2);
-
- let menu = menuCtrl.get();
- expect(menu).toEqual(someMenu2);
- });
+ describe('get() without menuId', () => {
+ it('should not get a menu if no menus', () => {
+ let menu = menuCtrl.get();
+ expect(menu).toEqual(null);
});
- describe('get() by id', () => {
-
- it('should be null if no menus', () => {
- let menu = menuCtrl.get('myid');
- expect(menu).toEqual(null);
- });
-
- it('should be null if no matching menus with id', () => {
- let someMenu = mockMenu();
- someMenu.id = 'whatever';
- menuCtrl.register(someMenu);
-
- let menu = menuCtrl.get('myMenu');
- expect(menu).toEqual(null);
- });
-
- it('should get the menu by id with matching id', () => {
- let someMenu = mockMenu();
- someMenu.id = 'myMenu';
- menuCtrl.register(someMenu);
-
- let menu = menuCtrl.get('myMenu');
- expect(menu).toEqual(someMenu);
- });
-
- it('should get the menu by id with left', () => {
- let someMenu = mockMenu();
- someMenu.id = 'myMenu';
- someMenu.side = 'left';
- menuCtrl.register(someMenu);
-
- let menu = menuCtrl.get('myMenu');
- expect(menu).toEqual(someMenu);
- });
-
- it('should get the menu by id with matching id when multiple menus', () => {
- let someMenu1 = mockMenu();
- someMenu1.id = 'myMenu1';
- menuCtrl.register(someMenu1);
-
- let someMenu2 = mockMenu();
- someMenu2.id = 'myMenu2';
- menuCtrl.register(someMenu2);
-
- let menu = menuCtrl.get('myMenu1');
- expect(menu).toEqual(someMenu1);
-
- menu = menuCtrl.get('myMenu2');
- expect(menu).toEqual(someMenu2);
- });
+ it('should get the only menu', () => {
+ let someMenu = mockMenu();
+ menuCtrl.register(someMenu);
+ let menu = menuCtrl.get();
+ expect(menu).toEqual(someMenu);
});
- describe('get() by side', () => {
-
- it('should not get a menu with a left side if no menus', () => {
- let menu = menuCtrl.get('left');
- expect(menu).toEqual(null);
- });
-
- it('should not get a menu with a right side if no menus', () => {
- let menu = menuCtrl.get('right');
- expect(menu).toEqual(null);
- });
-
- it('should get the only left menu', () => {
- let someMenu = mockMenu();
- someMenu.side = 'left';
- menuCtrl.register(someMenu);
-
- let menu = menuCtrl.get('left');
- expect(menu).toEqual(someMenu);
- });
-
- it('should get the enabled left menu', () => {
- let someMenu1 = mockMenu();
- someMenu1.side = 'left';
- someMenu1.enabled = false;
- menuCtrl.register(someMenu1);
-
- let someMenu2 = mockMenu();
- someMenu2.side = 'left';
- someMenu2.enabled = true;
- menuCtrl.register(someMenu2);
-
- let menu = menuCtrl.get('left');
- expect(menu).toEqual(someMenu2);
- });
-
- it('should get the first left menu when all are disabled', () => {
- let someMenu1 = mockMenu();
- someMenu1.side = 'left';
- someMenu1.enabled = false;
- menuCtrl.register(someMenu1);
-
- let someMenu2 = mockMenu();
- someMenu2.side = 'left';
- someMenu2.enabled = false;
- menuCtrl.register(someMenu2);
-
- let menu = menuCtrl.get('left');
- expect(menu).toEqual(someMenu1);
- });
-
- it('should get the only right menu', () => {
- let someMenu = mockMenu();
- someMenu.side = 'right';
- menuCtrl.register(someMenu);
-
- let menu = menuCtrl.get('right');
- expect(menu).toEqual(someMenu);
- });
-
- it('should get the menu by left with id', () => {
- let someMenu = mockMenu();
- someMenu.id = 'myMenu';
- someMenu.side = 'left';
- menuCtrl.register(someMenu);
-
- let menu = menuCtrl.get('left');
- expect(menu).toEqual(someMenu);
- });
+ it('should get the only menu if menuId === ""', () => {
+ let someMenu = mockMenu();
+ menuCtrl.register(someMenu);
+ let menu = menuCtrl.get('');
+ expect(menu).toEqual(someMenu);
});
- describe('enable()', () => {
+ it('should get the enabled menu when multiple menus', () => {
+ let someMenu1 = mockMenu();
+ someMenu1.enabled = false;
+ menuCtrl.register(someMenu1);
- it('should enable a menu', () => {
- let someMenu = mockMenu();
- someMenu.enabled = true;
- menuCtrl.register(someMenu);
- someMenu._menuCtrl = menuCtrl;
-
- let menu = menuCtrl.enable(true);
- expect(menu.enabled).toEqual(true);
-
- menu = menuCtrl.enable(false);
- expect(menu.enabled).toEqual(false);
- });
-
- it('should be only one enabled menu on the same side', () => {
- let someMenu1 = mockMenu();
- someMenu1.enabled = true;
- someMenu1.side = 'left';
- someMenu1.id = 'menu1';
- someMenu1._menuCtrl = menuCtrl;
- menuCtrl.register(someMenu1);
-
- let someMenu2 = mockMenu();
- someMenu2.enabled = false;
- someMenu2.side = 'left';
- someMenu2.id = 'menu2';
- someMenu2._menuCtrl = menuCtrl;
- menuCtrl.register(someMenu2);
-
- let someMenu3 = mockMenu();
- someMenu3.enabled = true;
- someMenu3.side = 'right';
- someMenu3.id = 'menu2';
- someMenu3._menuCtrl = menuCtrl;
- menuCtrl.register(someMenu3);
-
- menuCtrl.enable(true, 'menu1');
- expect(someMenu1.enabled).toEqual(true);
- expect(someMenu2.enabled).toEqual(false);
- expect(someMenu3.enabled).toEqual(true);
-
- menuCtrl.enable(true, 'menu2');
- expect(someMenu1.enabled).toEqual(false);
- expect(someMenu2.enabled).toEqual(true);
- expect(someMenu3.enabled).toEqual(true);
-
- menuCtrl.enable(true, 'menu1');
- expect(someMenu1.enabled).toEqual(true);
- expect(someMenu2.enabled).toEqual(false);
- expect(someMenu3.enabled).toEqual(true);
- });
+ let someMenu2 = mockMenu();
+ someMenu2.enabled = true;
+ menuCtrl.register(someMenu2);
+ let menu = menuCtrl.get();
+ expect(menu).toEqual(someMenu2);
});
- it('should register a menu', () => {
- let menu = mockMenu();
- menuCtrl.register(menu);
- expect(menuCtrl.getMenus().length).toEqual(1);
-
- let menu2 = mockMenu();
- menuCtrl.register(menu2);
- expect(menuCtrl.getMenus().length).toEqual(2);
-
- menuCtrl.unregister(menu2);
- menuCtrl.unregister(menu);
-
- expect(menuCtrl.getMenus().length).toEqual(0);
- });
-
- let menuCtrl: MenuController;
-
- beforeEach(() => {
- menuCtrl = new MenuController();
- });
-
- function mockMenu(): Menu {
- return new Menu(null, null, null, null, null, null, null);
- }
-
});
-}
+
+ describe('get() by id', () => {
+
+ it('should be null if no menus', () => {
+ let menu = menuCtrl.get('myid');
+ expect(menu).toEqual(null);
+ });
+
+ it('should be null if no matching menus with id', () => {
+ let someMenu = mockMenu();
+ someMenu.id = 'whatever';
+ menuCtrl.register(someMenu);
+
+ let menu = menuCtrl.get('myMenu');
+ expect(menu).toEqual(null);
+ });
+
+ it('should get the menu by id with matching id', () => {
+ let someMenu = mockMenu();
+ someMenu.id = 'myMenu';
+ menuCtrl.register(someMenu);
+
+ let menu = menuCtrl.get('myMenu');
+ expect(menu).toEqual(someMenu);
+ });
+
+ it('should get the menu by id with left', () => {
+ let someMenu = mockMenu();
+ someMenu.id = 'myMenu';
+ someMenu.side = 'left';
+ menuCtrl.register(someMenu);
+
+ let menu = menuCtrl.get('myMenu');
+ expect(menu).toEqual(someMenu);
+ });
+
+ it('should get the menu by id with matching id when multiple menus', () => {
+ let someMenu1 = mockMenu();
+ someMenu1.id = 'myMenu1';
+ menuCtrl.register(someMenu1);
+
+ let someMenu2 = mockMenu();
+ someMenu2.id = 'myMenu2';
+ menuCtrl.register(someMenu2);
+
+ let menu = menuCtrl.get('myMenu1');
+ expect(menu).toEqual(someMenu1);
+
+ menu = menuCtrl.get('myMenu2');
+ expect(menu).toEqual(someMenu2);
+ });
+
+ });
+
+ describe('get() by side', () => {
+
+ it('should not get a menu with a left side if no menus', () => {
+ let menu = menuCtrl.get('left');
+ expect(menu).toEqual(null);
+ });
+
+ it('should not get a menu with a right side if no menus', () => {
+ let menu = menuCtrl.get('right');
+ expect(menu).toEqual(null);
+ });
+
+ it('should get the only left menu', () => {
+ let someMenu = mockMenu();
+ someMenu.side = 'left';
+ menuCtrl.register(someMenu);
+
+ let menu = menuCtrl.get('left');
+ expect(menu).toEqual(someMenu);
+ });
+
+ it('should get the enabled left menu', () => {
+ let someMenu1 = mockMenu();
+ someMenu1.side = 'left';
+ someMenu1.enabled = false;
+ menuCtrl.register(someMenu1);
+
+ let someMenu2 = mockMenu();
+ someMenu2.side = 'left';
+ someMenu2.enabled = true;
+ menuCtrl.register(someMenu2);
+
+ let menu = menuCtrl.get('left');
+ expect(menu).toEqual(someMenu2);
+ });
+
+ it('should get the first left menu when all are disabled', () => {
+ let someMenu1 = mockMenu();
+ someMenu1.side = 'left';
+ someMenu1.enabled = false;
+ menuCtrl.register(someMenu1);
+
+ let someMenu2 = mockMenu();
+ someMenu2.side = 'left';
+ someMenu2.enabled = false;
+ menuCtrl.register(someMenu2);
+
+ let menu = menuCtrl.get('left');
+ expect(menu).toEqual(someMenu1);
+ });
+
+ it('should get the only right menu', () => {
+ let someMenu = mockMenu();
+ someMenu.side = 'right';
+ menuCtrl.register(someMenu);
+
+ let menu = menuCtrl.get('right');
+ expect(menu).toEqual(someMenu);
+ });
+
+ it('should get the menu by left with id', () => {
+ let someMenu = mockMenu();
+ someMenu.id = 'myMenu';
+ someMenu.side = 'left';
+ menuCtrl.register(someMenu);
+
+ let menu = menuCtrl.get('left');
+ expect(menu).toEqual(someMenu);
+ });
+
+ });
+
+ describe('enable()', () => {
+
+ it('should enable a menu', () => {
+ let someMenu = mockMenu();
+ someMenu.enabled = true;
+ menuCtrl.register(someMenu);
+ someMenu._menuCtrl = menuCtrl;
+
+ let menu = menuCtrl.enable(true);
+ expect(menu.enabled).toEqual(true);
+
+ menu = menuCtrl.enable(false);
+ expect(menu.enabled).toEqual(false);
+ });
+
+ it('should be only one enabled menu on the same side', () => {
+ let someMenu1 = mockMenu();
+ someMenu1.enabled = true;
+ someMenu1.side = 'left';
+ someMenu1.id = 'menu1';
+ someMenu1._menuCtrl = menuCtrl;
+ menuCtrl.register(someMenu1);
+
+ let someMenu2 = mockMenu();
+ someMenu2.enabled = false;
+ someMenu2.side = 'left';
+ someMenu2.id = 'menu2';
+ someMenu2._menuCtrl = menuCtrl;
+ menuCtrl.register(someMenu2);
+
+ let someMenu3 = mockMenu();
+ someMenu3.enabled = true;
+ someMenu3.side = 'right';
+ someMenu3.id = 'menu2';
+ someMenu3._menuCtrl = menuCtrl;
+ menuCtrl.register(someMenu3);
+
+ menuCtrl.enable(true, 'menu1');
+ expect(someMenu1.enabled).toEqual(true);
+ expect(someMenu2.enabled).toEqual(false);
+ expect(someMenu3.enabled).toEqual(true);
+
+ menuCtrl.enable(true, 'menu2');
+ expect(someMenu1.enabled).toEqual(false);
+ expect(someMenu2.enabled).toEqual(true);
+ expect(someMenu3.enabled).toEqual(true);
+
+ menuCtrl.enable(true, 'menu1');
+ expect(someMenu1.enabled).toEqual(true);
+ expect(someMenu2.enabled).toEqual(false);
+ expect(someMenu3.enabled).toEqual(true);
+ });
+
+ });
+
+ it('should register a menu', () => {
+ let menu = mockMenu();
+ menuCtrl.register(menu);
+ expect(menuCtrl.getMenus().length).toEqual(1);
+
+ let menu2 = mockMenu();
+ menuCtrl.register(menu2);
+ expect(menuCtrl.getMenus().length).toEqual(2);
+
+ menuCtrl.unregister(menu2);
+ menuCtrl.unregister(menu);
+
+ expect(menuCtrl.getMenus().length).toEqual(0);
+ });
+
+ let menuCtrl: MenuController;
+
+ beforeEach(() => {
+ menuCtrl = new MenuController();
+ });
+
+});
diff --git a/src/components/menu/test/multiple/index.ts b/src/components/menu/test/multiple/app-module.ts
similarity index 55%
rename from src/components/menu/test/multiple/index.ts
rename to src/components/menu/test/multiple/app-module.ts
index f586c172ab..486d0ce88c 100644
--- a/src/components/menu/test/multiple/index.ts
+++ b/src/components/menu/test/multiple/app-module.ts
@@ -1,11 +1,11 @@
-import { Component } from '@angular/core';
-import { ionicBootstrap, MenuController } from '../../../../../src';
+import { Component, NgModule } from '@angular/core';
+import { IonicApp, IonicModule, MenuController } from '../../../..';
@Component({
templateUrl: 'page1.html'
})
-class Page1 {
+export class Page1 {
activeMenu: string;
constructor(private menu: MenuController) {
@@ -27,8 +27,22 @@ class Page1 {
@Component({
templateUrl: 'main.html'
})
-class E2EApp {
+export class E2EApp {
rootPage = Page1;
}
-ionicBootstrap(E2EApp);
+@NgModule({
+ declarations: [
+ E2EApp,
+ Page1
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EApp,
+ Page1
+ ]
+})
+export class AppModule {}
diff --git a/src/components/menu/test/push/index.ts b/src/components/menu/test/overlay/app-module.ts
similarity index 60%
rename from src/components/menu/test/push/index.ts
rename to src/components/menu/test/overlay/app-module.ts
index edd3483ed3..b1a1adaa3e 100644
--- a/src/components/menu/test/push/index.ts
+++ b/src/components/menu/test/overlay/app-module.ts
@@ -1,15 +1,15 @@
-import { Component, ViewChild } from '@angular/core';
-import { ionicBootstrap, Nav, AlertController } from '../../../../../src';
+import { Component, ViewChild, NgModule } from '@angular/core';
+import { IonicApp, IonicModule, Nav, AlertController } from '../../../..';
@Component({templateUrl: 'page1.html'})
-class Page1 {}
+export class Page1 {}
@Component({
templateUrl: 'main.html'
})
-class E2EApp {
+export class E2EApp {
@ViewChild(Nav) nav: Nav;
rootView = Page1;
@@ -34,4 +34,18 @@ class E2EApp {
}
}
-ionicBootstrap(E2EApp);
+@NgModule({
+ declarations: [
+ E2EApp,
+ Page1
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EApp,
+ Page1
+ ]
+})
+export class AppModule {}
diff --git a/src/components/menu/test/overlay/page1.html b/src/components/menu/test/overlay/page1.html
index 5ce04fd927..e9dac04c54 100644
--- a/src/components/menu/test/overlay/page1.html
+++ b/src/components/menu/test/overlay/page1.html
@@ -25,6 +25,6 @@
Toggle Right Overlay Menu
-
+
diff --git a/src/components/menu/test/overlay/index.ts b/src/components/menu/test/push/app-module.ts
similarity index 60%
rename from src/components/menu/test/overlay/index.ts
rename to src/components/menu/test/push/app-module.ts
index edd3483ed3..b1a1adaa3e 100644
--- a/src/components/menu/test/overlay/index.ts
+++ b/src/components/menu/test/push/app-module.ts
@@ -1,15 +1,15 @@
-import { Component, ViewChild } from '@angular/core';
-import { ionicBootstrap, Nav, AlertController } from '../../../../../src';
+import { Component, ViewChild, NgModule } from '@angular/core';
+import { IonicApp, IonicModule, Nav, AlertController } from '../../../..';
@Component({templateUrl: 'page1.html'})
-class Page1 {}
+export class Page1 {}
@Component({
templateUrl: 'main.html'
})
-class E2EApp {
+export class E2EApp {
@ViewChild(Nav) nav: Nav;
rootView = Page1;
@@ -34,4 +34,18 @@ class E2EApp {
}
}
-ionicBootstrap(E2EApp);
+@NgModule({
+ declarations: [
+ E2EApp,
+ Page1
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EApp,
+ Page1
+ ]
+})
+export class AppModule {}
diff --git a/src/components/menu/test/push/page1.html b/src/components/menu/test/push/page1.html
index b8d81f29ad..681f777262 100644
--- a/src/components/menu/test/push/page1.html
+++ b/src/components/menu/test/push/page1.html
@@ -25,6 +25,6 @@
Toggle Right Push Menu
-
+
diff --git a/src/components/menu/test/reveal/index.ts b/src/components/menu/test/reveal/app-module.ts
similarity index 52%
rename from src/components/menu/test/reveal/index.ts
rename to src/components/menu/test/reveal/app-module.ts
index f5c5e21ebc..3c955d2696 100644
--- a/src/components/menu/test/reveal/index.ts
+++ b/src/components/menu/test/reveal/app-module.ts
@@ -1,15 +1,15 @@
-import { Component, ViewChild } from '@angular/core';
-import { ionicBootstrap, Nav } from '../../../../../src';
+import { Component, ViewChild, NgModule } from '@angular/core';
+import { IonicApp, IonicModule, Nav } from '../../../..';
@Component({templateUrl: 'page1.html'})
-class Page1 {}
+export class Page1 {}
@Component({
templateUrl: 'main.html'
})
-class E2EApp {
+export class E2EApp {
@ViewChild(Nav) nav: Nav;
rootView = Page1;
@@ -24,4 +24,18 @@ class E2EApp {
}
}
-ionicBootstrap(E2EApp);
+@NgModule({
+ declarations: [
+ E2EApp,
+ Page1
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EApp,
+ Page1
+ ]
+})
+export class AppModule {}
diff --git a/src/components/menu/test/reveal/page1.html b/src/components/menu/test/reveal/page1.html
index 10d58e4352..774a0dbe98 100644
--- a/src/components/menu/test/reveal/page1.html
+++ b/src/components/menu/test/reveal/page1.html
@@ -25,6 +25,6 @@
Toggle Right Reveal Menu
-
+
diff --git a/src/components/modal/test/basic/index.ts b/src/components/modal/test/basic/app-module.ts
similarity index 80%
rename from src/components/modal/test/basic/index.ts
rename to src/components/modal/test/basic/app-module.ts
index b45199ae39..91116b8db4 100644
--- a/src/components/modal/test/basic/index.ts
+++ b/src/components/modal/test/basic/app-module.ts
@@ -1,10 +1,12 @@
-import { Component, Injectable } from '@angular/core';
+import { Component, Injectable, NgModule } from '@angular/core';
-import { ActionSheetController, App, Config, ionicBootstrap, ModalController, NavController, NavParams, PageTransition, Platform, TransitionOptions, ViewController } from '../../../../../src';
+import { ActionSheetController, App, Config,
+ IonicApp, IonicModule, ModalController, NavController,
+ NavParams, Platform, ViewController } from '../../../..';
@Injectable()
-class SomeComponentProvider {
+export class SomeComponentProvider {
constructor(public config: Config) {
console.log('SomeComponentProvider constructor');
}
@@ -15,7 +17,7 @@ class SomeComponentProvider {
}
@Injectable()
-class SomeAppProvider {
+export class SomeAppProvider {
constructor(public config: Config) {
console.log('SomeAppProvider constructor');
}
@@ -29,7 +31,7 @@ class SomeAppProvider {
@Component({
templateUrl: 'main.html'
})
-class E2EPage {
+export class E2EPage {
platforms: string[];
constructor(public navCtrl: NavController, public modalCtrl: ModalController, config: Config, platform: Platform) {
@@ -77,10 +79,6 @@ class E2EPage {
presentToolbarModal() {
let modal = this.modalCtrl.create(ToolbarModal);
modal.present();
-
- modal.subscribe((data: any) => {
- console.log('modal data', data);
- });
}
presentModalWithInputs() {
@@ -91,19 +89,12 @@ class E2EPage {
modal.present();
}
- presentModalCustomAnimation() {
- let modal = this.modalCtrl.create(ContactUs);
- modal.present({
- animation: 'my-fade-in'
- });
- }
-
presentNavigableModal() {
this.modalCtrl.create(NavigableModal).present();
}
- ionViewLoaded() {
- console.log('E2EPage ionViewLoaded fired');
+ ionViewDidLoad() {
+ console.log('E2EPage ionViewDidLoad fired');
}
ionViewWillEnter() {
@@ -127,22 +118,32 @@ class E2EPage {
template: `
+
+ Close
+
Page One
+
+ NavigableModal
+
Submit
`
})
-class NavigableModal {
+export class NavigableModal {
- constructor(public navCtrl: NavController) {}
+ constructor(public navCtrl: NavController, public viewCtrl: ViewController) {}
submit() {
this.navCtrl.push(NavigableModal2);
}
+
+ dismiss() {
+ this.viewCtrl.dismiss();
+ }
}
@Component({
@@ -158,7 +159,7 @@ class NavigableModal {
`
})
-class NavigableModal2 {
+export class NavigableModal2 {
constructor(public navCtrl: NavController) {}
@@ -192,7 +193,7 @@ class NavigableModal2 {
`,
providers: [SomeComponentProvider]
})
-class ModalPassData {
+export class ModalPassData {
data: any;
constructor(params: NavParams, public viewCtrl: ViewController, someComponentProvider: SomeComponentProvider, someAppProvider: SomeAppProvider) {
@@ -208,8 +209,8 @@ class ModalPassData {
this.viewCtrl.dismiss(this.data);
}
- ionViewLoaded() {
- console.log('ModalPassData ionViewLoaded fired');
+ ionViewDidLoad() {
+ console.log('ModalPassData ionViewDidLoad fired');
}
ionViewWillEnter() {
@@ -257,20 +258,17 @@ class ModalPassData {
Aenean rhoncus urna at interdum blandit. Donec ac massa nec libero vehicula tincidunt. Sed sit amet hendrerit risus. Aliquam vitae vestibulum ipsum, non feugiat orci. Vivamus eu rutrum elit. Nulla dapibus tortor non dignissim pretium. Nulla in luctus turpis. Etiam non mattis tortor, at aliquet ex. Nunc ut ante varius, auctor dui vel, volutpat elit. Nunc laoreet augue sit amet ultrices porta. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Vestibulum pellentesque lobortis est, ut tincidunt ligula mollis sit amet. In porta risus arcu, quis pellentesque dolor mattis non. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae;
-
+
Dismission Modal
`
})
-class ToolbarModal {
+export class ToolbarModal {
constructor(public viewCtrl: ViewController) {}
dismiss() {
- this.viewCtrl.emit({
- toolbar: 'data'
- });
this.viewCtrl.dismiss();
}
@@ -292,16 +290,16 @@ class ToolbarModal {
- currenciesControl.value: {{currencyForm.controls.currenciesControl.value}}
+ currenciesControl.value: {{currenciesControl.value}}
diff --git a/src/components/radio/test/radio.spec.ts b/src/components/radio/test/radio.spec.ts
index 39b2f51d16..3cc5bbb6b1 100644
--- a/src/components/radio/test/radio.spec.ts
+++ b/src/components/radio/test/radio.spec.ts
@@ -1,133 +1,129 @@
-import { RadioGroup, RadioButton, Form } from '../../../../src';
+import { RadioGroup } from '../radio-group';
+import { RadioButton } from '../radio-button';
+import { Form } from '../../../util/form';
+import { mockConfig, mockRenderer, mockElementRef } from '../../../util/mock-providers';
-export function run() {
- describe('RadioGroup', () => {
- describe('_update', () => {
+describe('RadioGroup', () => {
- it('should set checked via string values', () => {
- let rb1 = createRadioButton();
- rb1.value = 'string1';
- let rb2 = createRadioButton();
- rb2.value = 'string2';
- let rb3 = createRadioButton();
- rb3.value = 'string3';
+ describe('_update', () => {
- rg.value = 'string1';
- rg._update();
+ it('should set checked via string values', () => {
+ let rb1 = createRadioButton();
+ rb1.value = 'string1';
+ let rb2 = createRadioButton();
+ rb2.value = 'string2';
+ let rb3 = createRadioButton();
+ rb3.value = 'string3';
- expect(rb1.checked).toEqual(true);
- expect(rb2.checked).toEqual(false);
- expect(rb3.checked).toEqual(false);
- });
-
- it('should set checked via string group value, and number button values', () => {
- let rb1 = createRadioButton();
- rb1.value = 1;
- let rb2 = createRadioButton();
- rb2.value = 2;
- let rb3 = createRadioButton();
- rb3.value = 3;
-
- rg.value = '1';
- rg._update();
-
- expect(rb1.checked).toEqual(true);
- expect(rb2.checked).toEqual(false);
- expect(rb3.checked).toEqual(false);
- });
-
- it('should set checked via number group value, and string button values', () => {
- let rb1 = createRadioButton();
- rb1.value = '1';
- let rb2 = createRadioButton();
- rb2.value = '2';
- let rb3 = createRadioButton();
- rb3.value = '3';
-
- rg.value = 1;
- rg._update();
-
- expect(rb1.checked).toEqual(true);
- expect(rb2.checked).toEqual(false);
- expect(rb3.checked).toEqual(false);
- });
-
- it('should set checked via empty string group value, and one empty string button value', () => {
- let rb1 = createRadioButton();
- rb1.value = '';
- let rb2 = createRadioButton();
- rb2.value = 'value2';
- let rb3 = createRadioButton();
- rb3.value = 'value3';
-
- rg.value = '';
- rg._update();
-
- expect(rb1.checked).toEqual(true);
- expect(rb2.checked).toEqual(false);
- expect(rb3.checked).toEqual(false);
- });
-
- it('should only check at most one value', () => {
- let rb1 = createRadioButton();
- rb1.value = 'string1';
- let rb2 = createRadioButton();
- rb2.value = 'string1';
- let rb3 = createRadioButton();
- rb3.value = 'string1';
-
- rg.value = 'string1';
- rg._update();
-
- expect(rb1.checked).toEqual(true);
- expect(rb2.checked).toEqual(false);
- expect(rb3.checked).toEqual(false);
- });
+ rg.value = 'string1';
+ rg._update();
+ expect(rb1.checked).toEqual(true);
+ expect(rb2.checked).toEqual(false);
+ expect(rb3.checked).toEqual(false);
});
- });
- describe('RadioButton', () => {
+ it('should set checked via string group value, and number button values', () => {
+ let rb1 = createRadioButton();
+ rb1.value = 1;
+ let rb2 = createRadioButton();
+ rb2.value = 2;
+ let rb3 = createRadioButton();
+ rb3.value = 3;
- describe('ngOnDestroy', () => {
- it('should work without a group', () => {
- let rb1 = createRadioButton(false);
- expect(() => rb1.ngOnDestroy()).not.toThrowError();
- });
+ rg.value = '1';
+ rg._update();
- it('should remove button from group if part of a radio group', () => {
- let rb1 = createRadioButton();
- spyOn(rg, 'remove');
- rb1.ngOnDestroy();
- expect(rg.remove).toHaveBeenCalledWith(rb1);
- });
+ expect(rb1.checked).toEqual(true);
+ expect(rb2.checked).toEqual(false);
+ expect(rb3.checked).toEqual(false);
+ });
+ it('should set checked via number group value, and string button values', () => {
+ let rb1 = createRadioButton();
+ rb1.value = '1';
+ let rb2 = createRadioButton();
+ rb2.value = '2';
+ let rb3 = createRadioButton();
+ rb3.value = '3';
+
+ rg.value = 1;
+ rg._update();
+
+ expect(rb1.checked).toEqual(true);
+ expect(rb2.checked).toEqual(false);
+ expect(rb3.checked).toEqual(false);
+ });
+
+ it('should set checked via empty string group value, and one empty string button value', () => {
+ let rb1 = createRadioButton();
+ rb1.value = '';
+ let rb2 = createRadioButton();
+ rb2.value = 'value2';
+ let rb3 = createRadioButton();
+ rb3.value = 'value3';
+
+ rg.value = '';
+ rg._update();
+
+ expect(rb1.checked).toEqual(true);
+ expect(rb2.checked).toEqual(false);
+ expect(rb3.checked).toEqual(false);
+ });
+
+ it('should only check at most one value', () => {
+ let rb1 = createRadioButton();
+ rb1.value = 'string1';
+ let rb2 = createRadioButton();
+ rb2.value = 'string1';
+ let rb3 = createRadioButton();
+ rb3.value = 'string1';
+
+ rg.value = 'string1';
+ rg._update();
+
+ expect(rb1.checked).toEqual(true);
+ expect(rb2.checked).toEqual(false);
+ expect(rb3.checked).toEqual(false);
});
});
- let rg: RadioGroup;
- let form: Form;
-
- function createRadioButton(shouldIncludeGroup = true) {
- return new RadioButton(form, null, null, null, shouldIncludeGroup ? rg : null);
- }
-
- function mockRenderer(): any {
- return {
- setElementAttribute: function(){}
- };
- }
-
- function mockElementRef(): any {
- return {
- nativeElement: document.createElement('div')
- };
- }
-
beforeEach(() => {
rg = new RadioGroup(mockRenderer(), mockElementRef());
form = new Form();
});
+
+});
+
+describe('RadioButton', () => {
+
+ describe('ngOnDestroy', () => {
+ it('should work without a group', () => {
+ let rb1 = createRadioButton(false);
+ expect(() => rb1.ngOnDestroy()).not.toThrowError();
+ });
+
+ it('should remove button from group if part of a radio group', () => {
+ let rb1 = createRadioButton();
+ spyOn(rg, 'remove');
+ rb1.ngOnDestroy();
+ expect(rg.remove).toHaveBeenCalledWith(rb1);
+ });
+
+ });
+
+ beforeEach(() => {
+ rg = new RadioGroup(mockRenderer(), mockElementRef());
+ form = new Form();
+ });
+
+});
+
+let rg: RadioGroup;
+let form: Form;
+
+function createRadioButton(shouldIncludeGroup = true) {
+ return new RadioButton(form, mockConfig(), mockElementRef(), mockRenderer(), null, shouldIncludeGroup ? rg : null);
}
diff --git a/src/components/range/test/basic/index.ts b/src/components/range/test/basic/app-module.ts
similarity index 52%
rename from src/components/range/test/basic/index.ts
rename to src/components/range/test/basic/app-module.ts
index 2a0a610d15..39c32e9e45 100644
--- a/src/components/range/test/basic/index.ts
+++ b/src/components/range/test/basic/app-module.ts
@@ -1,11 +1,11 @@
-import { Component } from '@angular/core';
-import { ionicBootstrap, Range } from '../../../../../src';
+import { Component, NgModule } from '@angular/core';
+import { IonicApp, IonicModule, Range } from '../../../..';
@Component({
templateUrl: 'page1.html'
})
-class Page1 {
+export class Page1 {
singleValue: number;
singleValue2: number = 150;
singleValue3: number = 64;
@@ -22,8 +22,22 @@ class Page1 {
@Component({
templateUrl: 'main.html'
})
-class E2EApp {
+export class E2EApp {
rootPage = Page1;
}
-ionicBootstrap(E2EApp);
+@NgModule({
+ declarations: [
+ E2EApp,
+ Page1
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EApp,
+ Page1
+ ]
+})
+export class AppModule {}
diff --git a/src/components/refresher/test/basic/index.ts b/src/components/refresher/test/basic/app-module.ts
similarity index 81%
rename from src/components/refresher/test/basic/index.ts
rename to src/components/refresher/test/basic/app-module.ts
index 859232c9b7..465ce17b5b 100644
--- a/src/components/refresher/test/basic/index.ts
+++ b/src/components/refresher/test/basic/app-module.ts
@@ -1,11 +1,11 @@
-import { Component } from '@angular/core';
-import { ionicBootstrap, Refresher } from '../../../../../src';
+import { Component, NgModule } from '@angular/core';
+import { IonicApp, IonicModule, Refresher } from '../../../..';
@Component({
templateUrl: 'main.html'
})
-class Page1 {
+export class Page1 {
items: string[] = [];
constructor() {
@@ -89,8 +89,22 @@ const data = [
@Component({
template: ''
})
-class E2EApp {
+export class E2EApp {
rootPage = Page1;
}
-ionicBootstrap(E2EApp);
+@NgModule({
+ declarations: [
+ E2EApp,
+ Page1
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EApp,
+ Page1
+ ]
+})
+export class AppModule {}
diff --git a/src/components/scroll/test/basic/app-module.ts b/src/components/scroll/test/basic/app-module.ts
new file mode 100644
index 0000000000..0874dff8da
--- /dev/null
+++ b/src/components/scroll/test/basic/app-module.ts
@@ -0,0 +1,26 @@
+import { Component, NgModule } from '@angular/core';
+import { IonicApp, IonicModule } from '../../../..';
+
+
+@Component({
+ templateUrl: 'main.html'
+})
+export class E2EApp {
+ doRefresh() {
+ console.log('DOREFRESH');
+ }
+}
+
+@NgModule({
+ declarations: [
+ E2EApp
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EApp
+ ]
+})
+export class AppModule {}
diff --git a/src/components/scroll/test/basic/index.ts b/src/components/scroll/test/basic/index.ts
deleted file mode 100644
index 53052edd37..0000000000
--- a/src/components/scroll/test/basic/index.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { Component } from '@angular/core';
-import { ionicBootstrap } from '../../../../../src';
-
-
-@Component({
- templateUrl: 'main.html'
-})
-class E2EApp {
- doRefresh() {
- console.log('DOREFRESH');
- }
-}
-
-ionicBootstrap(E2EApp);
diff --git a/src/components/searchbar/test/basic/index.ts b/src/components/searchbar/test/basic/app-module.ts
similarity index 72%
rename from src/components/searchbar/test/basic/index.ts
rename to src/components/searchbar/test/basic/app-module.ts
index 0bb02d84df..b8a0858ea4 100644
--- a/src/components/searchbar/test/basic/index.ts
+++ b/src/components/searchbar/test/basic/app-module.ts
@@ -1,11 +1,11 @@
-import { Component, ChangeDetectorRef } from '@angular/core';
-import { ionicBootstrap } from '../../../../../src';
+import { Component, ChangeDetectorRef, NgModule } from '@angular/core';
+import { IonicApp, IonicModule } from '../../../..';
@Component({
templateUrl: 'main.html'
})
-class E2EPage {
+export class E2EPage {
defaultSearch: string = 'test';
customPlaceholder: number = 2;
defaultCancel: string = '';
@@ -52,8 +52,22 @@ class E2EPage {
@Component({
template: ''
})
-class E2EApp {
+export class E2EApp {
root = E2EPage;
}
-ionicBootstrap(E2EApp);
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EApp,
+ E2EPage
+ ]
+})
+export class AppModule {}
diff --git a/src/components/searchbar/test/nav/index.ts b/src/components/searchbar/test/nav/app-module.ts
similarity index 76%
rename from src/components/searchbar/test/nav/index.ts
rename to src/components/searchbar/test/nav/app-module.ts
index af978822d9..f75d1de3fa 100644
--- a/src/components/searchbar/test/nav/index.ts
+++ b/src/components/searchbar/test/nav/app-module.ts
@@ -1,11 +1,11 @@
-import { Component } from '@angular/core';
-import { ionicBootstrap, NavController, NavParams } from '../../../../../src';
+import { Component, NgModule } from '@angular/core';
+import { IonicApp, IonicModule, NavController, NavParams } from '../../../..';
@Component({
templateUrl: 'main.html'
})
-class MainPage {
+export class MainPage {
constructor(public navCtrl: NavController) { }
goToSecond() {
@@ -16,7 +16,7 @@ class MainPage {
@Component({
templateUrl: 'search.html'
})
-class SearchPage {
+export class SearchPage {
items: string[];
constructor(public navCtrl: NavController) {
@@ -93,7 +93,7 @@ class SearchPage {
@Component({
templateUrl: 'detail.html'
})
-class DetailPage {
+export class DetailPage {
city: string;
constructor(private _navParams: NavParams) {
@@ -104,7 +104,7 @@ class DetailPage {
@Component({
templateUrl: 'tabs.html'
})
-class TabsPage {
+export class TabsPage {
mainPage = MainPage;
searchPage = SearchPage;
}
@@ -112,8 +112,28 @@ class TabsPage {
@Component({
template: ''
})
-class E2EApp {
+export class E2EApp {
root = TabsPage;
}
-ionicBootstrap(E2EApp);
+@NgModule({
+ declarations: [
+ E2EApp,
+ MainPage,
+ SearchPage,
+ DetailPage,
+ TabsPage
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EApp,
+ MainPage,
+ SearchPage,
+ DetailPage,
+ TabsPage
+ ]
+})
+export class AppModule {}
diff --git a/src/components/searchbar/test/toolbar/app-module.ts b/src/components/searchbar/test/toolbar/app-module.ts
new file mode 100644
index 0000000000..593ca4783c
--- /dev/null
+++ b/src/components/searchbar/test/toolbar/app-module.ts
@@ -0,0 +1,36 @@
+import { Component, NgModule } from '@angular/core';
+import { IonicApp, IonicModule } from '../../../..';
+
+
+@Component({
+ templateUrl: 'main.html'
+})
+export class E2EPage {
+ defaultToolbarSearch: string = '';
+ primaryToolbarSearch: string = '';
+ darkToolbarSearch: string = '';
+ lightToolbarSearch: string = '';
+}
+
+@Component({
+ template: ''
+})
+export class E2EApp {
+ root = E2EPage;
+}
+
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EApp,
+ E2EPage
+ ]
+})
+export class AppModule {}
diff --git a/src/components/searchbar/test/toolbar/index.ts b/src/components/searchbar/test/toolbar/index.ts
deleted file mode 100644
index 48ccb8623f..0000000000
--- a/src/components/searchbar/test/toolbar/index.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-import { Component } from '@angular/core';
-import { ionicBootstrap } from '../../../../../src';
-
-
-@Component({
- templateUrl: 'main.html'
-})
-class E2EPage {
- defaultToolbarSearch: string = '';
- primaryToolbarSearch: string = '';
- darkToolbarSearch: string = '';
- lightToolbarSearch: string = '';
-}
-
-@Component({
- template: ''
-})
-class E2EApp {
- root = E2EPage;
-}
-
-ionicBootstrap(E2EApp);
diff --git a/src/components/segment/test/basic/index.ts b/src/components/segment/test/basic/app-module.ts
similarity index 70%
rename from src/components/segment/test/basic/index.ts
rename to src/components/segment/test/basic/app-module.ts
index c8afcbe867..a7742dbfdd 100644
--- a/src/components/segment/test/basic/index.ts
+++ b/src/components/segment/test/basic/app-module.ts
@@ -1,12 +1,12 @@
-import { Component } from '@angular/core';
+import { Component, NgModule } from '@angular/core';
import { FormBuilder, Validators } from '@angular/forms';
-import { ionicBootstrap, SegmentButton } from '../../../../../src';
+import { IonicApp, IonicModule, SegmentButton } from '../../../..';
@Component({
templateUrl: 'main.html'
})
-class E2EPage {
+export class E2EPage {
relationship: string = 'enemies';
modelStyle: string = 'B';
appType: string = 'free';
@@ -41,8 +41,22 @@ class E2EPage {
@Component({
template: ''
})
-class E2EApp {
+export class E2EApp {
root = E2EPage;
}
-ionicBootstrap(E2EApp);
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EApp,
+ E2EPage
+ ]
+})
+export class AppModule {}
diff --git a/src/components/segment/test/nav/index.ts b/src/components/segment/test/nav/app-module.ts
similarity index 58%
rename from src/components/segment/test/nav/index.ts
rename to src/components/segment/test/nav/app-module.ts
index 1cef045f35..0ae102e83a 100644
--- a/src/components/segment/test/nav/index.ts
+++ b/src/components/segment/test/nav/app-module.ts
@@ -1,11 +1,11 @@
-import { Component } from '@angular/core';
-import { ionicBootstrap, NavController } from '../../../../../src';
+import { Component, NgModule } from '@angular/core';
+import { IonicApp, IonicModule, NavController } from '../../../..';
@Component({
templateUrl: 'main.html',
})
-class SegmentPage {
+export class SegmentPage {
signInType: string;
constructor(public navCtrl: NavController) {
@@ -35,14 +35,30 @@ class SegmentPage {
`
})
-class SegmentPage2 {}
+export class SegmentPage2 {}
@Component({
template: ``
})
-class E2EApp {
+export class E2EApp {
root = SegmentPage;
}
-ionicBootstrap(E2EApp);
+@NgModule({
+ declarations: [
+ E2EApp,
+ SegmentPage,
+ SegmentPage2
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EApp,
+ SegmentPage,
+ SegmentPage2
+ ]
+})
+export class AppModule {}
diff --git a/src/components/segment/test/swipe/index.ts b/src/components/segment/test/swipe/app-module.ts
similarity index 51%
rename from src/components/segment/test/swipe/index.ts
rename to src/components/segment/test/swipe/app-module.ts
index 60b791b943..0ab9cec0b2 100644
--- a/src/components/segment/test/swipe/index.ts
+++ b/src/components/segment/test/swipe/app-module.ts
@@ -1,26 +1,26 @@
-import { Component, ViewChild } from '@angular/core';
-import { ionicBootstrap, Slides, SegmentButton } from '../../../../../src';
+import { Component, ViewChild, NgModule } from '@angular/core';
+import { IonicApp, IonicModule, Slides, SegmentButton } from '../../../..';
@Component({
templateUrl: 'main.html',
})
-class SegmentPage {
+export class SegmentPage {
@ViewChild('loopSlider') sliderComponent: Slides;
- selectedSegment = "first";
+ selectedSegment = 'first';
slides = [
{
- id: "first",
- title: "First Slide"
+ id: 'first',
+ title: 'First Slide'
},
{
- id: "second",
- title: "Second Slide"
+ id: 'second',
+ title: 'Second Slide'
},
{
- id: "third",
- title: "Third Slide"
+ id: 'third',
+ title: 'Third Slide'
}
];
@@ -29,7 +29,7 @@ class SegmentPage {
}
onSegmentChanged(segmentButton: SegmentButton) {
- console.log("Segment changed to", segmentButton.value);
+ console.log('Segment changed to', segmentButton.value);
const selectedIndex = this.slides.findIndex((slide) => {
return slide.id === segmentButton.value;
@@ -49,8 +49,22 @@ class SegmentPage {
@Component({
template: ``
})
-class E2EApp {
+export class E2EApp {
root = SegmentPage;
}
-ionicBootstrap(E2EApp);
+@NgModule({
+ declarations: [
+ E2EApp,
+ SegmentPage
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EApp,
+ SegmentPage
+ ]
+})
+export class AppModule {}
diff --git a/src/components/select/test/multiple-value/index.ts b/src/components/select/test/multiple-value/app-module.ts
similarity index 73%
rename from src/components/select/test/multiple-value/index.ts
rename to src/components/select/test/multiple-value/app-module.ts
index bf8f707dce..be4ce4cac3 100644
--- a/src/components/select/test/multiple-value/index.ts
+++ b/src/components/select/test/multiple-value/app-module.ts
@@ -1,12 +1,12 @@
-import { Component } from '@angular/core';
+import { Component, NgModule } from '@angular/core';
import { FormControl, FormGroup } from '@angular/forms';
-import { ionicBootstrap } from '../../../../../src';
+import { IonicApp, IonicModule } from '../../../..';
@Component({
templateUrl: 'main.html'
})
-class E2EPage {
+export class E2EPage {
toppings: Array;
carFeatures: Array;
pets: Array;
@@ -47,8 +47,22 @@ class E2EPage {
@Component({
template: ''
})
-class E2EApp {
+export class E2EApp {
root = E2EPage;
}
-ionicBootstrap(E2EApp);
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EApp,
+ E2EPage
+ ]
+})
+export class AppModule {}
diff --git a/src/components/select/test/multiple-value/e2e.ts b/src/components/select/test/multiple-value/e2e.ts
index 48f1324e4a..731f977a74 100644
--- a/src/components/select/test/multiple-value/e2e.ts
+++ b/src/components/select/test/multiple-value/e2e.ts
@@ -1,4 +1,4 @@
it('should open toppings multiple select', function() {
element(by.css('.e2eSelectToppings button')).click();
-});
\ No newline at end of file
+});
diff --git a/src/components/select/test/single-value/index.ts b/src/components/select/test/single-value/app-module.ts
similarity index 80%
rename from src/components/select/test/single-value/index.ts
rename to src/components/select/test/single-value/app-module.ts
index bb58a8ad70..b5ca788866 100644
--- a/src/components/select/test/single-value/index.ts
+++ b/src/components/select/test/single-value/app-module.ts
@@ -1,5 +1,5 @@
-import { Component } from '@angular/core';
-import { ionicBootstrap } from '../../../../../src';
+import { Component, NgModule } from '@angular/core';
+import { IonicApp, IonicModule } from '../../../..';
export interface Currency {
symbol: string;
@@ -10,7 +10,8 @@ export interface Currency {
@Component({
templateUrl: 'main.html'
})
-class E2EPage {
+export class E2EPage {
+ notifications: any;
musicSelectOpts: any = {
title: '1994 Music',
subTitle: 'Select your favorite',
@@ -87,8 +88,22 @@ class E2EPage {
@Component({
template: ''
})
-class E2EApp {
+export class E2EApp {
root = E2EPage;
}
-ionicBootstrap(E2EApp);
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EApp,
+ E2EPage
+ ]
+})
+export class AppModule {}
diff --git a/src/components/select/test/single-value/e2e.ts b/src/components/select/test/single-value/e2e.ts
index 03954febef..0e536eabc7 100644
--- a/src/components/select/test/single-value/e2e.ts
+++ b/src/components/select/test/single-value/e2e.ts
@@ -1,4 +1,4 @@
it('should open gender single select', function() {
element(by.css('.e2eSelectGender button')).click();
-});
\ No newline at end of file
+});
diff --git a/src/components/show-hide-when/test/basic/app-module.ts b/src/components/show-hide-when/test/basic/app-module.ts
new file mode 100644
index 0000000000..a906c2641b
--- /dev/null
+++ b/src/components/show-hide-when/test/basic/app-module.ts
@@ -0,0 +1,34 @@
+import { Component, NgModule } from '@angular/core';
+import { IonicApp, IonicModule } from '../../../..';
+
+
+@Component({
+ templateUrl: 'main.html'
+})
+export class E2EPage {
+ toggle = true;
+}
+
+
+@Component({
+ template: ''
+})
+export class E2EApp {
+ root = E2EPage;
+}
+
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EApp,
+ E2EPage
+ ]
+})
+export class AppModule {}
diff --git a/src/components/show-hide-when/test/basic/index.ts b/src/components/show-hide-when/test/basic/index.ts
deleted file mode 100644
index 946a39ade9..0000000000
--- a/src/components/show-hide-when/test/basic/index.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import { Component } from '@angular/core';
-import { ionicBootstrap } from '../../../../../src';
-
-
-@Component({
- templateUrl: 'main.html'
-})
-class E2EPage {}
-
-
-@Component({
- template: ''
-})
-class E2EApp {
- root = E2EPage;
-}
-
-ionicBootstrap(E2EApp);
diff --git a/src/components/slides/test/basic/index.ts b/src/components/slides/test/basic/app-module.ts
similarity index 75%
rename from src/components/slides/test/basic/index.ts
rename to src/components/slides/test/basic/app-module.ts
index 7267dd95ab..c85c8e4dc9 100644
--- a/src/components/slides/test/basic/index.ts
+++ b/src/components/slides/test/basic/app-module.ts
@@ -1,12 +1,12 @@
-import { Component, ViewChild } from '@angular/core';
+import { Component, ViewChild, NgModule } from '@angular/core';
import { Http } from '@angular/http';
-import { ionicBootstrap, Slides } from '../../../../../src';
+import { IonicApp, IonicModule, Slides } from '../../../..';
@Component({
templateUrl: 'main.html'
})
-class E2EApp {
+export class E2EApp {
mySlideOptions: any;
images: string[] = [];
@ViewChild(Slides) slider: Slides;
@@ -43,4 +43,16 @@ class E2EApp {
}
-ionicBootstrap(E2EApp);
+@NgModule({
+ declarations: [
+ E2EApp
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EApp
+ ]
+})
+export class AppModule {}
diff --git a/src/components/slides/test/controller/index.ts b/src/components/slides/test/controller/app-module.ts
similarity index 70%
rename from src/components/slides/test/controller/index.ts
rename to src/components/slides/test/controller/app-module.ts
index 03b122e490..827a5260e5 100644
--- a/src/components/slides/test/controller/index.ts
+++ b/src/components/slides/test/controller/app-module.ts
@@ -1,11 +1,11 @@
-import { Component, ViewChild } from '@angular/core';
-import { ionicBootstrap, Slides } from '../../../../../src';
+import { Component, ViewChild, NgModule } from '@angular/core';
+import { IonicApp, IonicModule, Slides } from '../../../..';
@Component({
templateUrl: 'main.html'
})
-class MyPage {
+export class MyPage {
@ViewChild('mySlider') slider: Slides;
mySlideOptions = {
initialSlide: 1,
@@ -49,8 +49,22 @@ class MyPage {
@Component({
template: ``
})
-class E2EApp {
+export class E2EApp {
root: any = MyPage;
}
-ionicBootstrap(E2EApp);
+@NgModule({
+ declarations: [
+ E2EApp,
+ MyPage
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EApp,
+ MyPage
+ ]
+})
+export class AppModule {}
diff --git a/src/components/slides/test/intro/index.ts b/src/components/slides/test/intro/app-module.ts
similarity index 71%
rename from src/components/slides/test/intro/index.ts
rename to src/components/slides/test/intro/app-module.ts
index 45c337df6a..7ff7111824 100644
--- a/src/components/slides/test/intro/index.ts
+++ b/src/components/slides/test/intro/app-module.ts
@@ -1,11 +1,11 @@
-import { Component } from '@angular/core';
-import { ionicBootstrap, NavController } from '../../../../../src';
+import { Component, NgModule } from '@angular/core';
+import { IonicApp, IonicModule, NavController } from '../../../..';
@Component({
templateUrl: 'main.html'
})
-class IntroPage {
+export class IntroPage {
continueText: string = 'Skip';
startingIndex: number = 1;
mySlideOptions: any;
@@ -55,14 +55,30 @@ class IntroPage {
`
})
-class MainPage {}
+export class MainPage {}
@Component({
template: ''
})
-class E2EApp {
+export class E2EApp {
root = IntroPage;
}
-ionicBootstrap(E2EApp);
+@NgModule({
+ declarations: [
+ E2EApp,
+ IntroPage,
+ MainPage
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EApp,
+ IntroPage,
+ MainPage
+ ]
+})
+export class AppModule {}
diff --git a/src/components/slides/test/loop/index.ts b/src/components/slides/test/loop/app-module.ts
similarity index 65%
rename from src/components/slides/test/loop/index.ts
rename to src/components/slides/test/loop/app-module.ts
index 582158acbe..8eda3ccdeb 100644
--- a/src/components/slides/test/loop/index.ts
+++ b/src/components/slides/test/loop/app-module.ts
@@ -1,11 +1,11 @@
-import { Component, ViewChild } from '@angular/core';
-import { ionicBootstrap, Slides } from '../../../../../src';
+import { Component, ViewChild, NgModule } from '@angular/core';
+import { IonicApp, IonicModule, Slides } from '../../../..';
@Component({
templateUrl: 'main.html'
})
-class E2EApp {
+export class E2EApp {
slides: any[];
@ViewChild('loopSlider') loopSlider: Slides;
startingIndex: number;
@@ -44,4 +44,16 @@ class E2EApp {
}
-ionicBootstrap(E2EApp);
+@NgModule({
+ declarations: [
+ E2EApp
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EApp
+ ]
+})
+export class AppModule {}
diff --git a/src/components/slides/test/scroll/app-module.ts b/src/components/slides/test/scroll/app-module.ts
new file mode 100644
index 0000000000..874b3a3c29
--- /dev/null
+++ b/src/components/slides/test/scroll/app-module.ts
@@ -0,0 +1,22 @@
+import { Component, NgModule } from '@angular/core';
+import { IonicApp, IonicModule } from '../../../..';
+
+
+@Component({
+ templateUrl: 'main.html'
+})
+export class E2EApp {}
+
+@NgModule({
+ declarations: [
+ E2EApp
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EApp
+ ]
+})
+export class AppModule {}
diff --git a/src/components/slides/test/scroll/index.ts b/src/components/slides/test/scroll/index.ts
deleted file mode 100644
index 13b93540f2..0000000000
--- a/src/components/slides/test/scroll/index.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-import { Component } from '@angular/core';
-import { ionicBootstrap } from '../../../../../src';
-
-
-@Component({
- templateUrl: 'main.html'
-})
-class E2EApp {}
-
-ionicBootstrap(E2EApp);
diff --git a/src/components/spinner/test/basic/app-module.ts b/src/components/spinner/test/basic/app-module.ts
new file mode 100644
index 0000000000..857cb83ccd
--- /dev/null
+++ b/src/components/spinner/test/basic/app-module.ts
@@ -0,0 +1,38 @@
+import { Component, NgModule } from '@angular/core';
+import { IonicApp, IonicModule } from '../../../..';
+
+
+@Component({
+ templateUrl: 'main.html'
+})
+export class E2EPage {
+ paused: boolean = false;
+
+ toggleState() {
+ this.paused = !this.paused;
+ }
+}
+
+
+@Component({
+ template: ''
+})
+export class E2EApp {
+ root = E2EPage;
+}
+
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EApp,
+ E2EPage
+ ]
+})
+export class AppModule {}
diff --git a/src/components/spinner/test/basic/index.ts b/src/components/spinner/test/basic/index.ts
deleted file mode 100644
index c196220921..0000000000
--- a/src/components/spinner/test/basic/index.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-import { Component } from '@angular/core';
-import { ionicBootstrap } from '../../../../../src';
-
-
-@Component({
- templateUrl: 'main.html'
-})
-class E2EPage {
- paused: boolean = false;
-
- toggleState() {
- this.paused = !this.paused;
- }
-}
-
-
-@Component({
- template: ''
-})
-class E2EApp {
- root = E2EPage;
-}
-
-ionicBootstrap(E2EApp);
diff --git a/src/components/spinner/test/colors/app-module.ts b/src/components/spinner/test/colors/app-module.ts
new file mode 100644
index 0000000000..857cb83ccd
--- /dev/null
+++ b/src/components/spinner/test/colors/app-module.ts
@@ -0,0 +1,38 @@
+import { Component, NgModule } from '@angular/core';
+import { IonicApp, IonicModule } from '../../../..';
+
+
+@Component({
+ templateUrl: 'main.html'
+})
+export class E2EPage {
+ paused: boolean = false;
+
+ toggleState() {
+ this.paused = !this.paused;
+ }
+}
+
+
+@Component({
+ template: ''
+})
+export class E2EApp {
+ root = E2EPage;
+}
+
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EApp,
+ E2EPage
+ ]
+})
+export class AppModule {}
diff --git a/src/components/spinner/test/colors/index.ts b/src/components/spinner/test/colors/index.ts
deleted file mode 100644
index c196220921..0000000000
--- a/src/components/spinner/test/colors/index.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-import { Component } from '@angular/core';
-import { ionicBootstrap } from '../../../../../src';
-
-
-@Component({
- templateUrl: 'main.html'
-})
-class E2EPage {
- paused: boolean = false;
-
- toggleState() {
- this.paused = !this.paused;
- }
-}
-
-
-@Component({
- template: ''
-})
-class E2EApp {
- root = E2EPage;
-}
-
-ionicBootstrap(E2EApp);
diff --git a/src/components/tabs/test/advanced/index.ts b/src/components/tabs/test/advanced/app-module.ts
similarity index 59%
rename from src/components/tabs/test/advanced/index.ts
rename to src/components/tabs/test/advanced/app-module.ts
index 8de21910ef..10dbd5f8a5 100644
--- a/src/components/tabs/test/advanced/index.ts
+++ b/src/components/tabs/test/advanced/app-module.ts
@@ -1,48 +1,40 @@
-import { Component, ViewChild } from '@angular/core';
-
-import { App, ionicBootstrap, NavController, NavParams, ModalController, ViewController, Tabs, Tab } from '../../../../../src';
+import { Component, NgModule, ViewChild } from '@angular/core';
+import { /*DeepLink,*/ DeepLinkConfig, IonicApp, IonicModule, App, NavController, NavParams, ModalController, ViewController, Tabs, Tab } from '../../../..';
+// @DeepLink({ name: 'sign-in' })
@Component({
templateUrl: './signIn.html'
})
-class SignIn {
- constructor(public navCtrl: NavController) {}
-
- push() {
- this.navCtrl.push(TabsPage, {
- userId: 8675309
- });
- }
-}
+export class SignIn {}
@Component({
templateUrl: './modalChat.html'
})
-class ChatPage {
+export class ChatPage {
+
constructor(public viewCtrl: ViewController) {}
- ionViewLoaded() {
- console.log('ChatPage, ionViewLoaded');
+ ionViewDidLoad() {
+ console.log('ChatPage, ionViewDidLoad');
}
- ionViewDidUnload() {
- console.log('ChatPage, ionViewDidUnload');
+ ionViewWillUnload() {
+ console.log('ChatPage, ionViewWillUnload');
}
}
+// @DeepLink({ name: 'tabs' })
@Component({
templateUrl: './tabs.html'
})
-class TabsPage {
- tab1Root = Tab1Page1;
- tab2Root = Tab2Page1;
- tab3Root = Tab3Page1;
+export class TabsPage {
+
@ViewChild(Tabs) tabs: Tabs;
- constructor(private modalCtrl: ModalController, private params: NavParams) {}
+ constructor(public modalCtrl: ModalController, public params: NavParams) {}
ngAfterViewInit() {
this.tabs.ionChange.subscribe((tab: Tab) => {
@@ -77,8 +69,8 @@ class TabsPage {
console.log('TabsPage, ionViewDidLeave');
}
- ionViewDidUnload() {
- console.log('TabsPage, ionViewDidUnload');
+ ionViewWillUnload() {
+ console.log('TabsPage, ionViewWillUnload');
}
}
@@ -86,20 +78,17 @@ class TabsPage {
//
// tab 1
//
+// @DeepLink({ name: 'tab1-page1' })
@Component({
templateUrl: './tab1page1.html'
})
-class Tab1Page1 {
+export class Tab1Page1 {
userId: string;
constructor(public navCtrl: NavController, public app: App, public tabs: Tabs, public params: NavParams) {
this.userId = params.get('userId');
}
- push() {
- this.navCtrl.push(Tab1Page2);
- }
-
goBack() {
console.log('go back begin');
this.navCtrl.pop().then((val: any) => {
@@ -131,21 +120,17 @@ class Tab1Page1 {
console.log('Tab1Page1, ionViewDidLeave');
}
- ionViewDidUnload() {
- console.log('Tab1Page1, ionViewDidUnload');
+ ionViewWillUnload() {
+ console.log('Tab1Page1, ionViewWillUnload');
}
}
+// @DeepLink({ name: 'tab1-page2' })
@Component({
templateUrl: './tab1page2.html'
})
-class Tab1Page2 {
- constructor(public navCtrl: NavController) {}
-
- push() {
- this.navCtrl.push(Tab1Page3);
- }
+export class Tab1Page2 {
ionViewWillEnter() {
console.log('Tab1Page2, ionViewWillEnter');
@@ -163,16 +148,18 @@ class Tab1Page2 {
console.log('Tab1Page2, ionViewDidLeave');
}
- ionViewDidUnload() {
- console.log('Tab1Page2, ionViewDidUnload');
+ ionViewWillUnload() {
+ console.log('Tab1Page2, ionViewWillUnload');
}
}
+// @DeepLink({ name: 'tab1-page3' })
@Component({
templateUrl: './tab1page3.html'
})
-class Tab1Page3 {
+export class Tab1Page3 {
+
constructor(public navCtrl: NavController) {}
ionViewWillEnter() {
@@ -191,8 +178,8 @@ class Tab1Page3 {
console.log('Tab1Page3, ionViewDidLeave');
}
- ionViewDidUnload() {
- console.log('Tab1Page3, ionViewDidUnload');
+ ionViewWillUnload() {
+ console.log('Tab1Page3, ionViewWillUnload');
}
}
@@ -200,15 +187,11 @@ class Tab1Page3 {
//
// tab 2
//
+// @DeepLink({ name: 'tab2-page1' })
@Component({
templateUrl: './tab2page1.html'
})
-class Tab2Page1 {
- constructor(public navCtrl: NavController) {}
-
- push() {
- this.navCtrl.push(Tab2Page2);
- }
+export class Tab2Page1 {
ionViewWillEnter() {
console.log('Tab2Page1, ionViewWillEnter');
@@ -226,21 +209,17 @@ class Tab2Page1 {
console.log('Tab2Page1, ionViewDidLeave');
}
- ionViewDidUnload() {
- console.log('Tab2Page1, ionViewDidUnload');
+ ionViewWillUnload() {
+ console.log('Tab2Page1, ionViewWillUnload');
}
}
+// @DeepLink({ name: 'tab2-page2' })
@Component({
templateUrl: './tab2page2.html'
})
-class Tab2Page2 {
- constructor(public navCtrl: NavController) {}
-
- push() {
- this.navCtrl.push(Tab2Page3);
- }
+export class Tab2Page2 {
ionViewWillEnter() {
console.log('Tab2Page2, ionViewWillEnter');
@@ -258,16 +237,21 @@ class Tab2Page2 {
console.log('Tab2Page2, ionViewDidLeave');
}
- ionViewDidUnload() {
- console.log('Tab2Page2, ionViewDidUnload');
+ ionViewWillUnload() {
+ console.log('Tab2Page2, ionViewWillUnload');
}
}
+// @DeepLink({
+// name: 'tab2-page3',
+// defaultHistory: []
+// })
@Component({
templateUrl: './tab2page3.html'
})
-class Tab2Page3 {
+export class Tab2Page3 {
+
constructor(public navCtrl: NavController) {}
ionViewWillEnter() {
@@ -286,8 +270,8 @@ class Tab2Page3 {
console.log('Tab2Page3, ionViewDidLeave');
}
- ionViewDidUnload() {
- console.log('Tab2Page3, ionViewDidUnload');
+ ionViewWillUnload() {
+ console.log('Tab2Page3, ionViewWillUnload');
}
}
@@ -295,10 +279,11 @@ class Tab2Page3 {
//
// tab 3
//
+// @DeepLink({ name: 'tab3-page1' })
@Component({
templateUrl: './tab3page1.html'
})
-class Tab3Page1 {
+export class Tab3Page1 {
ionViewWillEnter() {
console.log('Tab3Page1, ionViewWillEnter');
@@ -316,17 +301,62 @@ class Tab3Page1 {
console.log('Tab3Page1, ionViewDidLeave');
}
- ionViewDidUnload() {
- console.log('Tab3Page1, ionViewDidUnload');
+ ionViewWillUnload() {
+ console.log('Tab3Page1, ionViewWillUnload');
}
}
-
@Component({
- template: ''
+ template: ''
})
-class E2EApp {
- root = TabsPage;
+export class E2EApp {
+ rootPage = SignIn;
}
-ionicBootstrap(E2EApp);
+
+export const deepLinkConfig: DeepLinkConfig = {
+ links: [
+ { component: SignIn, name: 'sign-in' },
+ { component: TabsPage, name: 'tabs' },
+ { component: Tab1Page1, name: 'tab1-page1' },
+ { component: Tab1Page2, name: 'tab1-page2' },
+ { component: Tab1Page3, name: 'tab1-page3' },
+ { component: Tab2Page1, name: 'tab2-page1' },
+ { component: Tab2Page2, name: 'tab2-page2' },
+ { component: Tab2Page3, name: 'tab2-page3' },
+ { component: Tab3Page1, name: 'tab3-page1' },
+ ]
+};
+
+@NgModule({
+ declarations: [
+ E2EApp,
+ SignIn,
+ ChatPage,
+ TabsPage,
+ Tab1Page1,
+ Tab1Page2,
+ Tab1Page3,
+ Tab2Page1,
+ Tab2Page2,
+ Tab2Page3,
+ Tab3Page1
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp, null, deepLinkConfig)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ SignIn,
+ ChatPage,
+ TabsPage,
+ Tab1Page1,
+ Tab1Page2,
+ Tab1Page3,
+ Tab2Page1,
+ Tab2Page2,
+ Tab2Page3,
+ Tab3Page1
+ ]
+})
+export class AppModule {}
diff --git a/src/components/tabs/test/advanced/e2e.ts b/src/components/tabs/test/advanced/e2e.ts
index bc9e75eaed..44079fa3e1 100644
--- a/src/components/tabs/test/advanced/e2e.ts
+++ b/src/components/tabs/test/advanced/e2e.ts
@@ -1,20 +1,20 @@
-// it('should go to Tab1 Page1', function() {
-// element(by.css('#signIn')).click();
-// });
-//
-// it('should go to Tab1 Page2', function() {
-// element(by.css('#goToTab1Page2')).click();
-// });
-//
-// it('should go back to Tab1 Page1', function() {
-// element(by.css('#backToTab1Page1')).click();
-// });
-//
-// it('should go to Tab2 Page1', function() {
-// element(by.css('.tab-button:nth-of-type(2)')).click();
-// });
-//
-// it('should go back to Tab1 Page1', function() {
-// element(by.css('.tab-button:nth-of-type(1)')).click();
-// });
+it('should go to Tab1 Page1', function() {
+ element(by.css('.e2eSignIn')).click();
+});
+
+it('should go to Tab1 Page2', function() {
+ element(by.css('.e2eGoToTab1Page2')).click();
+});
+
+it('should go back to Tab1 Page1', function() {
+ element(by.css('.e2eBackToTab1Page1')).click();
+});
+
+it('should go to Tab2 Page1', function() {
+ element(by.css('.tab-button:nth-of-type(2)')).click();
+});
+
+it('should go back to Tab1 Page1', function() {
+ element(by.css('.tab-button:nth-of-type(1)')).click();
+});
diff --git a/src/components/tabs/test/advanced/signIn.html b/src/components/tabs/test/advanced/signIn.html
index 3d2a5059fd..da6b30fe58 100644
--- a/src/components/tabs/test/advanced/signIn.html
+++ b/src/components/tabs/test/advanced/signIn.html
@@ -19,8 +19,12 @@
- Sign In
+ Sign In
+
+ View Tabs Page
+
+
diff --git a/src/components/tabs/test/advanced/tab1page1.html b/src/components/tabs/test/advanced/tab1page1.html
index 821c5a9b6b..91dc13ff84 100644
--- a/src/components/tabs/test/advanced/tab1page1.html
+++ b/src/components/tabs/test/advanced/tab1page1.html
@@ -9,12 +9,12 @@
- Go to Tab 1, Page 2
+ Go to Tab 1, Page 2
Logout
Favorites Tab
Go Back
UserId: {{userId}}
-
-
+
+
diff --git a/src/components/tabs/test/advanced/tab1page2.html b/src/components/tabs/test/advanced/tab1page2.html
index eb0669aa0f..fa5afc8f69 100644
--- a/src/components/tabs/test/advanced/tab1page2.html
+++ b/src/components/tabs/test/advanced/tab1page2.html
@@ -9,9 +9,9 @@
- Go to Tab 1, Page 3
- Back to Tab 1, Page 1
-
-
+ Go to Tab 1, Page 3
+ Back to Tab 1, Page 1
+
+
diff --git a/src/components/tabs/test/advanced/tab1page3.html b/src/components/tabs/test/advanced/tab1page3.html
index f6dc67eaad..5e52d6cb46 100644
--- a/src/components/tabs/test/advanced/tab1page3.html
+++ b/src/components/tabs/test/advanced/tab1page3.html
@@ -9,8 +9,8 @@
- Back to Tab 1, Page 2
-
-
+ Nav Pop
+
+
diff --git a/src/components/tabs/test/advanced/tab2page1.html b/src/components/tabs/test/advanced/tab2page1.html
index 8c2d595bc2..cd6d6d5e6b 100644
--- a/src/components/tabs/test/advanced/tab2page1.html
+++ b/src/components/tabs/test/advanced/tab2page1.html
@@ -9,8 +9,8 @@
- Go to Tab 2, Page 2
-
-
+ Go to Tab 2, Page 2
+
+
diff --git a/src/components/tabs/test/advanced/tab2page2.html b/src/components/tabs/test/advanced/tab2page2.html
index 0ecc30a35f..97572b232f 100644
--- a/src/components/tabs/test/advanced/tab2page2.html
+++ b/src/components/tabs/test/advanced/tab2page2.html
@@ -9,9 +9,9 @@
- Go to Tab 2, Page 3 (no navbar)
- Back to Tab 2, Page 1
-
-
+ Go to Tab 2, Page 3 (no navbar)
+ Back to Tab 2, Page 1
+
+
diff --git a/src/components/tabs/test/advanced/tab2page3.html b/src/components/tabs/test/advanced/tab2page3.html
index 11a7897dcd..42abbfe97a 100644
--- a/src/components/tabs/test/advanced/tab2page3.html
+++ b/src/components/tabs/test/advanced/tab2page3.html
@@ -6,7 +6,7 @@
No Header.
Back to Tab 2, Page 2
-
-
+
+
diff --git a/src/components/tabs/test/advanced/tabs.html b/src/components/tabs/test/advanced/tabs.html
index 53e15a20ce..5abb8ea736 100644
--- a/src/components/tabs/test/advanced/tabs.html
+++ b/src/components/tabs/test/advanced/tabs.html
@@ -1,7 +1,7 @@
-
-
-
+
+
+
diff --git a/src/components/tabs/test/badges/app-module.ts b/src/components/tabs/test/badges/app-module.ts
new file mode 100644
index 0000000000..3e2fda7a78
--- /dev/null
+++ b/src/components/tabs/test/badges/app-module.ts
@@ -0,0 +1,31 @@
+import { Component, ViewEncapsulation, NgModule } from '@angular/core';
+import { IonicApp, IonicModule } from '../../../..';
+
+@Component({template: 'hi'})
+export class E2EPage {}
+
+
+@Component({
+ templateUrl: 'main.html',
+ encapsulation: ViewEncapsulation.None
+})
+export class E2EApp {
+ root = E2EPage;
+ myBadge: number = 55;
+}
+
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EApp,
+ E2EPage
+ ]
+})
+export class AppModule {}
diff --git a/src/components/tabs/test/badges/index.ts b/src/components/tabs/test/badges/index.ts
deleted file mode 100644
index cf6fe8e945..0000000000
--- a/src/components/tabs/test/badges/index.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import { Component, ViewEncapsulation } from '@angular/core';
-import { ionicBootstrap } from '../../../../../src';
-
-@Component({template: 'hi'})
-class E2EPage {}
-
-
-@Component({
- templateUrl: 'main.html',
- styleUrls: ['styles.css'],
- encapsulation: ViewEncapsulation.None
-})
-class E2EApp {
- root = E2EPage;
- myBadge: number = 55;
-}
-
-ionicBootstrap(E2EApp);
diff --git a/src/components/tabs/test/badges/main.html b/src/components/tabs/test/badges/main.html
index 5d904a9493..81a98aedb7 100644
--- a/src/components/tabs/test/badges/main.html
+++ b/src/components/tabs/test/badges/main.html
@@ -1,3 +1,4 @@
+
@@ -66,3 +67,5 @@
+
+
\ No newline at end of file
diff --git a/src/components/tabs/test/badges/styles.css b/src/components/tabs/test/badges/styles.css
deleted file mode 100644
index 4855a8f245..0000000000
--- a/src/components/tabs/test/badges/styles.css
+++ /dev/null
@@ -1,12 +0,0 @@
-ion-tabs {
- margin-bottom: 20px;
-}
-
-ion-tabs,
-ion-tabs ion-tabbar {
- position: relative;
- top: auto;
- height: auto;
- visibility: visible;
- opacity: 1;
-}
diff --git a/src/components/tabs/test/basic/index.ts b/src/components/tabs/test/basic/app-module.ts
similarity index 92%
rename from src/components/tabs/test/basic/index.ts
rename to src/components/tabs/test/basic/app-module.ts
index 01167fb135..9341abad45 100644
--- a/src/components/tabs/test/basic/index.ts
+++ b/src/components/tabs/test/basic/app-module.ts
@@ -1,5 +1,5 @@
-import { Component } from '@angular/core';
-import { ionicBootstrap, App, AlertController, ModalController, ViewController, Tab, Tabs } from '../../../../../src';
+import { Component, NgModule } from '@angular/core';
+import { IonicApp, IonicModule, App, AlertController, ModalController, ViewController, Tab, Tabs } from '../../../..';
//
// Modal
@@ -43,7 +43,7 @@ import { ionicBootstrap, App, AlertController, ModalController, ViewController,
`
})
-class MyModal {
+export class MyModal {
items: any[] = [];
constructor(private viewCtrl: ViewController, private app: App) {
@@ -263,4 +263,26 @@ export class E2EApp {
root = TabsPage;
}
-ionicBootstrap(E2EApp);
+@NgModule({
+ declarations: [
+ E2EApp,
+ MyModal,
+ Tab1,
+ Tab2,
+ Tab3,
+ TabsPage
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EApp,
+ MyModal,
+ Tab1,
+ Tab2,
+ Tab3,
+ TabsPage
+ ]
+})
+export class AppModule {}
diff --git a/src/components/tabs/test/child-navs/index.ts b/src/components/tabs/test/child-navs/index.ts
deleted file mode 100644
index 2623aebe5f..0000000000
--- a/src/components/tabs/test/child-navs/index.ts
+++ /dev/null
@@ -1,148 +0,0 @@
-import { Component } from '@angular/core';
-import { ionicBootstrap, NavController, App, Alert, Modal, ViewController, Tab, Tabs } from '../../../../../src';
-
-
-//
-// Tab 1
-//
-@Component({
- template: `
-
-
-
- Tab 1
-
-
-
-
-
-
-
- `
-})
-class Tab1 {
- root = SecondPage;
-}
-
-//
-// Tab 2
-//
-@Component({
- template: `
-
-
-
- Tab 2
-
-
-
-
-
-
-
- `
-})
-class Tab2 {
- root = SecondPage;
-}
-
-//
-// Tab 3
-//
-@Component({
- template: `
-
-
-
- Tab 3
-
-
-
-
-
-
-
- `
-})
-class Tab3 {
- root = SecondPage;
-}
-
-@Component({
- template: `
-
- SecondPage Cmp
-
-
- `
-})
-class SecondPage {
- root = ThirdPage;
-}
-
-@Component({
- template: `
-
- ThirdPage Cmp
-
-
- `
-})
-class ThirdPage {
- root = FourthPage;
-}
-
-@Component({
- template: `
-
-
-
- Fourth Page Comp
-
-
-
-
-
-
- {{item}}
-
-
-
- `
-})
-class FourthPage {
- private items: string[];
-
- ionViewWillEnter() {
- let items: string[] = [];
- for ( let i = 0 ; i < 500; i++ ) {
- items.push(`Item ${(i + 1)}`);
- }
- this.items = items;
- }
-}
-
-
-@Component({
- template: `
-
-
-
-
-
- `
-})
-class TabsPage {
- root1 = Tab1;
- root2 = Tab2;
- root3 = Tab3;
-}
-
-@Component({
- template: ``
-})
-class E2EApp {
- root = TabsPage;
-}
-
-ionicBootstrap(E2EApp);
diff --git a/src/components/tabs/test/colors/app-module.ts b/src/components/tabs/test/colors/app-module.ts
new file mode 100644
index 0000000000..a3e6e94d0d
--- /dev/null
+++ b/src/components/tabs/test/colors/app-module.ts
@@ -0,0 +1,31 @@
+import { Component, ViewEncapsulation, NgModule } from '@angular/core';
+import { IonicApp, IonicModule } from '../../../..';
+
+
+@Component({template: 'hi'})
+export class E2EPage {}
+
+
+@Component({
+ templateUrl: 'main.html',
+ encapsulation: ViewEncapsulation.None
+})
+export class E2EApp {
+ root = E2EPage;
+}
+
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EApp,
+ E2EPage
+ ]
+})
+export class AppModule {}
diff --git a/src/components/tabs/test/colors/index.ts b/src/components/tabs/test/colors/index.ts
deleted file mode 100644
index 3dd955b571..0000000000
--- a/src/components/tabs/test/colors/index.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import { Component, ViewEncapsulation } from '@angular/core';
-import { ionicBootstrap } from '../../../../../src';
-
-
-@Component({template: 'hi'})
-class E2EPage {}
-
-
-@Component({
- templateUrl: 'main.html',
- styleUrls: ['styles.css'],
- encapsulation: ViewEncapsulation.None
-})
-class E2EApp {
- root = E2EPage;
-}
-
-ionicBootstrap(E2EApp);
diff --git a/src/components/tabs/test/colors/main.html b/src/components/tabs/test/colors/main.html
index e1b72ef9e1..7c9bcdb78f 100644
--- a/src/components/tabs/test/colors/main.html
+++ b/src/components/tabs/test/colors/main.html
@@ -1,3 +1,4 @@
+
@@ -69,3 +70,5 @@
+
+
\ No newline at end of file
diff --git a/src/components/tabs/test/colors/styles.css b/src/components/tabs/test/colors/styles.css
deleted file mode 100644
index 4855a8f245..0000000000
--- a/src/components/tabs/test/colors/styles.css
+++ /dev/null
@@ -1,12 +0,0 @@
-ion-tabs {
- margin-bottom: 20px;
-}
-
-ion-tabs,
-ion-tabs ion-tabbar {
- position: relative;
- top: auto;
- height: auto;
- visibility: visible;
- opacity: 1;
-}
diff --git a/src/components/tabs/test/ghost/index.ts b/src/components/tabs/test/ghost/app-module.ts
similarity index 80%
rename from src/components/tabs/test/ghost/index.ts
rename to src/components/tabs/test/ghost/app-module.ts
index e544c65de8..1a3bbc0132 100644
--- a/src/components/tabs/test/ghost/index.ts
+++ b/src/components/tabs/test/ghost/app-module.ts
@@ -1,5 +1,5 @@
-import { Component, ContentChild, QueryList, ViewChildren } from '@angular/core';
-import { ionicBootstrap, NavController, Tab } from '../../../../../src';
+import { Component, QueryList, ViewChildren, NgModule } from '@angular/core';
+import { IonicApp, IonicModule, Tab } from '../../../..';
//
@@ -17,7 +17,7 @@ import { ionicBootstrap, NavController, Tab } from '../../../../../src';
`
})
-class Tab1 {}
+export class Tab1 {}
//
// Tab 2
@@ -34,7 +34,7 @@ class Tab1 {}
`
})
-class Tab2 {}
+export class Tab2 {}
//
// Tab 3
@@ -54,7 +54,7 @@ class Tab2 {}
`
})
-class Tab3 {}
+export class Tab3 {}
//
// Tab 3
@@ -74,7 +74,7 @@ class Tab3 {}
`
})
-class QuesaritoPage {}
+export class QuesaritoPage {}
@Component({
template: `
@@ -100,7 +100,7 @@ class QuesaritoPage {}
`
})
-class TabsPage {
+export class TabsPage {
root1 = Tab1;
root2 = Tab2;
root3 = Tab3;
@@ -122,4 +122,24 @@ class TabsPage {
}
-ionicBootstrap(TabsPage);
+@NgModule({
+ declarations: [
+ Tab1,
+ Tab2,
+ Tab3,
+ QuesaritoPage,
+ TabsPage
+ ],
+ imports: [
+ IonicModule.forRoot(TabsPage)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ Tab1,
+ Tab2,
+ Tab3,
+ QuesaritoPage,
+ TabsPage
+ ]
+})
+export class AppModule {}
diff --git a/src/components/tabs/test/tab-bar-scenarios/app-module.ts b/src/components/tabs/test/tab-bar-scenarios/app-module.ts
new file mode 100644
index 0000000000..a3e6e94d0d
--- /dev/null
+++ b/src/components/tabs/test/tab-bar-scenarios/app-module.ts
@@ -0,0 +1,31 @@
+import { Component, ViewEncapsulation, NgModule } from '@angular/core';
+import { IonicApp, IonicModule } from '../../../..';
+
+
+@Component({template: 'hi'})
+export class E2EPage {}
+
+
+@Component({
+ templateUrl: 'main.html',
+ encapsulation: ViewEncapsulation.None
+})
+export class E2EApp {
+ root = E2EPage;
+}
+
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EApp,
+ E2EPage
+ ]
+})
+export class AppModule {}
diff --git a/src/components/tabs/test/tab-bar-scenarios/index.ts b/src/components/tabs/test/tab-bar-scenarios/index.ts
deleted file mode 100644
index 3dd955b571..0000000000
--- a/src/components/tabs/test/tab-bar-scenarios/index.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import { Component, ViewEncapsulation } from '@angular/core';
-import { ionicBootstrap } from '../../../../../src';
-
-
-@Component({template: 'hi'})
-class E2EPage {}
-
-
-@Component({
- templateUrl: 'main.html',
- styleUrls: ['styles.css'],
- encapsulation: ViewEncapsulation.None
-})
-class E2EApp {
- root = E2EPage;
-}
-
-ionicBootstrap(E2EApp);
diff --git a/src/components/tabs/test/tab-bar-scenarios/main.html b/src/components/tabs/test/tab-bar-scenarios/main.html
index 5d9ba43820..4b1200c64d 100644
--- a/src/components/tabs/test/tab-bar-scenarios/main.html
+++ b/src/components/tabs/test/tab-bar-scenarios/main.html
@@ -1,3 +1,4 @@
+
@@ -71,3 +72,5 @@
+
+
\ No newline at end of file
diff --git a/src/components/tabs/test/tab-bar-scenarios/styles.css b/src/components/tabs/test/tab-bar-scenarios/styles.css
deleted file mode 100644
index 4855a8f245..0000000000
--- a/src/components/tabs/test/tab-bar-scenarios/styles.css
+++ /dev/null
@@ -1,12 +0,0 @@
-ion-tabs {
- margin-bottom: 20px;
-}
-
-ion-tabs,
-ion-tabs ion-tabbar {
- position: relative;
- top: auto;
- height: auto;
- visibility: visible;
- opacity: 1;
-}
diff --git a/src/components/tabs/test/tabs.spec.ts b/src/components/tabs/test/tabs.spec.ts
index 219bb84ca1..426c402f50 100644
--- a/src/components/tabs/test/tabs.spec.ts
+++ b/src/components/tabs/test/tabs.spec.ts
@@ -1,37 +1,11 @@
import { Component } from '@angular/core';
-import { App, Config, Nav, NavOptions, Platform, Tab, Tabs, ViewController } from '../../../../src';
-import { mockTab, mockTabs } from '../../../../src/util/mock-providers';
+import { mockTab, mockTabs } from '../../../util/mock-providers';
-export function run() {
describe('Tabs', () => {
describe('initTabs', () => {
- it('should preload all tabs', () => {
- var tabs = mockTabs();
- var tab0 = mockTab(tabs);
- var tab1 = mockTab(tabs);
- tab0.root = SomePage;
- tab1.root = SomePage;
-
- tab0.preload = () => {};
- tab1.preload = () => {};
-
- spyOn(tab0, 'preload');
- spyOn(tab1, 'preload');
-
- tabs.preloadTabs = true;
-
- tabs.initTabs();
-
- expect(tab0.isSelected).toEqual(true);
- expect(tab1.isSelected).toEqual(false);
-
- expect(tab0.preload).not.toHaveBeenCalled();
- expect(tab1.preload).toHaveBeenCalled();
- });
-
it('should not select a hidden or disabled tab', () => {
var tabs = mockTabs();
var tab0 = mockTab(tabs);
@@ -42,7 +16,7 @@ describe('Tabs', () => {
tab1.enabled = false;
tab1.show = false;
- tabs.selectedIndex = '1';
+ tabs.selectedIndex = 1;
tabs.initTabs();
expect(tab0.isSelected).toEqual(true);
@@ -56,7 +30,7 @@ describe('Tabs', () => {
tab0.root = SomePage;
tab1.root = SomePage;
- tabs.selectedIndex = '1';
+ tabs.selectedIndex = 1;
tabs.initTabs();
expect(tab0.isSelected).toEqual(false);
@@ -70,16 +44,10 @@ describe('Tabs', () => {
tab0.root = SomePage;
tab1.root = SomePage;
- spyOn(tab0, 'preload');
- spyOn(tab1, 'preload');
-
tabs.initTabs();
expect(tab0.isSelected).toEqual(true);
expect(tab1.isSelected).toEqual(false);
-
- expect(tab0.preload).not.toHaveBeenCalled();
- expect(tab1.preload).not.toHaveBeenCalled();
});
});
@@ -99,13 +67,13 @@ describe('Tabs', () => {
tabs.select(tab1);
tabs.select(tab2);
- expect(tabs.selectHistory).toEqual([tab0.id, tab1.id, tab2.id]);
+ expect(tabs._selectHistory).toEqual([tab0.id, tab1.id, tab2.id]);
expect(tabs.previousTab(true)).toEqual(tab1);
- expect(tabs.selectHistory).toEqual([tab0.id, tab1.id]);
+ expect(tabs._selectHistory).toEqual([tab0.id, tab1.id]);
expect(tabs.previousTab(true)).toEqual(tab0);
- expect(tabs.selectHistory).toEqual([tab0.id]);
+ expect(tabs._selectHistory).toEqual([tab0.id]);
});
it('should not find a previous tab when there has only been one selection', () => {
@@ -122,7 +90,7 @@ describe('Tabs', () => {
it('should not find a previous tab when theres no history', () => {
var tabs = mockTabs();
- expect(tabs.selectHistory.length).toEqual(0);
+ expect(tabs._selectHistory.length).toEqual(0);
expect(tabs.previousTab(true)).toEqual(null);
});
@@ -133,22 +101,22 @@ describe('Tabs', () => {
tab0.root = SomePage;
tab1.root = SomePage;
- expect(tabs.selectHistory.length).toEqual(0);
+ expect(tabs._selectHistory.length).toEqual(0);
tabs.select(tab0);
- expect(tabs.selectHistory[0]).toEqual(tab0.id);
- expect(tabs.selectHistory.length).toEqual(1);
+ expect(tabs._selectHistory[0]).toEqual(tab0.id);
+ expect(tabs._selectHistory.length).toEqual(1);
tabs.select(tab1);
- expect(tabs.selectHistory[0]).toEqual(tab0.id);
- expect(tabs.selectHistory[1]).toEqual(tab1.id);
- expect(tabs.selectHistory.length).toEqual(2);
+ expect(tabs._selectHistory[0]).toEqual(tab0.id);
+ expect(tabs._selectHistory[1]).toEqual(tab1.id);
+ expect(tabs._selectHistory.length).toEqual(2);
tabs.select(tab0);
- expect(tabs.selectHistory[0]).toEqual(tab0.id);
- expect(tabs.selectHistory[1]).toEqual(tab1.id);
- expect(tabs.selectHistory[2]).toEqual(tab0.id);
- expect(tabs.selectHistory.length).toEqual(3);
+ expect(tabs._selectHistory[0]).toEqual(tab0.id);
+ expect(tabs._selectHistory[1]).toEqual(tab1.id);
+ expect(tabs._selectHistory[2]).toEqual(tab0.id);
+ expect(tabs._selectHistory.length).toEqual(3);
});
});
@@ -207,7 +175,7 @@ describe('Tabs', () => {
it('should get the selected tab', () => {
var tabs = mockTabs();
- var tab0 = mockTab(tabs);
+ mockTab(tabs);
var tab1 = mockTab(tabs);
tab1.setSelected(true);
@@ -217,8 +185,8 @@ describe('Tabs', () => {
it('should get null if no selected tab', () => {
var tabs = mockTabs();
- var tab0 = mockTab(tabs);
- var tab1 = mockTab(tabs);
+ mockTab(tabs);
+ mockTab(tabs);
expect(tabs.getSelected()).toEqual(null);
});
@@ -229,6 +197,3 @@ describe('Tabs', () => {
class SomePage {}
});
-
-
-}
diff --git a/src/components/tap-click/test/tapClick.spec.ts b/src/components/tap-click/test/tapClick.spec.ts
index 738d295b35..87aee2e9af 100644
--- a/src/components/tap-click/test/tapClick.spec.ts
+++ b/src/components/tap-click/test/tapClick.spec.ts
@@ -1,44 +1,40 @@
-import { isActivatable } from '../../../../src';
+import { isActivatable } from '../tap-click';
-export function run() {
+describe('TapClick', () => {
- describe('TapClick', () => {
+ describe('isActivatable', () => {
- describe('isActivatable', () => {
+ it('should be activatable on element', () => {
+ let ele = document.createElement('a');
+ expect( isActivatable(ele) ).toBe(true);
+ });
- it('should be activatable on element', () => {
- let ele = document.createElement('a');
- expect( isActivatable(ele) ).toBe(true);
- });
+ it('should be activatable on element', () => {
+ let ele = document.createElement('button');
+ expect( isActivatable(ele) ).toBe(true);
+ });
- it('should be activatable on element', () => {
- let ele = document.createElement('button');
- expect( isActivatable(ele) ).toBe(true);
- });
+ it('should be activatable on element', () => {
+ let ele = document.createElement('ion-item-sliding');
+ expect( isActivatable(ele) ).toBe(false);
+ });
- it('should be activatable on element', () => {
- let ele = document.createElement('ion-item-sliding');
- expect( isActivatable(ele) ).toBe(false);
- });
+ it('should be not activatable on element', () => {
+ let ele = document.createElement('ion-item');
+ expect( isActivatable(ele) ).toBe(false);
+ });
- it('should be not activatable on element', () => {
- let ele = document.createElement('ion-item');
- expect( isActivatable(ele) ).toBe(false);
- });
-
- it('should be not activatable on element', () => {
- let ele = document.createElement('div');
- expect( isActivatable(ele) ).toBe(false);
- });
-
- it('should be activatable with "tappable" attribute', () => {
- let ele = document.createElement('div');
- ele.setAttribute('tappable', 'true');
- expect( isActivatable(ele) ).toBe(true);
- });
+ it('should be not activatable on
element', () => {
+ let ele = document.createElement('div');
+ expect( isActivatable(ele) ).toBe(false);
+ });
+ it('should be activatable with "tappable" attribute', () => {
+ let ele = document.createElement('div');
+ ele.setAttribute('tappable', 'true');
+ expect( isActivatable(ele) ).toBe(true);
});
});
-}
+});
diff --git a/src/components/toast/test/basic/index.ts b/src/components/toast/test/basic/app-module.ts
similarity index 80%
rename from src/components/toast/test/basic/index.ts
rename to src/components/toast/test/basic/app-module.ts
index f43774e3fa..7a44a06b4b 100644
--- a/src/components/toast/test/basic/index.ts
+++ b/src/components/toast/test/basic/app-module.ts
@@ -1,5 +1,5 @@
-import { Component } from '@angular/core';
-import { ionicBootstrap, Toast, ToastController, NavController } from '../../../../../src';
+import { Component, NgModule } from '@angular/core';
+import { IonicApp, IonicModule, Toast, ToastController, NavController } from '../../../..';
@Component({
@@ -14,13 +14,13 @@ import { ionicBootstrap, Toast, ToastController, NavController } from '../../../
`
})
-class AnotherPage {}
+export class AnotherPage {}
@Component({
templateUrl: 'main.html'
})
-class E2EPage {
+export class E2EPage {
constructor(public toastCtrl: ToastController, public navCtrl: NavController) { }
@@ -84,8 +84,24 @@ class E2EPage {
@Component({
template: '
'
})
-class E2EApp {
+export class E2EApp {
root = E2EPage;
}
-ionicBootstrap(E2EApp);
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage,
+ AnotherPage
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EApp,
+ E2EPage,
+ AnotherPage
+ ]
+})
+export class AppModule {}
diff --git a/src/components/toast/test/toast.spec.ts b/src/components/toast/test/toast.spec.ts
index e87d56e03f..f8f0374c85 100644
--- a/src/components/toast/test/toast.spec.ts
+++ b/src/components/toast/test/toast.spec.ts
@@ -1,6 +1,7 @@
-import { ToastController, App, Platform, Config } from '../../../../src';
-
-export function run() {
+import { App } from '../../app/app';
+import { Config } from '../../../config/config';
+import { Platform } from '../../../platform/platform';
+import { ToastController } from '../../toast/toast';
describe('Toast', () => {
@@ -63,5 +64,3 @@ describe('Toast', () => {
});
});
-
-}
diff --git a/src/components/toggle/test/basic/index.ts b/src/components/toggle/test/basic/app-module.ts
similarity index 62%
rename from src/components/toggle/test/basic/index.ts
rename to src/components/toggle/test/basic/app-module.ts
index 7135724c9a..d9f511ac96 100644
--- a/src/components/toggle/test/basic/index.ts
+++ b/src/components/toggle/test/basic/app-module.ts
@@ -1,27 +1,31 @@
-import { Component } from '@angular/core';
+import { Component, NgModule } from '@angular/core';
import { FormControl, FormGroup } from '@angular/forms';
-import { ionicBootstrap, Toggle } from '../../../../../src';
+import { IonicApp, IonicModule, Toggle } from '../../../..';
@Component({
templateUrl: 'main.html'
})
-class E2EPage {
- fruitsForm: FormGroup;
+export class E2EPage {
grapeDisabled: boolean;
grapeChecked: boolean;
kiwiValue: boolean;
strawberryValue: boolean;
formResults: string;
- constructor() {
- this.fruitsForm = new FormGroup({
- 'appleCtrl': new FormControl(false),
- 'bananaCtrl': new FormControl(true),
- 'cherryCtrl': new FormControl(false),
- 'grapeCtrl': new FormControl(true)
- });
+ appleCtrl = new FormControl(false);
+ bananaCtrl = new FormControl(true);
+ cherryCtrl = new FormControl(false);
+ grapeCtrl = new FormControl(true);
+ fruitsForm = new FormGroup({
+ 'apple': this.appleCtrl,
+ 'banana': this.bananaCtrl,
+ 'cherry': this.cherryCtrl,
+ 'grape': this.grapeCtrl
+ });
+
+ constructor() {
this.grapeChecked = true;
this.grapeDisabled = true;
}
@@ -62,8 +66,22 @@ class E2EPage {
@Component({
template: '
'
})
-class E2EApp {
+export class E2EApp {
root = E2EPage;
}
-ionicBootstrap(E2EApp);
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EApp,
+ E2EPage
+ ]
+})
+export class AppModule {}
diff --git a/src/components/toggle/test/basic/e2e.ts b/src/components/toggle/test/basic/e2e.ts
index bdd776a068..498bf38618 100644
--- a/src/components/toggle/test/basic/e2e.ts
+++ b/src/components/toggle/test/basic/e2e.ts
@@ -1,6 +1,6 @@
it('should check apple via switch element click', function() {
- element(by.css('[formControlName="appleCtrl"]')).click();
+ element(by.css('[formControlName="apple"]')).click();
});
diff --git a/src/components/toggle/test/basic/main.html b/src/components/toggle/test/basic/main.html
index 5c8768542d..af69cced18 100644
--- a/src/components/toggle/test/basic/main.html
+++ b/src/components/toggle/test/basic/main.html
@@ -25,22 +25,22 @@
Apple, formControlName
-
+
Banana, formControlName
-
+
Cherry, formControlName, disabled
-
+
Grape, formControlName, checked, disabled
-
+
@@ -64,14 +64,14 @@
- appleCtrl.dirty: {{fruitsForm.controls.appleCtrl.dirty}}
- appleCtrl.value: {{fruitsForm.controls.appleCtrl.value}}
- bananaCtrl.dirty: {{fruitsForm.controls.bananaCtrl.dirty}}
- bananaCtrl.value: {{fruitsForm.controls.bananaCtrl.value}}
- cherry.dirty: {{fruitsForm.controls.cherryCtrl.dirty}}
- cherry.value: {{fruitsForm.controls.cherryCtrl.value}}
- grape.dirty: {{fruitsForm.controls.grapeCtrl.dirty}}
- grape.value: {{fruitsForm.controls.grapeCtrl.value}}
+ appleCtrl.dirty: {{appleCtrl.dirty}}
+ appleCtrl.value: {{appleCtrl.value}}
+ bananaCtrl.dirty: {{bananaCtrl.dirty}}
+ bananaCtrl.value: {{bananaCtrl.value}}
+ cherryCtrl.dirty: {{cherryCtrl.dirty}}
+ cherryCtrl.value: {{cherryCtrl.value}}
+ grapeCtrl.dirty: {{grapeCtrl.dirty}}
+ grapeCtrl.value: {{grapeCtrl.value}}
kiwiValue: {{kiwiValue}}
strawberryValue: {{strawberryValue}}
diff --git a/src/components/toolbar/test/colors/app-module.ts b/src/components/toolbar/test/colors/app-module.ts
new file mode 100644
index 0000000000..325ef37c2a
--- /dev/null
+++ b/src/components/toolbar/test/colors/app-module.ts
@@ -0,0 +1,28 @@
+import { Component, NgModule } from '@angular/core';
+import { IonicApp, IonicModule } from '../../../..';
+
+
+@Component({
+ templateUrl: 'main.html'
+})
+export class E2EApp {
+
+ buttonClick(button: any) {
+ console.log(button);
+ }
+
+}
+
+@NgModule({
+ declarations: [
+ E2EApp
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EApp
+ ]
+})
+export class AppModule {}
diff --git a/src/components/toolbar/test/colors/index.ts b/src/components/toolbar/test/colors/index.ts
deleted file mode 100644
index 48c3ab3ed3..0000000000
--- a/src/components/toolbar/test/colors/index.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-import { Component } from '@angular/core';
-import { ionicBootstrap } from '../../../../../src';
-
-
-@Component({
- templateUrl: 'main.html'
-})
-class E2EApp {
-
- buttonClick(button: any) {
- console.log(button);
- }
-
-}
-
-ionicBootstrap(E2EApp);
diff --git a/src/components/toolbar/test/scenarios/app-module.ts b/src/components/toolbar/test/scenarios/app-module.ts
new file mode 100644
index 0000000000..ef63fef867
--- /dev/null
+++ b/src/components/toolbar/test/scenarios/app-module.ts
@@ -0,0 +1,28 @@
+import { Component, NgModule } from '@angular/core';
+import { IonicApp, IonicModule } from '../../../..';
+
+
+@Component({
+ templateUrl: 'main.html'
+})
+export class E2EApp {
+
+ buttonClick(button) {
+ console.log(button);
+ }
+
+}
+
+@NgModule({
+ declarations: [
+ E2EApp
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EApp
+ ]
+})
+export class AppModule {}
diff --git a/src/components/toolbar/test/scenarios/index.ts b/src/components/toolbar/test/scenarios/index.ts
deleted file mode 100644
index 55285ce2d4..0000000000
--- a/src/components/toolbar/test/scenarios/index.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-import { Component } from '@angular/core';
-import { ionicBootstrap } from '../../../../../src';
-
-
-@Component({
- templateUrl: 'main.html'
-})
-class E2EApp {
-
- buttonClick(button) {
- console.log(button);
- }
-
-}
-
-ionicBootstrap(E2EApp);
diff --git a/src/components/typography/test/basic/app-module.ts b/src/components/typography/test/basic/app-module.ts
new file mode 100644
index 0000000000..33f7340164
--- /dev/null
+++ b/src/components/typography/test/basic/app-module.ts
@@ -0,0 +1,33 @@
+import { Component, NgModule } from '@angular/core';
+import { IonicApp, IonicModule } from '../../../..';
+
+
+@Component({
+ templateUrl: 'main.html'
+})
+export class E2EPage {
+ dynamicColor: string = 'secondary';
+}
+
+@Component({
+ template: ''
+})
+export class E2EApp {
+ root = E2EPage;
+}
+
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp)
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EApp,
+ E2EPage
+ ]
+})
+export class AppModule {}
diff --git a/src/components/typography/test/basic/index.ts b/src/components/typography/test/basic/index.ts
deleted file mode 100644
index 1e198402b1..0000000000
--- a/src/components/typography/test/basic/index.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-import { Component } from '@angular/core';
-import { ionicBootstrap, App } from '../../../../../src';
-
-
-@Component({
- templateUrl: 'main.html'
-})
-class E2EPage {
- dynamicColor: string = "secondary";
-
- constructor(app: App) {
- app.setTitle('Basic Buttons');
- }
-}
-
-@Component({
- template: ''
-})
-class E2EApp {
- root = E2EPage;
-}
-
-ionicBootstrap(E2EApp);
diff --git a/src/components/typography/test/basic/main.html b/src/components/typography/test/basic/main.html
index 72b2fa85b6..9cf4179e38 100644
--- a/src/components/typography/test/basic/main.html
+++ b/src/components/typography/test/basic/main.html
@@ -26,6 +26,7 @@
Walking through the streets of Soho in the rain.
He was looking for a place called Lee Ho Fook's.
Gonna get a big dish of beef chow mein.
+ My purple class link.
@@ -38,3 +39,9 @@
+
+
\ No newline at end of file
diff --git a/src/components/virtual-scroll/test/basic/index.ts b/src/components/virtual-scroll/test/basic/app-module.ts
similarity index 65%
rename from src/components/virtual-scroll/test/basic/index.ts
rename to src/components/virtual-scroll/test/basic/app-module.ts
index f17bb3a9e3..6e039589ae 100644
--- a/src/components/virtual-scroll/test/basic/index.ts
+++ b/src/components/virtual-scroll/test/basic/app-module.ts
@@ -1,11 +1,11 @@
-import { Component, ViewChild, ElementRef } from '@angular/core';
-import { ionicBootstrap, Platform } from '../../../../../src';
+import { Component, ViewChild, ElementRef, NgModule } from '@angular/core';
+import { IonicApp, IonicModule, Platform } from '../../../..';
@Component({
templateUrl: 'main.html'
})
-class E2EPage {
+export class E2EPage {
items: any[] = [];
webview: string;
@@ -49,10 +49,25 @@ class E2EPage {
@Component({
template: ''
})
-class E2EApp {
+export class E2EApp {
root = E2EPage;
}
-ionicBootstrap(E2EApp, null, {
- prodMode: true
-});
+
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp, {
+ prodMode: true
+ })
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EApp,
+ E2EPage
+ ]
+})
+export class AppModule {}
diff --git a/src/components/virtual-scroll/test/cards/index.ts b/src/components/virtual-scroll/test/cards/app-module.ts
similarity index 78%
rename from src/components/virtual-scroll/test/cards/index.ts
rename to src/components/virtual-scroll/test/cards/app-module.ts
index 5edca67c1a..6690f2a8b5 100644
--- a/src/components/virtual-scroll/test/cards/index.ts
+++ b/src/components/virtual-scroll/test/cards/app-module.ts
@@ -1,12 +1,12 @@
-import { Component, ViewEncapsulation } from '@angular/core';
-import { ionicBootstrap } from '../../../../../src';
+import { Component, ViewEncapsulation, NgModule } from '@angular/core';
+import { IonicApp, IonicModule } from '../../../..';
@Component({
templateUrl: 'main.html',
encapsulation: ViewEncapsulation.None
})
-class E2EPage {
+export class E2EPage {
items: any[] = [];
constructor() {
@@ -30,13 +30,28 @@ class E2EPage {
@Component({
template: '',
})
-class E2EApp {
+export class E2EApp {
root = E2EPage;
}
-ionicBootstrap(E2EApp, null, {
- prodMode: true
-});
+
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp, {
+ prodMode: true
+ })
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EApp,
+ E2EPage
+ ]
+})
+export class AppModule {}
const lorem = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.';
diff --git a/src/components/virtual-scroll/test/image-gallery/index.ts b/src/components/virtual-scroll/test/image-gallery/app-module.ts
similarity index 81%
rename from src/components/virtual-scroll/test/image-gallery/index.ts
rename to src/components/virtual-scroll/test/image-gallery/app-module.ts
index 89f74c7dd7..dc4ce8510b 100644
--- a/src/components/virtual-scroll/test/image-gallery/index.ts
+++ b/src/components/virtual-scroll/test/image-gallery/app-module.ts
@@ -1,12 +1,12 @@
-import { Component, ViewEncapsulation } from '@angular/core';
-import { ionicBootstrap } from '../../../../../src';
+import { Component, ViewEncapsulation, NgModule } from '@angular/core';
+import { IonicApp, IonicModule } from '../../../..';
@Component({
templateUrl: 'main.html',
encapsulation: ViewEncapsulation.None
})
-class E2EPage {
+export class E2EPage {
lastMonth: number;
items = [];
@@ -76,13 +76,28 @@ class E2EPage {
@Component({
template: '',
})
-class E2EApp {
+export class E2EApp {
root = E2EPage;
}
-ionicBootstrap(E2EApp, null, {
- prodMode: true
-});
+
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp, {
+ prodMode: true
+ })
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EApp,
+ E2EPage
+ ]
+})
+export class AppModule {}
var monthNames = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
diff --git a/src/components/virtual-scroll/test/sliding-item/index.ts b/src/components/virtual-scroll/test/sliding-item/app-module.ts
similarity index 65%
rename from src/components/virtual-scroll/test/sliding-item/index.ts
rename to src/components/virtual-scroll/test/sliding-item/app-module.ts
index f17bb3a9e3..6e039589ae 100644
--- a/src/components/virtual-scroll/test/sliding-item/index.ts
+++ b/src/components/virtual-scroll/test/sliding-item/app-module.ts
@@ -1,11 +1,11 @@
-import { Component, ViewChild, ElementRef } from '@angular/core';
-import { ionicBootstrap, Platform } from '../../../../../src';
+import { Component, ViewChild, ElementRef, NgModule } from '@angular/core';
+import { IonicApp, IonicModule, Platform } from '../../../..';
@Component({
templateUrl: 'main.html'
})
-class E2EPage {
+export class E2EPage {
items: any[] = [];
webview: string;
@@ -49,10 +49,25 @@ class E2EPage {
@Component({
template: ''
})
-class E2EApp {
+export class E2EApp {
root = E2EPage;
}
-ionicBootstrap(E2EApp, null, {
- prodMode: true
-});
+
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp, {
+ prodMode: true
+ })
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EApp,
+ E2EPage
+ ]
+})
+export class AppModule {}
diff --git a/src/components/virtual-scroll/test/variable-size/index.ts b/src/components/virtual-scroll/test/variable-size/app-module.ts
similarity index 57%
rename from src/components/virtual-scroll/test/variable-size/index.ts
rename to src/components/virtual-scroll/test/variable-size/app-module.ts
index b69a110c97..1b923d9e5e 100644
--- a/src/components/virtual-scroll/test/variable-size/index.ts
+++ b/src/components/virtual-scroll/test/variable-size/app-module.ts
@@ -1,11 +1,11 @@
-import { Component } from '@angular/core';
-import { ionicBootstrap } from '../../../../../src';
+import { Component, NgModule } from '@angular/core';
+import { IonicApp, IonicModule } from '../../../..';
@Component({
templateUrl: 'main.html'
})
-class E2EPage {
+export class E2EPage {
items: any[] = [];
constructor() {
@@ -34,10 +34,25 @@ class E2EPage {
@Component({
template: '',
})
-class E2EApp {
+export class E2EApp {
root = E2EPage;
}
-ionicBootstrap(E2EApp, null, {
- prodMode: true
-});
+
+@NgModule({
+ declarations: [
+ E2EApp,
+ E2EPage
+ ],
+ imports: [
+ IonicModule.forRoot(E2EApp, {
+ prodMode: true
+ })
+ ],
+ bootstrap: [IonicApp],
+ entryComponents: [
+ E2EApp,
+ E2EPage
+ ]
+})
+export class AppModule {}
diff --git a/src/components/virtual-scroll/test/virtual-scroll.spec.ts b/src/components/virtual-scroll/test/virtual-scroll.spec.ts
index dc619cf235..eadfb8010d 100644
--- a/src/components/virtual-scroll/test/virtual-scroll.spec.ts
+++ b/src/components/virtual-scroll/test/virtual-scroll.spec.ts
@@ -1,15 +1,11 @@
-import { VirtualScroll } from '../../../../src/components/virtual-scroll/virtual-scroll';
-import { VirtualCell, VirtualData, VirtualNode } from '../../../../src/components/virtual-scroll/virtual-util';
-import { processRecords, populateNodeData, initReadNodes, getVirtualHeight, adjustRendered } from '../../../../src/components/virtual-scroll/virtual-util';
+import { VirtualCell, VirtualData, VirtualNode } from '../virtual-util';
+import { processRecords, populateNodeData, initReadNodes, getVirtualHeight, adjustRendered } from '../virtual-util';
-
-export function run() {
-
describe('VirtualScroll', () => {
beforeEach(() => {
- records = [0,1,2,3,4,5,6,7,8,9];
+ records = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
cells = [];
nodes = [];
headerFn = null;
@@ -31,7 +27,7 @@ describe('VirtualScroll', () => {
marginRight: '0px',
marginBottom: '0px',
marginLeft: '0px'
- }
+ };
return styles;
};
});
@@ -39,7 +35,7 @@ describe('VirtualScroll', () => {
describe('processRecords', () => {
it('should load data for 100% width items', () => {
- records = [0,1,2,3,4]
+ records = [0, 1, 2, 3, 4];
let stopAtHeight = 200;
processRecords(stopAtHeight, records, cells,
@@ -68,7 +64,7 @@ describe('VirtualScroll', () => {
});
it('should load data for 30% width items', () => {
- records = [0,1,2,3,4];
+ records = [0, 1, 2, 3, 4];
let stopAtHeight = 1000;
data.viewWidth = 300;
data.itmWidth = 90; // 30%, 3 per row
@@ -153,7 +149,7 @@ describe('VirtualScroll', () => {
});
it('should process more data', () => {
- records = [0,1,2,3,4,5,6,7,8,9];
+ records = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
let stopAtHeight = 100;
data.viewWidth = 200;
data.itmWidth = 90; // 2 per row
@@ -534,7 +530,7 @@ describe('VirtualScroll', () => {
}
};
- function getView(width?:number, height?: number, top?: number, left?: number): any {
+ function getView(width?: number, height?: number, top?: number, left?: number): any {
return {
context: {},
rootNodes: [{
@@ -556,13 +552,11 @@ describe('VirtualScroll', () => {
setAttribute: function(){},
innerHTML: '',
}]
- }
+ };
}
});
-}
-
const TEMPLATE_ITEM = 0;
const TEMPLATE_HEADER = 1;
const TEMPLATE_FOOTER = 2;