datatable-body-tests.js revision 678b2ccc8fdf1f418f36f4e92d1a411c22e76c9f
c28749e97052f09388969427adf7df641cdcdc22kais "test non-DataTable construction": function () {
c28749e97052f09388969427adf7df641cdcdc22kais "DataTable.Base default bodyView should be DataTable.BodyView": function () {
51144063f3afc862c6cb3f54fd4341724f765075Krishna Yenduri Y.Assert.areSame(Y.DataTable.BodyView, table.get('bodyView'));
c28749e97052f09388969427adf7df641cdcdc22kais Y.Assert.isInstanceOf(Y.DataTable.BodyView, table.body);
c28749e97052f09388969427adf7df641cdcdc22kais "DataTable default bodyView should be DataTable.BodyView": function () {
c28749e97052f09388969427adf7df641cdcdc22kais Y.Assert.areSame(Y.DataTable.BodyView, table.get('bodyView'));
c28749e97052f09388969427adf7df641cdcdc22kais Y.Assert.isInstanceOf(Y.DataTable.BodyView, table.body);
c28749e97052f09388969427adf7df641cdcdc22kais "Shared ModelList should not generate duplicate ids": function () {
c28749e97052f09388969427adf7df641cdcdc22kais ids = Y.Array.hash(table1.get('boundingBox').all('[id]').get('id')),
c28749e97052f09388969427adf7df641cdcdc22kais Y.Array.each(table2.get('boundingBox').all('[id]').get('id'),
2bd70d4be73561631df9cb3d9eb4c65fa94fa665krishna function (id) {
2bd70d4be73561631df9cb3d9eb4c65fa94fa665krishna Y.Assert.areSame(0, dups, dups + " duplicate IDs found");
c28749e97052f09388969427adf7df641cdcdc22kais setUp: function () {
c28749e97052f09388969427adf7df641cdcdc22kais { key: 'a', formatter: '<em>{value}</em>', allowHTML: true },
c28749e97052f09388969427adf7df641cdcdc22kais tearDown: function () {
c28749e97052f09388969427adf7df641cdcdc22kais "getCell([row, col]) should return <td>": function () {
c28749e97052f09388969427adf7df641cdcdc22kais Y.Assert.isTrue(this.table._tbodyNode.one('td').compareTo(
c28749e97052f09388969427adf7df641cdcdc22kais "getCell(tdNode) should return <td>": function () {
c28749e97052f09388969427adf7df641cdcdc22kais Y.Assert.isTrue(this.table._tbodyNode.one('td').compareTo(
c28749e97052f09388969427adf7df641cdcdc22kais "getCell(childNode) should return <td>": function () {
c28749e97052f09388969427adf7df641cdcdc22kais Y.Assert.isTrue(this.table._tbodyNode.one('td').compareTo(
c28749e97052f09388969427adf7df641cdcdc22kais "getCell([row, col], shiftString) should return relative <td>": function () {
c28749e97052f09388969427adf7df641cdcdc22kais Y.Assert.isTrue(this.table._tbodyNode.one('td').compareTo(
c28749e97052f09388969427adf7df641cdcdc22kais Y.Assert.isTrue(this.table._tbodyNode.all('tr').item(1).one('td').compareTo(
c28749e97052f09388969427adf7df641cdcdc22kais Y.Assert.isTrue(this.table._tbodyNode.one('td').next().compareTo(
c28749e97052f09388969427adf7df641cdcdc22kais Y.Assert.isTrue(this.table._tbodyNode.one('td').compareTo(
c28749e97052f09388969427adf7df641cdcdc22kais "getCell(tdNode, shiftString) should return the relative <td>": function () {
c28749e97052f09388969427adf7df641cdcdc22kais Y.Assert.isTrue(this.table._tbodyNode.one('td').compareTo(
c28749e97052f09388969427adf7df641cdcdc22kais 'above')));
c28749e97052f09388969427adf7df641cdcdc22kais Y.Assert.isTrue(this.table._tbodyNode.all('tr').item(1).one('td').compareTo(
c28749e97052f09388969427adf7df641cdcdc22kais Y.Assert.isTrue(this.table._tbodyNode.one('td').next().compareTo(
c28749e97052f09388969427adf7df641cdcdc22kais Y.Assert.isTrue(this.table._tbodyNode.one('td').compareTo(
c28749e97052f09388969427adf7df641cdcdc22kais this.table._tbodyNode.all('td').item(1), 'previous')));
c28749e97052f09388969427adf7df641cdcdc22kais "getCell(childNode, shiftString) should return the relative <td>": function () {
c28749e97052f09388969427adf7df641cdcdc22kais Y.Assert.isTrue(this.table._tbodyNode.one('td').compareTo(
c28749e97052f09388969427adf7df641cdcdc22kais 'above')));
c28749e97052f09388969427adf7df641cdcdc22kais Y.Assert.isTrue(this.table._tbodyNode.all('tr').item(1).one('td').compareTo(
c28749e97052f09388969427adf7df641cdcdc22kais "getCell([row, col], shiftArray) should return relative <td>": function () {
c28749e97052f09388969427adf7df641cdcdc22kais Y.Assert.isTrue(this.table._tbodyNode.all('td').item(2).compareTo(
efe05f9ecde56550699213909fd4152ef8ef6438krishna "getCell(tdNode, shiftArray) should return the relative <td>": function () {
efe05f9ecde56550699213909fd4152ef8ef6438krishna this.table._tbodyNode.all('tr').item(1).all('td').item(2).compareTo(
c28749e97052f09388969427adf7df641cdcdc22kais "getCell(childNode, shiftArray) should return the relative <td>": function () {
c28749e97052f09388969427adf7df641cdcdc22kais this.table._tbodyNode.all('tr').item(1).all('td').item(2).compareTo(
c28749e97052f09388969427adf7df641cdcdc22kais setUp: function () {
efe05f9ecde56550699213909fd4152ef8ef6438krishna { key: 'a', formatter: '<em>{value}</em>', allowHTML: true },
c28749e97052f09388969427adf7df641cdcdc22kais tearDown: function () {
c28749e97052f09388969427adf7df641cdcdc22kais "getRow(index) should return <tr>": function () {
c28749e97052f09388969427adf7df641cdcdc22kais "getRow(model) should return the <tr>": function () {
efe05f9ecde56550699213909fd4152ef8ef6438krishna "getRow(model.clientId) should return the <tr>": function () {
efe05f9ecde56550699213909fd4152ef8ef6438krishna this.table.getRow(this.table.data.item(0).get('clientId'))));
efe05f9ecde56550699213909fd4152ef8ef6438krishna setUp: function () {
c28749e97052f09388969427adf7df641cdcdc22kais { key: 'a', formatter: '<em id="em{value}">{value}</em>', allowHTML: true },
efe05f9ecde56550699213909fd4152ef8ef6438krishna tearDown: function () {
efe05f9ecde56550699213909fd4152ef8ef6438krishna "getRecord(index) should return modelList.item(index)": function () {
efe05f9ecde56550699213909fd4152ef8ef6438krishna Y.Assert.areSame(this.table.data.item(0), this.table.getRecord(0));
efe05f9ecde56550699213909fd4152ef8ef6438krishna Y.Assert.areSame(this.table.data.item(1), this.table.getRecord(1));
efe05f9ecde56550699213909fd4152ef8ef6438krishna "getRecord(node) should return the corresponding Model": function () {
51dd2c77f06e5663c28bd4f7a760cae4cf159e79vk "getRecord(childNode) should return the corresponding Model": function () {
efe05f9ecde56550699213909fd4152ef8ef6438krishna "getRecord(model.id) should return the corresponding Model": function () {
c28749e97052f09388969427adf7df641cdcdc22kais // For proper cleanup
c28749e97052f09388969427adf7df641cdcdc22kais Y.Assert.areSame(table.data.item(0), table.getRecord('a1'));
c28749e97052f09388969427adf7df641cdcdc22kais "getRecord(model.clientId) should return the corresponding Model": function () {
c28749e97052f09388969427adf7df641cdcdc22kais "getRecord(rowId) should return the corresponding Model": function () {
c28749e97052f09388969427adf7df641cdcdc22kais "getRecord(childElId) should return the corresponding Model": function () {