datatable-mutable-tests.js revision 3166f4121e57f4bd184a5b2cf85c38d776d1db86
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smithvar suite = new Y.Test.Suite("datatable-mutable");
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith "Y.DataTable should be augmented": function () {
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith "Y.DataTable.Base should not be augmented": function () {
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith new Y.DataTable.Base().hasImpl(Y.DataTable.Mutable));
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith "Y.DataTable constructor should not error": function () {
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith Y.Assert.isTrue(table.hasImpl(Y.DataTable.Mutable));
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith "test autoSync values": function () {
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith config.autoSync = { create: true, update: true, 'delete': false };
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith "test set('autoSync')": function () {
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith table.set('autoSync', { create: true, update: true, 'delete': false });
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith setUp: function () {
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith tearDown: function () {
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith "test addColumn() does nothing": function () {
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith Y.Assert.areSame(columns, this.table.get('columns'));
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith Y.Assert.areSame(3, this.table.get('columns').length);
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith "test addColumn(string)": function () {
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith Y.Assert.areSame('d', table.get('columns.d.key'));
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith Y.Assert.areSame(3, Y.Array.indexOf(columns, table.get('columns.d')));
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith "test addColumn(config)": function () {
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith Y.Assert.areSame('d', table.get('columns.d.key'));
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith Y.Assert.areSame(3, Y.Array.indexOf(columns, table.get('columns.d')));
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith "test addColumn(string, number)": function () {
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith Y.Assert.areSame('d', table.get('columns.d.key'));
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith Y.Assert.areSame(1, Y.Array.indexOf(columns, table.get('columns.d')));
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith "test addColumn(config, number)": function () {
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith Y.Assert.areSame('d', table.get('columns.d.key'));
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith Y.Assert.areSame(1, Y.Array.indexOf(columns, table.get('columns.d')));
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith "test addColumn(string, [number, number])": function () {
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith // Can't resolve [3, 1]
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith table.addColumn({ name: 'parent', children: ['d', 'e'] });
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith Y.Assert.areSame('f', table.get('columns.f.key'));
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith Y.Assert.areSame(-1, Y.Array.indexOf(columns, column));
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith Y.Assert.areSame(1, Y.Array.indexOf(columns[3].children, column));
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith Y.Assert.areSame(6, table._displayColumns.length);
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith "test addColumn(config, [number, number])": function () {
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith // Can't resolve [3, 1]
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith table.addColumn({ name: 'parent', children: ['d', 'e'] });
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith Y.Assert.areSame('f', table.get('columns.f.key'));
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith Y.Assert.areSame(-1, Y.Array.indexOf(columns, column));
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith Y.Assert.areSame(1, Y.Array.indexOf(columns[3].children, column));
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith Y.Assert.areSame(6, table._displayColumns.length);
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith "addColumn event should fire": function () {
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith "addColumn event should have column config and index": function () {
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith Y.Assert.areSame(column, table.get('columns.d'));
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith "addColumn event should be preventable": function () {
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith "addColumn event e.index modification should update destination": function () {
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith Y.Assert.areSame(1, Y.Array.indexOf(table.get('columns'), table.get('columns.d')));
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith "addColumn should be chainable": function () {
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith Y.Assert.areSame(this.table, this.table.addColumn('d'));
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith setUp: function () {
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith tearDown: function () {
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith "test modifyColumn() does nothing": function () {
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith Y.Assert.areSame(columns, this.table.get('columns'));
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith Y.Assert.areSame(3, this.table.get('columns').length);
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith Y.Assert.areSame('foo', this.table.get('columns.a.foo'));
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith "test modifyColumn(string) does nothing": function () {
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith Y.Assert.areSame(columns, this.table.get('columns'));
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith Y.Assert.areSame(3, this.table.get('columns').length);
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith Y.Assert.areSame('foo', this.table.get('columns.a.foo'));
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith "test modifyColumn(string, obj)": function () {
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith Y.Assert.areSame('bar', table.get('columns.a.foo'));
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith "test modifyColumn(number, obj)": function () {
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith Y.Assert.areSame('bar', table.get('columns.a.foo'));
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith "test modifyColumn([number, number], obj)": function () {
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith table.addColumn({ children: [ { key: 'd', foo: 'A' }, 'e' ] });
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith Y.Assert.areSame('B', table.get('columns.d.foo'));
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith "modifyColumn event should fire": function () {
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith "modifyColumn event should have column config and newColumnDef": function () {
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith "modifyColumn event should be preventable": function () {
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith Y.Assert.areSame('foo', table.get('columns.a.foo'));
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith "modifyColumn event e.newColumnDef modification should apply": function () {
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith Y.Assert.areSame('foo', table.get('columns.a.foo'));
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith Y.Assert.areSame('bar', table.get('columns.a.bar'));
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith "modifyColumn should be chainable": function () {
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith Y.Assert.areSame(this.table, this.table.modifyColumn('a', {foo: 'B'}));
7ec3441e48d9669a482acaafd2eef499d699c8b8Luke Smith setUp: function () {
7ec3441e48d9669a482acaafd2eef499d699c8b8Luke Smith columns: [ 'a', 'b', 'c', { children: [ 'd', 'e' ] } ],
7ec3441e48d9669a482acaafd2eef499d699c8b8Luke Smith tearDown: function () {
7ec3441e48d9669a482acaafd2eef499d699c8b8Luke Smith "test removeColumn() does nothing": function () {
7ec3441e48d9669a482acaafd2eef499d699c8b8Luke Smith Y.Assert.areSame(4, table.get('columns').length);
7ec3441e48d9669a482acaafd2eef499d699c8b8Luke Smith "test removeColumn(string)": function () {
7ec3441e48d9669a482acaafd2eef499d699c8b8Luke Smith Y.Assert.areSame(3, table.get('columns').length);
7ec3441e48d9669a482acaafd2eef499d699c8b8Luke Smith Y.Assert.areSame(4, table._displayColumns.length);
7ec3441e48d9669a482acaafd2eef499d699c8b8Luke Smith Y.Assert.areSame(3, table._displayColumns.length);
7ec3441e48d9669a482acaafd2eef499d699c8b8Luke Smith "test removeColumn(number)": function () {
7ec3441e48d9669a482acaafd2eef499d699c8b8Luke Smith Y.Assert.areSame(3, table.get('columns').length);
7ec3441e48d9669a482acaafd2eef499d699c8b8Luke Smith Y.Assert.areSame(4, table._displayColumns.length);
7ec3441e48d9669a482acaafd2eef499d699c8b8Luke Smith "test removeColumn([number, number])": function () {
7ec3441e48d9669a482acaafd2eef499d699c8b8Luke Smith Y.Assert.areSame(4, table.get('columns').length);
7ec3441e48d9669a482acaafd2eef499d699c8b8Luke Smith Y.Assert.areSame(4, table._displayColumns.length);
7ec3441e48d9669a482acaafd2eef499d699c8b8Luke Smith Y.Assert.areSame('e', table.getColumn([3, 0]).key);
7ec3441e48d9669a482acaafd2eef499d699c8b8Luke Smith "removeColumn event should fire": function () {
7ec3441e48d9669a482acaafd2eef499d699c8b8Luke Smith "removeColumn event should have column config": function () {
7ec3441e48d9669a482acaafd2eef499d699c8b8Luke Smith "removeColumn event should be preventable": function () {
7ec3441e48d9669a482acaafd2eef499d699c8b8Luke Smith "removeColumn event e.column modification should apply": function () {
7ec3441e48d9669a482acaafd2eef499d699c8b8Luke Smith "removeColumn should be chainable": function () {
7ec3441e48d9669a482acaafd2eef499d699c8b8Luke Smith Y.Assert.areSame(this.table, this.table.removeColumn('a'));
76cf59cc4ac47a3272fcea3f528327465fa14404Luke Smith setUp: function () {
76cf59cc4ac47a3272fcea3f528327465fa14404Luke Smith columns: [ 'a', 'b', 'c', { children: [ 'd', 'e' ] } ],
76cf59cc4ac47a3272fcea3f528327465fa14404Luke Smith tearDown: function () {
76cf59cc4ac47a3272fcea3f528327465fa14404Luke Smith "test moveColumn() does nothing": function () {
76cf59cc4ac47a3272fcea3f528327465fa14404Luke Smith Y.Assert.areSame('d', table.getColumn([3, 0]).key);
76cf59cc4ac47a3272fcea3f528327465fa14404Luke Smith Y.Assert.areSame('e', table.getColumn([3, 1]).key);
76cf59cc4ac47a3272fcea3f528327465fa14404Luke Smith "test moveColumn(name) does nothing": function () {
76cf59cc4ac47a3272fcea3f528327465fa14404Luke Smith Y.Assert.areSame('d', table.getColumn([3, 0]).key);
76cf59cc4ac47a3272fcea3f528327465fa14404Luke Smith Y.Assert.areSame('e', table.getColumn([3, 1]).key);
76cf59cc4ac47a3272fcea3f528327465fa14404Luke Smith "test moveColumn(string, number)": function () {
76cf59cc4ac47a3272fcea3f528327465fa14404Luke Smith Y.Assert.areSame('d', table.getColumn([3, 0]).key);
76cf59cc4ac47a3272fcea3f528327465fa14404Luke Smith Y.Assert.areSame('e', table.getColumn([3, 1]).key);
76cf59cc4ac47a3272fcea3f528327465fa14404Luke Smith Y.Assert.areSame(2, table.getColumn(3).children.length);
76cf59cc4ac47a3272fcea3f528327465fa14404Luke Smith Y.Assert.areSame('e', table.getColumn([4, 0]).key);
76cf59cc4ac47a3272fcea3f528327465fa14404Luke Smith Y.Assert.areSame(1, table.getColumn(4).children.length);
76cf59cc4ac47a3272fcea3f528327465fa14404Luke Smith "test moveColumn(number, number)": function () {
76cf59cc4ac47a3272fcea3f528327465fa14404Luke Smith Y.Assert.areSame('d', table.getColumn([3, 0]).key);
76cf59cc4ac47a3272fcea3f528327465fa14404Luke Smith Y.Assert.areSame('e', table.getColumn([3, 1]).key);
76cf59cc4ac47a3272fcea3f528327465fa14404Luke Smith Y.Assert.areSame(2, table.getColumn(3).children.length);
76cf59cc4ac47a3272fcea3f528327465fa14404Luke Smith "test moveColumn([number, number], number)": function () {
76cf59cc4ac47a3272fcea3f528327465fa14404Luke Smith Y.Assert.areSame('d', table.getColumn([4, 0]).key);
76cf59cc4ac47a3272fcea3f528327465fa14404Luke Smith Y.Assert.areSame(1, table.getColumn(4).children.length);
76cf59cc4ac47a3272fcea3f528327465fa14404Luke Smith "test moveColumn(string, [number, number])": function () {
76cf59cc4ac47a3272fcea3f528327465fa14404Luke Smith Y.Assert.areSame('d', table.getColumn([2, 0]).key);
76cf59cc4ac47a3272fcea3f528327465fa14404Luke Smith Y.Assert.areSame('b', table.getColumn([2, 1]).key);
76cf59cc4ac47a3272fcea3f528327465fa14404Luke Smith Y.Assert.areSame('e', table.getColumn([2, 2]).key);
76cf59cc4ac47a3272fcea3f528327465fa14404Luke Smith Y.Assert.areSame(3, table.getColumn(2).children.length);
76cf59cc4ac47a3272fcea3f528327465fa14404Luke Smith "test moveColumn(number, [number, number])": function () {
76cf59cc4ac47a3272fcea3f528327465fa14404Luke Smith Y.Assert.areSame('d', table.getColumn([2, 0]).key);
76cf59cc4ac47a3272fcea3f528327465fa14404Luke Smith Y.Assert.areSame('b', table.getColumn([2, 1]).key);
76cf59cc4ac47a3272fcea3f528327465fa14404Luke Smith Y.Assert.areSame('e', table.getColumn([2, 2]).key);
76cf59cc4ac47a3272fcea3f528327465fa14404Luke Smith Y.Assert.areSame(3, table.getColumn(2).children.length);
76cf59cc4ac47a3272fcea3f528327465fa14404Luke Smith "test moveColumn([number, number], [number, number])": function () {
76cf59cc4ac47a3272fcea3f528327465fa14404Luke Smith Y.Assert.areSame('e', table.getColumn([3, 0]).key);
76cf59cc4ac47a3272fcea3f528327465fa14404Luke Smith Y.Assert.areSame('d', table.getColumn([3, 1]).key);
76cf59cc4ac47a3272fcea3f528327465fa14404Luke Smith Y.Assert.areSame(2, table.getColumn(3).children.length);
76cf59cc4ac47a3272fcea3f528327465fa14404Luke Smith "moveColumn event should fire": function () {
76cf59cc4ac47a3272fcea3f528327465fa14404Luke Smith "moveColumn event should have column and index": function () {
76cf59cc4ac47a3272fcea3f528327465fa14404Luke Smith "moveColumn event should be preventable": function () {
76cf59cc4ac47a3272fcea3f528327465fa14404Luke Smith Y.Assert.areSame('d', table.getColumn([3, 0]).key);
76cf59cc4ac47a3272fcea3f528327465fa14404Luke Smith Y.Assert.areSame('e', table.getColumn([3, 1]).key);
76cf59cc4ac47a3272fcea3f528327465fa14404Luke Smith Y.Assert.areSame(2, table.getColumn(3).children.length);
76cf59cc4ac47a3272fcea3f528327465fa14404Luke Smith "moveColumn event e.column modification should apply": function () {
76cf59cc4ac47a3272fcea3f528327465fa14404Luke Smith Y.Assert.areSame('d', table.getColumn([2, 0]).key);
76cf59cc4ac47a3272fcea3f528327465fa14404Luke Smith Y.Assert.areSame('e', table.getColumn([2, 1]).key);
76cf59cc4ac47a3272fcea3f528327465fa14404Luke Smith "moveColumn event e.index modification should apply": function () {
76cf59cc4ac47a3272fcea3f528327465fa14404Luke Smith Y.Assert.areSame('e', table.getColumn([4, 0]).key);
76cf59cc4ac47a3272fcea3f528327465fa14404Luke Smith "moveColumn should be chainable": function () {
76cf59cc4ac47a3272fcea3f528327465fa14404Luke Smith Y.Assert.areSame(this.table, this.table.moveColumn('a', 2));
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith setUp: function () {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith tearDown: function () {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith "addRow() should do nothing": function () {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith "addRow(data) should create a new Model in the data": function () {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith "addRow(data) should fire the data's add event": function () {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith "addRow(data, { sync: true }) should trigger Model sync": function () {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith table.data.model.prototype.sync = function (action) {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith table.addRow({ a: 2, b: 2, c: 2 }, { sync: true });
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith "addRow(data) with autoSync:true should trigger Model sync": function () {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith table.data.model.prototype.sync = function (action) {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith "addRow(...) should be chainable": function () {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith Y.Assert.areSame(this.table, this.table.addRow({ a: 2, b: 2, c: 2 }));
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith setUp: function () {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith tearDown: function () {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith "addRows() should do nothing": function () {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith "addRows([data]) should create a new Model in the data": function () {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith "addRows([data]) should fire the data's add event": function () {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith "addRows([data], { sync: true }) should trigger Model sync": function () {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith table.data.model.prototype.sync = function (action) {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith ], { sync: true });
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith "addRows([data]) with autoSync:true should trigger Model sync": function () {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith table.data.model.prototype.sync = function (action) {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith "addRows(...) should be chainable": function () {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith Y.Assert.areSame(this.table, this.table.addRows([
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith setUp: function () {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith tearDown: function () {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith "modifyRow() should do nothing": function () {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith Y.Assert.fail("ModelList change event triggered");
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith "modifyRow(index, data) should change the Model attributes": function () {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith "modifyRow(id, data) should change the Model attributes": function () {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith table.modifyRow(model.get('id'), { a: 2, b: 2, c: 2 });
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith "modifyRow(clientId, data) should change the Model attributes": function () {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith table.modifyRow(model.get('clientId'), { a: 2, b: 2, c: 2 });
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith "modifyRow(model, data) should change the Model attributes": function () {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith "modifyRow(index, data) should fire the model's change event": function () {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith "modifyRow(id, data) should fire the model's change event": function () {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith table.modifyRow(model.get('id'), { a: 2, b: 2, c: 2 });
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith "modifyRow(clientId, data) should fire the model's model event": function () {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith table.modifyRow(model.get('clientId'), { a: 2, b: 2, c: 2 });
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith "modifyRow(model, data) should fire the model's change event": function () {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith "modifyRow(index, data, { sync: true }) should trigger Model sync": function () {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith table.data.model.prototype.sync = function (action) {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith table.modifyRow(0, { a: 2, b: 2, c: 2 }, { sync: true });
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith "modifyRow(id, data, { sync: true }) should trigger Model sync": function () {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith table.data.model.prototype.sync = function (action) {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith table.modifyRow(model.get('id'), { a: 2, b: 2, c: 2 }, { sync: true });
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith "modifyRow(clientId, data, { sync: true }) should trigger Model sync": function () {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith table.data.model.prototype.sync = function (action) {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith table.modifyRow(model.get('clientId'), { a: 2, b: 2, c: 2 }, { sync: true });
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith "modifyRow(model, data, { sync: true }) should trigger Model sync": function () {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith table.data.model.prototype.sync = function (action) {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith table.modifyRow(model, { a: 2, b: 2, c: 2 }, { sync: true });
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith "modifyRow(index, data) with autoSync: true should trigger Model sync": function () {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith table.data.model.prototype.sync = function (action) {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith "modifyRow(id, data) with autoSync: true should trigger Model sync": function () {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith table.data.model.prototype.sync = function (action) {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith table.modifyRow(model.get('id'), { a: 2, b: 2, c: 2 });
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith "modifyRow(clientId, data) with autoSync: true should trigger Model sync": function () {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith table.data.model.prototype.sync = function (action) {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith table.modifyRow(model.get('clientId'), { a: 2, b: 2, c: 2 });
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith "modifyRow(model, data) with autoSync: true should trigger Model sync": function () {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith table.data.model.prototype.sync = function (action) {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith "modifyRow(...) should be chainable": function () {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith Y.Assert.areSame(this.table, this.table.modifyRow(0, { a: 2 }));
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith setUp: function () {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith tearDown: function () {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith "removeRow() should do nothing": function () {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith Y.Assert.fail("ModelList delete event triggered");
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith "removeRow(index) should delete the Model": function () {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith "removeRow(id) should delete the Model attributes": function () {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith "removeRow(clientId) should delete the Model attributes": function () {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith table.removeRow(table.data.item(0).get('clientId'));
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith "removeRow(model) should delete the Model attributes": function () {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith "removeRow(index) should fire the data's remove event": function () {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith "removeRow(id, data) should fire the data's remove event": function () {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith "removeRow(clientId, data) should fire the data's remove event": function () {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith "removeRow(model, data) should fire the data's remove event": function () {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith "removeRow(index, { sync: true }) should trigger Model sync": function () {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith table.data.model.prototype.sync = function (action) {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith "removeRow(id, { sync: true }) should trigger Model sync": function () {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith table.data.model.prototype.sync = function (action) {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith table.removeRow(model.get('id'), { sync: true });
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith "removeRow(clientId, { sync: true }) should trigger Model sync": function () {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith table.data.model.prototype.sync = function (action) {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith table.removeRow(model.get('clientId'), { sync: true });
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith "removeRow(model, { sync: true }) should trigger Model sync": function () {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith table.data.model.prototype.sync = function (action) {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith "removeRow(index) with autoSync: true should trigger Model sync": function () {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith table.data.model.prototype.sync = function (action) {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith "removeRow(id) with autoSync: true should trigger Model sync": function () {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith table.data.model.prototype.sync = function (action) {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith "removeRow(clientId) with autoSync: true should trigger Model sync": function () {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith table.data.model.prototype.sync = function (action) {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith "removeRow(model) with autoSync: true should trigger Model sync": function () {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith table.data.model.prototype.sync = function (action) {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith "removeRow(...) should be chainable": function () {
3166f4121e57f4bd184a5b2cf85c38d776d1db86Luke Smith Y.Assert.areSame(this.table, this.table.removeRow(0, { a: 2 }));
11ef335b17a11da1b70c6a80cabe20ef74058481Luke Smith}, '@VERSION@' ,{requires:['datatable-mutable', 'test']});