@@ -292,6 +292,45 @@ describe('IgxGrid - Row Editing #grid', () => {
292292 expect ( grid . rowEditDone . emit ) . toHaveBeenCalledWith ( rowDoneArgs ) ;
293293 } ) ;
294294
295+ it ( 'Emit rowAdd event with proper arguments' , ( ) => {
296+ spyOn ( grid . rowAdd , 'emit' ) . and . callThrough ( ) ;
297+ // start add row
298+ grid . beginAddRowById ( null ) ;
299+ fix . detectChanges ( ) ;
300+
301+ const generatedId = grid . getRowByIndex ( 0 ) . cells [ 0 ] . value ;
302+
303+ // enter edit mode of cell
304+ const prodCell = GridFunctions . getRowCells ( fix , 0 ) [ 2 ] ;
305+ UIInteractions . simulateDoubleClickAndSelectEvent ( prodCell ) ;
306+ fix . detectChanges ( ) ;
307+
308+ // input value
309+ const cellInput = ( prodCell as any ) . nativeElement . querySelector ( '[igxinput]' ) ;
310+ UIInteractions . setInputElementValue ( cellInput , "NewValue" ) ;
311+ fix . detectChanges ( ) ;
312+
313+ // Done button click
314+ const doneButtonElement = GridFunctions . getRowEditingDoneButton ( fix ) ;
315+ doneButtonElement . click ( ) ;
316+ fix . detectChanges ( ) ;
317+
318+ // check event args
319+ const rowAddArgs : IGridEditEventArgs = {
320+ cancel : false ,
321+ oldValue : null ,
322+ rowData : { ProductID : generatedId , ProductName : "NewValue" } ,
323+ newValue : { ProductID : generatedId , ProductName : "NewValue" } ,
324+ rowID : generatedId ,
325+ primaryKey : generatedId ,
326+ valid : true ,
327+ event : jasmine . anything ( ) as any ,
328+ owner : grid ,
329+ isAddRow : true
330+ }
331+ expect ( grid . rowAdd . emit ) . toHaveBeenCalledWith ( rowAddArgs ) ;
332+ } ) ;
333+
295334 it ( 'Should display the banner below the edited row if it is not the last one' , ( ) => {
296335 cell . editMode = true ;
297336
0 commit comments