File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
projects/igniteui-angular/src/lib/grid Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -917,6 +917,28 @@ describe('IgxGrid - Row Selection', () => {
917
917
} ) ;
918
918
} ) ) ;
919
919
920
+ it ( 'Should be able to correctly select all rows programatically' , async ( ( ) => {
921
+ const fixture = TestBed . createComponent ( GridWithSelectionComponent ) ;
922
+ fixture . detectChanges ( ) ;
923
+ const grid = fixture . componentInstance . gridSelection3 ;
924
+ const gridElement : HTMLElement = fixture . nativeElement . querySelector ( '.igx-grid' ) ;
925
+ const firstRow = grid . getRowByIndex ( 0 ) ;
926
+ const secondRow = grid . getRowByIndex ( 1 ) ;
927
+ const firstRowCheckbox : HTMLElement = firstRow . nativeElement . querySelector ( '.igx-checkbox__input' ) ;
928
+ expect ( firstRow . isSelected ) . toBeFalsy ( ) ;
929
+ grid . selectAllRows ( ) ;
930
+ fixture . whenStable ( ) . then ( ( ) => {
931
+ fixture . detectChanges ( ) ;
932
+ expect ( firstRow . isSelected ) . toBeTruthy ( ) ;
933
+ expect ( secondRow . isSelected ) . toBeTruthy ( ) ;
934
+ firstRowCheckbox . dispatchEvent ( new Event ( 'click' , { } ) ) ;
935
+ return fixture . whenStable ( ) ;
936
+ } ) . then ( ( ) => {
937
+ fixture . detectChanges ( ) ;
938
+ expect ( firstRow . isSelected ) . toBeFalsy ( ) ;
939
+ } ) ;
940
+ } ) ) ;
941
+
920
942
it ( 'Should be able to programatically select all rows with a correct reference, #1297' , async ( ( ) => {
921
943
const fix = TestBed . createComponent ( GridWithPrimaryKeyComponent ) ;
922
944
fix . detectChanges ( ) ;
You can’t perform that action at this time.
0 commit comments