Skip to content

Commit

Permalink
fix: flushDirtyRows will not throw an error when no dirty rows
Browse files Browse the repository at this point in the history
  • Loading branch information
dachev committed Jul 30, 2015
1 parent d9c50cf commit d46d04c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/features/row-edit/js/gridRowEdit.js
Expand Up @@ -393,7 +393,7 @@
*/
flushDirtyRows: function(grid){
var promises = [];
grid.rowEdit.dirtyRows.forEach( function( gridRow ){
grid.api.rowEdit.getDirtyRows().forEach( function( gridRow ){
service.saveRow( grid, gridRow )();
promises.push( gridRow.rowEditSavePromise );
});
Expand Down
6 changes: 6 additions & 0 deletions src/features/row-edit/test/uiGridRowEditService.spec.js
Expand Up @@ -530,6 +530,12 @@ describe('ui.grid.edit uiGridRowEditService', function () {
expect( success ).toEqual(false);
expect( failure ).toEqual(true);
});

it( 'no dirty rows, no error is thrown', function() {
expect(function() {
uiGridRowEditService.flushDirtyRows( grid );
}).not.toThrow();
});
});


Expand Down

0 comments on commit d46d04c

Please sign in to comment.