@@ -223,8 +223,14 @@ describe('ui.grid.selection uiGridSelectionService', function () {
223223 }
224224 expect ( grid . selection . selectAll ) . toBe ( false ) ;
225225
226+ grid . options . isRowSelectable = function ( row ) {
227+ return row . isRowSelectable !== false ;
228+ } ;
229+
230+ grid . rows [ 6 ] . isRowSelectable = false ;
226231 grid . rows [ 8 ] . enableSelection = false ;
227232 grid . api . selection . selectAllRows ( ) ;
233+ expect ( grid . rows [ 6 ] . isSelected ) . toBe ( false ) ;
228234 expect ( grid . rows [ 7 ] . isSelected ) . toBe ( true ) ;
229235 expect ( grid . rows [ 8 ] . isSelected ) . toBe ( false ) ;
230236 } ) ;
@@ -244,18 +250,22 @@ describe('ui.grid.selection uiGridSelectionService', function () {
244250 } ) ;
245251
246252 describe ( 'selectAllVisibleRows function' , function ( ) {
247- it ( 'should select all visible rows' , function ( ) {
253+ it ( 'should select all visible and selectable rows' , function ( ) {
248254 grid . api . selection . selectRow ( grid . rows [ 4 ] . entity ) ;
249255 expect ( grid . rows [ 4 ] . isSelected ) . toBe ( true ) ;
250256
251257 grid . api . selection . selectRow ( grid . rows [ 6 ] . entity ) ;
252258 expect ( grid . rows [ 4 ] . isSelected ) . toBe ( true ) ;
253259 expect ( grid . rows [ 6 ] . isSelected ) . toBe ( true ) ;
254260
261+ grid . options . isRowSelectable = function ( row ) {
262+ return row . isRowSelectable !== false ;
263+ } ;
255264 grid . rows [ 3 ] . visible = true ;
256265 grid . rows [ 4 ] . visible = true ;
257266 grid . rows [ 6 ] . visible = false ;
258267 grid . rows [ 7 ] . visible = true ;
268+ grid . rows [ 7 ] . isRowSelectable = false ;
259269 grid . rows [ 8 ] . enableSelection = false ;
260270 grid . rows [ 9 ] . visible = true ;
261271 expect ( grid . selection . selectAll ) . toBe ( false ) ;
@@ -264,11 +274,11 @@ describe('ui.grid.selection uiGridSelectionService', function () {
264274 expect ( grid . rows [ 3 ] . isSelected ) . toBe ( true ) ;
265275 expect ( grid . rows [ 4 ] . isSelected ) . toBe ( true ) ;
266276 expect ( grid . rows [ 6 ] . isSelected ) . toBe ( false ) ;
267- expect ( grid . rows [ 7 ] . isSelected ) . toBe ( true ) ;
277+ expect ( grid . rows [ 7 ] . isSelected ) . toBe ( false ) ;
268278 expect ( grid . rows [ 8 ] . isSelected ) . toBe ( false ) ;
269279 expect ( grid . rows [ 9 ] . isSelected ) . toBe ( true ) ;
270280 expect ( grid . selection . selectAll ) . toBe ( true ) ;
271- expect ( grid . selection . selectedCount ) . toBe ( 8 ) ;
281+ expect ( grid . selection . selectedCount ) . toBe ( 7 ) ;
272282 } ) ;
273283 } ) ;
274284
0 commit comments