datatable-scroll-tests.js revision 3915fbd207f60de0f006499e756901ff6c4cd8a5
name: "lifecycle and instantiation",
"Y.DataTable should be augmented": function () {
},
"Y.DataTable.Base should not be augmented": function () {
},
"Y.DataTable constructor should not error": function () {
columns: ['a'],
data: [{a:1}]
});
}
}));
name: "scrollable attribute",
tearDown: function () {
if (this.table) {
}
},
"test scrollable values": function () {
var config = {
columns: ['a'],
data: [{a:1}]
}, table;
config.scrollable = false;
config.scrollable = true;
/*
* Commented out until #2528732 is fixed
config.scrollable = 'ab';
table = new Y.DataTable(config);
Y.Assert.isFalse(table.get('scrollable'));
config.scrollable = ['x', 'y'];
table = new Y.DataTable(config);
Y.Assert.isFalse(table.get('scrollable'));
config.scrollable = { x: true };
table = new Y.DataTable(config);
Y.Assert.isFalse(table.get('scrollable'));
*/
},
"test set('scrollable')": function () {
columns: ['a'],
data: [{a:1}]
});
},
"render() with 'scrollable' unset should not include scrolling UI": function () {
columns: ['a'],
data: [{a:1}]
}).render(),
'Default table has X scroll node');
'Default table has Y scroll node');
'Default table has Y scroll container node');
'Default table has virtual scrollbar node');
'Default table has caption table node');
'Default table has fixed header node');
'Default table has scrollable-x class');
'Default table has scrollable-y class');
},
columns: ['a'],
data: [{a:1}],
scrollable: 'x'
}).render(),
'Default table has X scroll node');
'Default table has Y scroll node');
'Default table has Y scroll container node');
'Default table has virtual scrollbar node');
'Default table has caption table node');
'Default table has fixed header node');
'Default table has scrollable-x class');
'Default table has scrollable-y class');
columns: ['a'],
data: [{a:1}],
scrollable: 'y'
}).render();
'Default table has X scroll node');
'Default table has Y scroll node');
'Default table has Y scroll container node');
'Default table has virtual scrollbar node');
'Default table has caption table node');
'Default table has fixed header node');
'Default table has scrollable-x class');
'Default table has scrollable-y class');
columns: ['a'],
data: [{a:1}],
scrollable: 'xy'
}).render();
'Default table has X scroll node');
'Default table has Y scroll node');
'Default table has Y scroll container node');
'Default table has virtual scrollbar node');
'Default table has caption table node');
'Default table has fixed header node');
'Default table has scrollable-x class');
'Default table has scrollable-y class');
},
"render() with scrollable: x + width should render x scroller": function () {
columns: ['a'],
data: [{a:1}],
scrollable: 'x',
width: '100px'
}).render(),
'X scrolling table missing X scroll node');
'X scrolling table has Y scroll node');
'X scrolling table has Y scroll container node');
'X scrolling table has virtual scrollbar node');
'X scrolling table has caption table node');
'X scrolling table has fixed header node');
'X scrolling table missing scrollable-x class');
'X scrolling table has scrollable-y class');
},
"render() with scrollable: y + height should render y scroll DOM": function () {
columns: ['a'],
data: [{a:1}],
scrollable: 'y',
height: '100px'
}).render(),
'Y scrolling table has X scroll node');
'Y scrolling table missing Y scroll node');
'Y scrolling table missing Y scroll container node');
'Y scrolling table missing virtual scrollbar node');
'Y scrolling table has caption table node');
'Y scrolling table missing fixed header node');
'Y scrolling table has scrollable-x class');
'Y scrolling table missing scrollable-y class');
},
"render() with scrollable: xy + height, width should render x and y scroll DOM": function () {
columns: ['a'],
data: [{a:1}],
scrollable: 'xy',
height: '100px',
width: '100px'
}).render(),
'XY scrolling table missing X scroll node');
'XY scrolling table missing Y scroll node');
'XY scrolling table missing Y scroll container node');
'XY scrolling table missing virtual scrollbar node');
'XY scrolling table has caption table node');
'XY scrolling table missing fixed header node');
'XY scrolling table missing scrollable-x class');
'XY scrolling table missing scrollable-y class');
},
"set('scrollable', 'x') after render() should add x scroll DOM": function () {
columns: ['a'],
data: [{a:1}],
width: '100px'
}).render(),
'X scrolling table missing scrollable-x class');
'X scrolling table missing X scroll node');
},
"set('scrollable', 'y') after render() should add y scroll DOM": function () {
columns: ['a'],
data: [{a:1}],
height: '100px'
}).render(),
'Y scrolling table missing scrollable-y class');
'Y scrolling table missing Y scroll container node');
'Y scrolling table missing Y scroll fixed header node');
'Y scrolling table missing Y scroll node');
'Y scrolling table missing virtual scrollbar node');
},
"set('scrollable', 'xy') after render() should add y scroll DOM": function () {
columns: ['a'],
data: [{a:1}],
height: '100px',
width: '100px'
}).render(),
'XY scrolling table missing scrollable-x class');
'XY scrolling table missing scrollable-y class');
'XY scrolling table missing X scroll node');
'XY scrolling table missing Y scroll container node');
'XY scrolling table missing Y scroll fixed header node');
'XY scrolling table missing Y scroll node');
'XY scrolling table missing virtual scrollbar node');
},
"set('scrollable', 'x') from 'xy' should remove y scroll DOM": function () {
columns: ['a'],
data: [{a:1}],
height: '100px',
width: '100px',
scrollable: 'xy'
}).render(),
'X scrolling table missing scrollable-x class');
'X scrolling table has scrollable-y class');
'X scrolling table missing X scroll node');
'X scrolling table has Y scroll container node');
'X scrolling table has Y scroll fixed header node');
'X scrolling table has Y scroll node');
'X scrolling table has virtual scrollbar node');
},
"set('scrollable', 'y') from 'xy' should remove x scroll DOM": function () {
columns: ['a'],
data: [{a:1}],
height: '100px',
width: '100px',
scrollable: 'xy'
}).render(),
'Y scrolling table has scrollable-x class');
'Y scrolling table missing scrollable-y class');
'Y scrolling table has X scroll node');
'Y scrolling table missing Y scroll container node');
'Y scrolling table missing Y scroll fixed header node');
'Y scrolling table missing Y scroll node');
'Y scrolling table missing virtual scrollbar node');
},
"set('scrollable', false) from 'x' should remove x scroll DOM": function () {
columns: ['a'],
data: [{a:1}],
width: '100px',
scrollable: 'x'
}).render(),
'Non-scrolling table has scrollable-x class');
'Non-scrolling table has X scroll node');
},
"set('scrollable', false) from 'y' should remove y scroll DOM": function () {
columns: ['a'],
data: [{a:1}],
height: '100px',
scrollable: 'y'
}).render(),
'Non-scrolling table has scrollable-y class');
'Non-scrolling table has Y scroll container node');
'Non-scrolling table has Y scroll fixed header node');
'Non-scrolling table has Y scroll node');
'Non-scrolling table has virtual scrollbar node');
},
"set('scrollable', false) from 'xy' should remove x and y scroll DOM": function () {
columns: ['a'],
data: [{a:1}],
height: '100px',
width: '100px',
scrollable: 'xy'
}).render(),
'Non-scrolling table has scrollable-x class');
'Non-scrolling table has scrollable-y class');
'Non-scrolling table has X scroll node');
'Non-scrolling table has Y scroll container node');
'Non-scrolling table has Y scroll fixed header node');
'Non-scrolling table has Y scroll node');
'Non-scrolling table has virtual scrollbar node');
},
"set('scrollable', 'x') from 'y' should add x scroll DOM and remove y scroll DOM": function () {
columns: ['a'],
data: [{a:1}],
height: '100px',
width: '100px',
scrollable: 'y'
}).render(),
'X scrolling table missing scrollable-x class');
'X scrolling table has scrollable-y class');
'X scrolling table missing X scroll node');
'X scrolling table has Y scroll container node');
'X scrolling table has Y scroll fixed header node');
'X scrolling table has Y scroll node');
'X scrolling table has virtual scrollbar node');
},
"set('scrollable', 'y') from 'x' should add y scroll DOM and remove x scroll DOM": function () {
columns: ['a'],
data: [{a:1}],
height: '100px',
width: '100px',
scrollable: 'x'
}).render(),
'Y scrolling table has scrollable-x class');
'Y scrolling table missing scrollable-y class');
'Y scrolling table has X scroll node');
'Y scrolling table missing Y scroll container node');
'Y scrolling table missing Y scroll fixed header node');
'Y scrolling table missing Y scroll node');
'Y scrolling table missing virtual scrollbar node');
},
"set('scrollable', 'xy') from 'y' should add x scroll DOM outside y scroll DOM": function () {
columns: ['a'],
data: [{a:1}],
height: '100px',
width: '100px',
scrollable: 'y'
}).render(),
'XY scrolling table missing scrollable-x class');
'XY scrolling table missing scrollable-y class');
'XY scrolling table missing X scroll node');
'XY scrolling table missing Y scroll container node');
'XY scrolling table missing Y scroll fixed header node');
'XY scrolling table missing Y scroll node');
'XY scrolling table missing virtual scrollbar node');
"X scroll container didn't wrap Y scroll DOM");
}
}));
name: "scrollTo",
setUp: function () {
var data = [], i;
for (i = 0; i < 10; ++i) {
}
for (; i < 100; ++i) {
}
},
"": function () {
}
}));
name: "y scroll",
"": function () {
}
}));
name: "x scroll",
"": function () {
}
}));
name: "xy scroll",
"": function () {
}
}));