File tree 1 file changed +36
-0
lines changed
projects/igniteui-angular/src/lib/grids/grid
1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -216,6 +216,42 @@ describe('Row Pinning #grid', () => {
216
216
expect ( grid . getRowByIndex ( 0 ) . rowID ) . toBe ( fix . componentInstance . data [ 0 ] ) ;
217
217
expect ( grid . getRowByIndex ( 1 ) . rowID ) . toBe ( fix . componentInstance . data [ 1 ] ) ;
218
218
} ) ;
219
+
220
+ it ( 'search should include pinned and unpinned rows.' , ( ) => {
221
+ // pin 1st row
222
+ let row = grid . getRowByIndex ( 0 ) ;
223
+ row . pinned = true ;
224
+ fix . detectChanges ( ) ;
225
+ expect ( grid . pinnedRecords . length ) . toBe ( 1 ) ;
226
+
227
+ let finds = grid . findNext ( 'mari' ) ;
228
+ fix . detectChanges ( ) ;
229
+
230
+ const fixNativeElement = fix . debugElement . nativeElement ;
231
+ let spans = fixNativeElement . querySelectorAll ( '.igx-highlight' ) ;
232
+ expect ( spans . length ) . toBe ( 1 ) ;
233
+ expect ( finds ) . toEqual ( 2 ) ;
234
+
235
+ finds = grid . findNext ( 'antonio' ) ;
236
+ fix . detectChanges ( ) ;
237
+
238
+ spans = fixNativeElement . querySelectorAll ( '.igx-highlight' ) ;
239
+ expect ( spans . length ) . toBe ( 2 ) ;
240
+ expect ( finds ) . toEqual ( 2 ) ;
241
+
242
+ // pin 3rd row
243
+ row = grid . getRowByIndex ( 2 ) ;
244
+ row . pinned = true ;
245
+ fix . detectChanges ( ) ;
246
+ expect ( grid . pinnedRecords . length ) . toBe ( 2 ) ;
247
+
248
+ finds = grid . findNext ( 'antonio' ) ;
249
+ fix . detectChanges ( ) ;
250
+
251
+ spans = fixNativeElement . querySelectorAll ( '.igx-highlight' ) ;
252
+ expect ( spans . length ) . toBe ( 2 ) ;
253
+ expect ( finds ) . toEqual ( 2 ) ;
254
+ } ) ;
219
255
} ) ;
220
256
} ) ;
221
257
You can’t perform that action at this time.
0 commit comments