test(ngmodule): update to ngmodule

This commit is contained in:
Adam Bradley
2016-09-13 15:44:02 -05:00
parent b8fb9c7c6d
commit d7be8a80c0
232 changed files with 4612 additions and 4893 deletions

View File

@ -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: '<ion-nav [root]="root"></ion-nav>'
})
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 {}

View File

@ -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: '<ion-nav [root]="root"></ion-nav>',
})
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.';

View File

@ -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: '<ion-nav [root]="root"></ion-nav>',
})
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'];

View File

@ -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: '<ion-nav [root]="root"></ion-nav>'
})
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 {}

View File

@ -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: '<ion-nav [root]="root"></ion-nav>',
})
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 {}

View File

@ -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;