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