@@ -2494,6 +2494,37 @@ describe('IgxGrid - Filtering Row UI actions', () => {
2494
2494
dropdownList = fix . debugElement . query ( By . css ( 'div.igx-drop-down__list.igx-toggle' ) ) ;
2495
2495
expect ( dropdownList ) . toBeNull ( ) ;
2496
2496
} ) ) ;
2497
+
2498
+ it ( 'Should commit the input and new chip after picking date from calendar for filtering.' , fakeAsync ( ( ) => {
2499
+ // Click date filter chip to show filter row.
2500
+ const filterCells = fix . debugElement . queryAll ( By . directive ( IgxGridFilteringCellComponent ) ) ;
2501
+ const dateFilterCell = filterCells . find ( ( fc ) => fc . componentInstance . column . field === 'ReleaseDate' ) ;
2502
+ const dateFilterCellChip = dateFilterCell . query ( By . directive ( IgxChipComponent ) ) ;
2503
+ dateFilterCellChip . nativeElement . click ( ) ;
2504
+ tick ( 100 ) ;
2505
+ fix . detectChanges ( ) ;
2506
+
2507
+ // Click input to open calendar.
2508
+ const filteringRow = fix . debugElement . query ( By . directive ( IgxGridFilteringRowComponent ) ) ;
2509
+ const input = filteringRow . query ( By . directive ( IgxInputDirective ) ) ;
2510
+ input . nativeElement . click ( ) ;
2511
+ tick ( 100 ) ;
2512
+ fix . detectChanges ( ) ;
2513
+
2514
+ // Click the today date.
2515
+ const outlet = document . getElementsByClassName ( 'igx-grid__outlet' ) [ 0 ] ;
2516
+ const calendar = outlet . getElementsByClassName ( 'igx-calendar' ) [ 0 ] ;
2517
+ const todayDayItem = calendar . querySelector ( '.igx-calendar__date--current' ) ;
2518
+ ( < HTMLElement > todayDayItem ) . click ( ) ;
2519
+ tick ( 100 ) ;
2520
+ fix . detectChanges ( ) ;
2521
+
2522
+ // Verify the chip and input are committed.
2523
+ const activeFiltersArea = filteringRow . query ( By . css ( '.igx-grid__filtering-row-main' ) ) ;
2524
+ const activeFilterChip = activeFiltersArea . query ( By . directive ( IgxChipComponent ) ) ;
2525
+ expect ( ( < IgxChipComponent > activeFilterChip . componentInstance ) . selected ) . toBe ( false , 'chip is not committed' ) ;
2526
+ expect ( ( < IgxInputDirective > input . componentInstance ) . value ) . toBeNull ( 'input value is present and not committed' ) ;
2527
+ } ) ) ;
2497
2528
} ) ;
2498
2529
2499
2530
describe ( null , ( ) => {
0 commit comments