@@ -1286,8 +1286,8 @@ describe('IgxGrid - Filtering Row UI actions #grid', () => {
1286
1286
const prefix = GridFunctions . getFilterRowPrefix ( fix ) ;
1287
1287
const event = {
1288
1288
currentTarget : prefix . nativeElement ,
1289
- preventDefault : ( ) => { } ,
1290
- stopPropagation : ( ) => { }
1289
+ preventDefault : ( ) => { } ,
1290
+ stopPropagation : ( ) => { }
1291
1291
} ;
1292
1292
1293
1293
// Click prefix to open conditions dropdown
@@ -1313,8 +1313,8 @@ describe('IgxGrid - Filtering Row UI actions #grid', () => {
1313
1313
const prefix = GridFunctions . getFilterRowPrefix ( fix ) ;
1314
1314
const event = {
1315
1315
currentTarget : prefix . nativeElement ,
1316
- preventDefault : ( ) => { } ,
1317
- stopPropagation : ( ) => { }
1316
+ preventDefault : ( ) => { } ,
1317
+ stopPropagation : ( ) => { }
1318
1318
} ;
1319
1319
1320
1320
// Click prefix to open conditions dropdown
@@ -1705,7 +1705,7 @@ describe('IgxGrid - Filtering Row UI actions #grid', () => {
1705
1705
1706
1706
filterUIRow = fix . debugElement . query ( By . css ( FILTER_UI_ROW ) ) ;
1707
1707
expect ( filterUIRow ) . toBeNull ( ) ;
1708
- } ) ) ;
1708
+ } ) ) ;
1709
1709
1710
1710
it ( 'Should navigate to first cell of grid when pressing \'Tab\' on the last filterCell chip.' , fakeAsync ( ( ) => {
1711
1711
pending ( 'Should be fixed with headers navigation' ) ;
@@ -1903,17 +1903,17 @@ describe('IgxGrid - Filtering Row UI actions #grid', () => {
1903
1903
1904
1904
let chipToRemove = filterUIRow . componentInstance . expressionsList [ 3 ] ;
1905
1905
expect ( ( ) => {
1906
- filterUIRow . componentInstance . onChipRemoved ( null , chipToRemove ) ;
1907
- } )
1906
+ filterUIRow . componentInstance . onChipRemoved ( null , chipToRemove ) ;
1907
+ } )
1908
1908
. not . toThrowError ( / \' i d \' o f u n d e f i n e d / ) ;
1909
1909
fix . detectChanges ( ) ;
1910
1910
await wait ( 500 ) ;
1911
1911
fix . detectChanges ( ) ;
1912
1912
1913
1913
chipToRemove = filterUIRow . componentInstance . expressionsList [ 2 ] ;
1914
1914
expect ( ( ) => {
1915
- filterUIRow . componentInstance . onChipRemoved ( null , chipToRemove ) ;
1916
- } )
1915
+ filterUIRow . componentInstance . onChipRemoved ( null , chipToRemove ) ;
1916
+ } )
1917
1917
. not . toThrowError ( / \' i d \' o f u n d e f i n e d / ) ;
1918
1918
fix . detectChanges ( ) ;
1919
1919
await wait ( 100 ) ;
@@ -2608,7 +2608,7 @@ describe('IgxGrid - Filtering Row UI actions #grid', () => {
2608
2608
2609
2609
it ( 'Should correctly update empty filter cells when scrolling horizontally.' , async ( ) => {
2610
2610
let emptyFilterCells = fix . debugElement . queryAll ( By . directive ( IgxGridFilteringCellComponent ) )
2611
- . filter ( ( cell ) => cell . nativeElement . children . length === 0 ) ;
2611
+ . filter ( ( cell ) => cell . nativeElement . children . length === 0 ) ;
2612
2612
expect ( emptyFilterCells . length ) . toEqual ( 1 ) ;
2613
2613
2614
2614
let emptyFilterHeader = emptyFilterCells [ 0 ] . parent . query ( By . directive ( IgxGridHeaderComponent ) ) ;
@@ -2620,7 +2620,7 @@ describe('IgxGrid - Filtering Row UI actions #grid', () => {
2620
2620
fix . detectChanges ( ) ;
2621
2621
2622
2622
emptyFilterCells = fix . debugElement . queryAll ( By . directive ( IgxGridFilteringCellComponent ) )
2623
- . filter ( ( cell ) => cell . nativeElement . children . length === 0 ) ;
2623
+ . filter ( ( cell ) => cell . nativeElement . children . length === 0 ) ;
2624
2624
expect ( emptyFilterCells . length ) . toEqual ( 1 ) ;
2625
2625
2626
2626
emptyFilterHeader = emptyFilterCells [ 0 ] . parent . query ( By . directive ( IgxGridHeaderComponent ) ) ;
@@ -4336,7 +4336,7 @@ describe('IgxGrid - Filtering actions - Excel style filtering #grid', () => {
4336
4336
expect ( calendar ) . toBeNull ( ) ;
4337
4337
} ) ) ;
4338
4338
4339
- it ( 'Should filter grid through custom date filter dialog.' , fakeAsync ( ( ) => {
4339
+ fit ( 'Should filter grid through custom date filter dialog.' , fakeAsync ( ( ) => {
4340
4340
const column = grid . getColumnByName ( 'ReleaseDate' ) ;
4341
4341
// Open excel style custom filtering dialog.
4342
4342
GridFunctions . clickExcelFilterIcon ( fix , 'ReleaseDate' ) ;
@@ -4347,8 +4347,10 @@ describe('IgxGrid - Filtering actions - Excel style filtering #grid', () => {
4347
4347
GridFunctions . clickOperatorFromCascadeMenu ( fix , 0 ) ;
4348
4348
tick ( 200 ) ;
4349
4349
4350
- const datePicker = fix . debugElement . query ( By . directive ( IgxDatePickerComponent ) ) ;
4351
- datePicker . triggerEventHandler ( 'click' , null ) ;
4350
+ const expr = GridFunctions . getExcelCustomFilteringDateExpressions ( fix ) [ 0 ] ;
4351
+ const datePicker = expr . querySelector ( 'igx-date-picker' ) ;
4352
+ const input = datePicker . querySelector ( 'input' ) ;
4353
+ UIInteractions . simulateClickEvent ( input ) ;
4352
4354
fix . detectChanges ( ) ;
4353
4355
4354
4356
// Click today item.
@@ -4362,8 +4364,7 @@ describe('IgxGrid - Filtering actions - Excel style filtering #grid', () => {
4362
4364
// Verify the results are with 'today' date.
4363
4365
const filteredDate = SampleTestData . today ;
4364
4366
const inputText = grid . datePipe . transform ( filteredDate , column . pipeArgs . format , undefined , grid . locale ) ;
4365
- const datePickerInput = fix . debugElement . query ( By . css ( '.igx-date-picker__input-date' ) ) ;
4366
- expect ( datePickerInput . nativeElement . value ) . toMatch ( inputText ) ;
4367
+ expect ( ( input as HTMLInputElement ) . value ) . toMatch ( inputText ) ;
4367
4368
4368
4369
// Click 'apply' button to apply filter.
4369
4370
GridFunctions . clickApplyExcelStyleCustomFiltering ( fix ) ;
@@ -4375,7 +4376,7 @@ describe('IgxGrid - Filtering actions - Excel style filtering #grid', () => {
4375
4376
expect ( grid . filteredData . length ) . toEqual ( 1 ) ;
4376
4377
} ) ) ;
4377
4378
4378
- it ( 'Should filter grid with ISO 8601 dates through custom date filter dialog' , fakeAsync ( ( ) => {
4379
+ fit ( 'Should filter grid with ISO 8601 dates through custom date filter dialog' , fakeAsync ( ( ) => {
4379
4380
fix . componentInstance . data = SampleTestData . excelFilteringData ( ) . map ( rec => {
4380
4381
const newRec = Object . assign ( { } , rec ) as any ;
4381
4382
newRec . ReleaseDate = rec . ReleaseDate ? rec . ReleaseDate . toISOString ( ) : null ;
@@ -4393,8 +4394,10 @@ describe('IgxGrid - Filtering actions - Excel style filtering #grid', () => {
4393
4394
GridFunctions . clickOperatorFromCascadeMenu ( fix , 0 ) ;
4394
4395
tick ( 200 ) ;
4395
4396
4396
- const datePicker = fix . debugElement . query ( By . directive ( IgxDatePickerComponent ) ) ;
4397
- datePicker . triggerEventHandler ( 'click' , null ) ;
4397
+ const expr = GridFunctions . getExcelCustomFilteringDateExpressions ( fix ) [ 0 ] ;
4398
+ const datePicker = expr . querySelector ( 'igx-date-picker' ) ;
4399
+ const input = datePicker . querySelector ( 'input' ) ;
4400
+ UIInteractions . simulateClickEvent ( input ) ;
4398
4401
fix . detectChanges ( ) ;
4399
4402
4400
4403
// Click today item.
@@ -4408,8 +4411,7 @@ describe('IgxGrid - Filtering actions - Excel style filtering #grid', () => {
4408
4411
// Verify the results are with 'today' date.
4409
4412
const filteredDate = SampleTestData . today ;
4410
4413
const inputText = grid . datePipe . transform ( filteredDate , column . pipeArgs . format , undefined , grid . locale ) ;
4411
- const datePickerInput = fix . debugElement . query ( By . css ( '.igx-date-picker__input-date' ) ) ;
4412
- expect ( datePickerInput . nativeElement . value ) . toMatch ( inputText ) ;
4414
+ expect ( ( input as HTMLInputElement ) . value ) . toMatch ( inputText ) ;
4413
4415
4414
4416
// Click 'apply' button to apply filter.
4415
4417
GridFunctions . clickApplyExcelStyleCustomFiltering ( fix ) ;
@@ -4421,7 +4423,7 @@ describe('IgxGrid - Filtering actions - Excel style filtering #grid', () => {
4421
4423
expect ( grid . filteredData . length ) . toEqual ( 1 ) ;
4422
4424
} ) ) ;
4423
4425
4424
- it ( 'Should filter grid with miliseconds dates through custom date filter dialog' , fakeAsync ( ( ) => {
4426
+ fit ( 'Should filter grid with miliseconds dates through custom date filter dialog' , fakeAsync ( ( ) => {
4425
4427
fix . componentInstance . data = SampleTestData . excelFilteringData ( ) . map ( rec => {
4426
4428
const newRec = Object . assign ( { } , rec ) as any ;
4427
4429
newRec . ReleaseDate = rec . ReleaseDate ? rec . ReleaseDate . getTime ( ) : null ;
@@ -4439,8 +4441,10 @@ describe('IgxGrid - Filtering actions - Excel style filtering #grid', () => {
4439
4441
GridFunctions . clickOperatorFromCascadeMenu ( fix , 0 ) ;
4440
4442
tick ( 200 ) ;
4441
4443
4442
- const datePicker = fix . debugElement . query ( By . directive ( IgxDatePickerComponent ) ) ;
4443
- datePicker . triggerEventHandler ( 'click' , null ) ;
4444
+ const expr = GridFunctions . getExcelCustomFilteringDateExpressions ( fix ) [ 0 ] ;
4445
+ const datePicker = expr . querySelector ( 'igx-date-picker' ) ;
4446
+ const input = datePicker . querySelector ( 'input' ) ;
4447
+ UIInteractions . simulateClickEvent ( input ) ;
4444
4448
fix . detectChanges ( ) ;
4445
4449
4446
4450
// Click today item.
@@ -4454,8 +4458,7 @@ describe('IgxGrid - Filtering actions - Excel style filtering #grid', () => {
4454
4458
// Verify the results are with 'today' date.
4455
4459
const filteredDate = SampleTestData . today ;
4456
4460
const inputText = grid . datePipe . transform ( filteredDate , column . pipeArgs . format , undefined , grid . locale ) ;
4457
- const datePickerInput = fix . debugElement . query ( By . css ( '.igx-date-picker__input-date' ) ) ;
4458
- expect ( datePickerInput . nativeElement . value ) . toMatch ( inputText ) ;
4461
+ expect ( ( input as HTMLInputElement ) . value ) . toMatch ( inputText ) ;
4459
4462
4460
4463
// Click 'apply' button to apply filter.
4461
4464
GridFunctions . clickApplyExcelStyleCustomFiltering ( fix ) ;
@@ -4467,7 +4470,7 @@ describe('IgxGrid - Filtering actions - Excel style filtering #grid', () => {
4467
4470
expect ( grid . filteredData . length ) . toEqual ( 1 ) ;
4468
4471
} ) ) ;
4469
4472
4470
- it ( 'Should filter grid through custom date filter dialog when using pipeArgs for the column' , fakeAsync ( ( ) => {
4473
+ fit ( 'Should filter grid through custom date filter dialog when using pipeArgs for the column' , fakeAsync ( ( ) => {
4471
4474
fix . componentInstance . data = SampleTestData . excelFilteringData ( ) . map ( rec => {
4472
4475
const newRec = Object . assign ( { } , rec ) as any ;
4473
4476
newRec . ReleaseDate = rec . ReleaseDate ? rec . ReleaseDate . toISOString ( ) : null ;
@@ -4490,8 +4493,10 @@ describe('IgxGrid - Filtering actions - Excel style filtering #grid', () => {
4490
4493
GridFunctions . clickOperatorFromCascadeMenu ( fix , 0 ) ;
4491
4494
tick ( 200 ) ;
4492
4495
4493
- const datePicker = fix . debugElement . query ( By . directive ( IgxDatePickerComponent ) ) ;
4494
- datePicker . triggerEventHandler ( 'click' , null ) ;
4496
+ const expr = GridFunctions . getExcelCustomFilteringDateExpressions ( fix ) [ 0 ] ;
4497
+ const datePicker = expr . querySelector ( 'igx-date-picker' ) ;
4498
+ const input = datePicker . querySelector ( 'input' ) ;
4499
+ UIInteractions . simulateClickEvent ( input ) ;
4495
4500
fix . detectChanges ( ) ;
4496
4501
4497
4502
// Click today item.
@@ -4505,8 +4510,7 @@ describe('IgxGrid - Filtering actions - Excel style filtering #grid', () => {
4505
4510
// Verify the results are with 'today' date.
4506
4511
const filteredDate = SampleTestData . today ;
4507
4512
const inputText = grid . datePipe . transform ( filteredDate , column . pipeArgs . format , undefined , grid . locale ) ;
4508
- const datePickerInput = fix . debugElement . query ( By . css ( '.igx-date-picker__input-date' ) ) ;
4509
- expect ( datePickerInput . nativeElement . value ) . toMatch ( inputText ) ;
4513
+ expect ( ( input as HTMLInputElement ) . value ) . toMatch ( inputText ) ;
4510
4514
4511
4515
// Click 'apply' button to apply filter.
4512
4516
GridFunctions . clickApplyExcelStyleCustomFiltering ( fix ) ;
@@ -4518,7 +4522,7 @@ describe('IgxGrid - Filtering actions - Excel style filtering #grid', () => {
4518
4522
expect ( grid . filteredData . length ) . toEqual ( 1 ) ;
4519
4523
} ) ) ;
4520
4524
4521
- it ( 'Should filter grid through custom date filter dialog when using pipeArgs and formatter for the column' , fakeAsync ( ( ) => {
4525
+ fit ( 'Should filter grid through custom date filter dialog when using pipeArgs and formatter for the column' , fakeAsync ( ( ) => {
4522
4526
const pipe = new DatePipe ( 'fr-FR' ) ;
4523
4527
const formatOptions = {
4524
4528
timezone : 'utc' ,
@@ -4541,8 +4545,10 @@ describe('IgxGrid - Filtering actions - Excel style filtering #grid', () => {
4541
4545
GridFunctions . clickOperatorFromCascadeMenu ( fix , 0 ) ;
4542
4546
tick ( 200 ) ;
4543
4547
4544
- const datePicker = fix . debugElement . query ( By . directive ( IgxDatePickerComponent ) ) ;
4545
- datePicker . triggerEventHandler ( 'click' , null ) ;
4548
+ const expr = GridFunctions . getExcelCustomFilteringDateExpressions ( fix ) [ 0 ] ;
4549
+ const datePicker = expr . querySelector ( 'igx-date-picker' ) ;
4550
+ const input = datePicker . querySelector ( 'input' ) ;
4551
+ UIInteractions . simulateClickEvent ( input ) ;
4546
4552
fix . detectChanges ( ) ;
4547
4553
tick ( 350 ) ; // calendar animationDone timeout
4548
4554
@@ -4556,8 +4562,7 @@ describe('IgxGrid - Filtering actions - Excel style filtering #grid', () => {
4556
4562
// Verify the results are with 'today' date.
4557
4563
const filteredDate = SampleTestData . today ;
4558
4564
const inputText = column . formatter ( filteredDate ) ;
4559
- const datePickerInput = fix . debugElement . query ( By . css ( '.igx-date-picker__input-date' ) ) ;
4560
- expect ( datePickerInput . nativeElement . value ) . toMatch ( inputText ) ;
4565
+ expect ( ( input as HTMLInputElement ) . value ) . toMatch ( inputText ) ;
4561
4566
4562
4567
// Click 'apply' button to apply filter.
4563
4568
GridFunctions . clickApplyExcelStyleCustomFiltering ( fix ) ;
@@ -4725,7 +4730,7 @@ describe('IgxGrid - Filtering actions - Excel style filtering #grid', () => {
4725
4730
4726
4731
excelMenu = GridFunctions . getExcelStyleFilteringComponent ( fix ) ;
4727
4732
expect ( excelMenu ) . toBeNull ( ) ;
4728
- } ) ) ;
4733
+ } ) ) ;
4729
4734
4730
4735
it ( 'Should filter date by input string' , fakeAsync ( ( ) => {
4731
4736
GridFunctions . clickExcelFilterIcon ( fix , 'ReleaseDate' ) ;
@@ -4870,17 +4875,17 @@ describe('IgxGrid - Filtering actions - Excel style filtering #grid', () => {
4870
4875
it ( 'Should display "Add to current filter selection" button on typing in input' , fakeAsync ( ( ) => {
4871
4876
// Open excel style filtering dialog.
4872
4877
GridFunctions . clickExcelFilterIconFromCode ( fix , grid , 'Downloads' ) ;
4873
- // Type string in search box.
4874
- const searchComponent = GridFunctions . getExcelStyleSearchComponent ( fix ) ;
4875
- const inputNativeElement = GridFunctions . getExcelStyleSearchComponentInput ( fix , searchComponent ) ;
4876
- UIInteractions . clickAndSendInputElementValue ( inputNativeElement , '2' , fix ) ;
4877
- tick ( 100 ) ;
4878
- fix . detectChanges ( ) ;
4878
+ // Type string in search box.
4879
+ const searchComponent = GridFunctions . getExcelStyleSearchComponent ( fix ) ;
4880
+ const inputNativeElement = GridFunctions . getExcelStyleSearchComponentInput ( fix , searchComponent ) ;
4881
+ UIInteractions . clickAndSendInputElementValue ( inputNativeElement , '2' , fix ) ;
4882
+ tick ( 100 ) ;
4883
+ fix . detectChanges ( ) ;
4879
4884
4880
- // Verify that the second item is 'Add to current filter selection'.
4881
- const listItems = GridFunctions . getExcelStyleSearchComponentListItems ( fix , searchComponent ) ;
4882
- expect ( listItems . length ) . toBe ( 6 , 'incorrect rendered list items count' ) ;
4883
- expect ( listItems [ 1 ] . innerText ) . toBe ( 'Add current selection to filter' ) ;
4885
+ // Verify that the second item is 'Add to current filter selection'.
4886
+ const listItems = GridFunctions . getExcelStyleSearchComponentListItems ( fix , searchComponent ) ;
4887
+ expect ( listItems . length ) . toBe ( 6 , 'incorrect rendered list items count' ) ;
4888
+ expect ( listItems [ 1 ] . innerText ) . toBe ( 'Add current selection to filter' ) ;
4884
4889
} ) ) ;
4885
4890
4886
4891
it ( 'Should filter grid the same way as in Excel' , fakeAsync ( ( ) => {
@@ -4912,20 +4917,20 @@ describe('IgxGrid - Filtering actions - Excel style filtering #grid', () => {
4912
4917
expect ( gridCellValues . length ) . toEqual ( 4 ) ;
4913
4918
expect ( gridCellValues ) . toEqual ( listItems ) ;
4914
4919
4915
- // Open excel style custom filtering dialog again.
4916
- GridFunctions . clickExcelFilterIconFromCode ( fix , grid , 'Downloads' ) ;
4920
+ // Open excel style custom filtering dialog again.
4921
+ GridFunctions . clickExcelFilterIconFromCode ( fix , grid , 'Downloads' ) ;
4917
4922
4918
- // Type string in search box.
4919
- searchComponent = GridFunctions . getExcelStyleSearchComponent ( fix ) ;
4920
- inputNativeElement = GridFunctions . getExcelStyleSearchComponentInput ( fix , searchComponent ) ;
4921
- UIInteractions . clickAndSendInputElementValue ( inputNativeElement , '5' , fix ) ;
4922
- tick ( 100 ) ;
4923
- fix . detectChanges ( ) ;
4923
+ // Type string in search box.
4924
+ searchComponent = GridFunctions . getExcelStyleSearchComponent ( fix ) ;
4925
+ inputNativeElement = GridFunctions . getExcelStyleSearchComponentInput ( fix , searchComponent ) ;
4926
+ UIInteractions . clickAndSendInputElementValue ( inputNativeElement , '5' , fix ) ;
4927
+ tick ( 100 ) ;
4928
+ fix . detectChanges ( ) ;
4924
4929
4925
- listItems = GridFunctions . getExcelStyleSearchComponentListItems ( fix , searchComponent )
4926
- . splice ( 2 )
4927
- . map ( c => c . innerText )
4928
- . sort ( ) ;
4930
+ listItems = GridFunctions . getExcelStyleSearchComponentListItems ( fix , searchComponent )
4931
+ . splice ( 2 )
4932
+ . map ( c => c . innerText )
4933
+ . sort ( ) ;
4929
4934
4930
4935
// Click 'apply' button to apply filter.
4931
4936
GridFunctions . clickApplyExcelStyleFiltering ( fix ) ;
@@ -5081,7 +5086,7 @@ describe('IgxGrid - Filtering actions - Excel style filtering #grid', () => {
5081
5086
// Verify ESF is visible.
5082
5087
expect ( excelMenu ) . not . toBeNull ( ) ;
5083
5088
5084
- // Verify that the dialog is closed on pressing Escape.
5089
+ // Verify that the dialog is closed on pressing Escape.
5085
5090
inputNativeElement . dispatchEvent ( new KeyboardEvent ( 'keydown' , { key : 'Escape' , bubbles : true } ) ) ;
5086
5091
excelMenu = GridFunctions . getExcelStyleFilteringComponent ( fix ) ;
5087
5092
expect ( excelMenu ) . toBeNull ( ) ;
0 commit comments