@@ -3462,24 +3462,24 @@ describe('IgxGrid - Filtering Row UI actions #grid', () => {
34623462 // Click the today date.
34633463 const outlet = document . getElementsByClassName ( 'igx-grid__outlet' ) [ 0 ] ;
34643464 let calendar = outlet . getElementsByClassName ( 'igx-calendar' ) [ 0 ] ;
3465- const todayDayItem = calendar . querySelector ( '.igx-calendar__date--current' ) ;
3465+ const todayDayItem : HTMLElement = calendar . querySelector ( '.igx-calendar__date--current' ) ;
34663466 clickHtmlElemAndBlur ( todayDayItem , inputDebugElement ) ;
34673467 tick ( 100 ) ;
34683468 fix . detectChanges ( ) ;
34693469
3470- // Select our newly added chip
3470+ // Verify the newly added chip is selected.
34713471 const chip = GridFunctions . getFilterConditionChip ( fix , 0 ) ;
34723472 const chipDiv = chip . querySelector ( '.igx-chip__item' ) ;
34733473
3474- expect ( chipDiv . classList . contains ( 'igx-chip__item--selected' ) ) . toBeTruthy ( 'initial chip is committed' ) ;
3474+ expect ( chipDiv . classList . contains ( 'igx-chip__item--selected' ) ) . toBe ( true , 'initial chip is committed' ) ;
34753475
34763476 // Focus out
34773477 clickHtmlElemAndBlur ( chip , inputDebugElement ) ;
34783478 tick ( 200 ) ;
34793479 fix . detectChanges ( ) ;
34803480
3481- expect ( chipDiv . classList . contains ( 'igx-chip__item--selected' ) ) . toBeFalsy ( 'initial chip is not committed' ) ;
3482- expect ( input . value ) . toBeFalsy ( 'initial input value is present and not committed' ) ;
3481+ expect ( chipDiv . classList . contains ( 'igx-chip__item--selected' ) ) . toBe ( false , 'initial chip is not committed' ) ;
3482+ expect ( input . value ) . toBe ( '' , 'initial input value is present and not committed' ) ;
34833483
34843484 chip . click ( ) ;
34853485 tick ( 200 ) ;
@@ -3510,7 +3510,7 @@ describe('IgxGrid - Filtering Row UI actions #grid', () => {
35103510 tick ( 100 ) ;
35113511 fix . detectChanges ( ) ;
35123512
3513- expect ( chipDiv . classList . contains ( 'igx-chip__item--selected' ) ) . toBeTruthy ( 'chip is committed' ) ;
3513+ expect ( chipDiv . classList . contains ( 'igx-chip__item--selected' ) ) . toBe ( true , 'chip is committed' ) ;
35143514
35153515 // Focus out
35163516 clickHtmlElemAndBlur ( chip , inputDebugElement ) ;
@@ -3519,12 +3519,11 @@ describe('IgxGrid - Filtering Row UI actions #grid', () => {
35193519 expect ( chipDiv . classList . contains ( 'igx-chip__item--selected' ) ) . toBe ( false , 'chip is selected' ) ;
35203520
35213521 // Check if we still have only one committed chip
3522- const activeFilterChip : IgxChipComponent = filteringRow . query ( By . directive ( IgxChipComponent ) ) . componentInstance ;
35233522 const chipsLength = GridFunctions . getAllFilterConditionChips ( fix ) . length ;
35243523
35253524 expect ( chipsLength ) . toBe ( 1 , 'there is more than one chip' ) ;
3526- expect ( activeFilterChip . selected ) . toBe ( false , 'chip is not committed' ) ;
3527- expect ( input . value ) . toBeFalsy ( 'input value is present and not committed' ) ;
3525+ expect ( chipDiv . classList . contains ( 'igx-chip__item-- selected' ) ) . toBe ( false , 'chip is not committed' ) ;
3526+ expect ( input . value ) . toBe ( '' , 'input value is present and not committed' ) ;
35283527 } ) ) ;
35293528 } ) ;
35303529 describe ( null , ( ) => {
@@ -6543,17 +6542,13 @@ function verifyChipVisibility(fix, index: number, shouldBeFullyVisible: boolean)
65436542 . toBe ( shouldBeFullyVisible , 'chip[' + index + '] visibility is incorrect' ) ;
65446543}
65456544
6546- function clickElemAndBlur ( clickElem , blurElem ) {
6547- const elementRect = clickElem . nativeElement . getBoundingClientRect ( ) ;
6548- UIInteractions . simulatePointerEvent ( 'pointerdown' , clickElem . nativeElement , elementRect . left , elementRect . top ) ;
6549- blurElem . nativeElement . blur ( ) ;
6550- ( clickElem as DebugElement ) . nativeElement . focus ( ) ;
6551- blurElem . nativeElement . dispatchEvent ( new FocusEvent ( 'focusout' , { bubbles : true } ) ) ;
6552- UIInteractions . simulatePointerEvent ( 'pointerup' , clickElem . nativeElement , elementRect . left , elementRect . top ) ;
6553- UIInteractions . simulateMouseEvent ( 'click' , clickElem . nativeElement , 10 , 10 ) ;
6545+ function clickElemAndBlur ( clickElem : DebugElement , blurElem : DebugElement ) {
6546+ const clickHtmlElem = clickElem . nativeElement ;
6547+
6548+ this . clickHtmlElemAndBlur ( clickHtmlElem , blurElem ) ;
65546549}
65556550
6556- function clickHtmlElemAndBlur ( clickElem , blurElem ) {
6551+ function clickHtmlElemAndBlur ( clickElem : HTMLElement , blurElem : DebugElement ) {
65576552 const elementRect = clickElem . getBoundingClientRect ( ) ;
65586553 UIInteractions . simulatePointerEvent ( 'pointerdown' , clickElem , elementRect . left , elementRect . top ) ;
65596554 blurElem . nativeElement . blur ( ) ;
0 commit comments