@@ -1195,17 +1195,18 @@ describe('igxCombo', () => {
11951195 it ( 'should render selected items properly' , ( ) => {
11961196 combo . toggle ( ) ;
11971197 fixture . detectChanges ( ) ;
1198+
11981199 const dropdownList = fixture . debugElement . query ( By . css ( `.${ CSS_CLASS_DROPDOWNLIST_SCROLL } ` ) ) . nativeElement ;
11991200 const dropdownItems = dropdownList . querySelectorAll ( `.${ CSS_CLASS_DROPDOWNLISTITEM } ` ) ;
1201+
1202+
12001203 expect ( dropdownItems [ 1 ] . classList . contains ( CSS_CLASS_SELECTED ) ) . toBeFalsy ( ) ;
12011204 expect ( dropdownItems [ 3 ] . classList . contains ( CSS_CLASS_SELECTED ) ) . toBeFalsy ( ) ;
1202- expect ( dropdownItems [ 7 ] . classList . contains ( CSS_CLASS_SELECTED ) ) . toBeFalsy ( ) ;
12031205
1204- combo . select ( [ 'Illinois' , 'Mississippi' , ' Ohio'] ) ;
1206+ combo . select ( [ 'Illinois' , 'Ohio' ] ) ;
12051207 fixture . detectChanges ( ) ;
12061208 expect ( dropdownItems [ 1 ] . classList . contains ( CSS_CLASS_SELECTED ) ) . toBeTruthy ( ) ;
12071209 expect ( dropdownItems [ 3 ] . classList . contains ( CSS_CLASS_SELECTED ) ) . toBeTruthy ( ) ;
1208- expect ( dropdownItems [ 7 ] . classList . contains ( CSS_CLASS_SELECTED ) ) . toBeTruthy ( ) ;
12091210
12101211 combo . deselect ( [ 'Ohio' ] ) ;
12111212 fixture . detectChanges ( ) ;
@@ -1225,9 +1226,9 @@ describe('igxCombo', () => {
12251226 expect ( focusedItem_1 . classList . contains ( CSS_CLASS_FOCUSED ) ) . toBeTruthy ( ) ;
12261227
12271228 // Change focus
1228- dropdown . navigateItem ( 6 ) ;
1229+ dropdown . navigateItem ( 4 ) ;
12291230 fixture . detectChanges ( ) ;
1230- const focusedItem_2 = dropdownItems [ 5 ] ;
1231+ const focusedItem_2 = dropdownItems [ 3 ] ;
12311232 expect ( focusedItem_2 . classList . contains ( CSS_CLASS_FOCUSED ) ) . toBeTruthy ( ) ;
12321233 expect ( focusedItem_1 . classList . contains ( CSS_CLASS_FOCUSED ) ) . toBeFalsy ( ) ;
12331234 } ) ;
@@ -1894,17 +1895,17 @@ describe('igxCombo', () => {
18941895 selectedItemsCount ++ ;
18951896 selectAndVerifyItem ( 0 ) ;
18961897
1897- for ( let index = 1 ; index < 7 ; index ++ ) {
1898+ for ( let index = 1 ; index < 5 ; index ++ ) {
18981899 focusAndVerifyItem ( index , 'ArrowDown' ) ;
18991900 }
19001901 selectedItemsCount ++ ;
1901- selectAndVerifyItem ( 6 ) ;
1902+ selectAndVerifyItem ( 4 ) ;
19021903
1903- for ( let index = 5 ; index > 3 ; index -- ) {
1904+ for ( let index = 3 ; index >= 2 ; index -- ) {
19041905 focusAndVerifyItem ( index , 'ArrowUp' ) ;
19051906 }
19061907 selectedItemsCount ++ ;
1907- selectAndVerifyItem ( 4 ) ;
1908+ selectAndVerifyItem ( 2 ) ;
19081909 } ) ;
19091910 it ( 'should properly navigate using HOME/END key' , ( async ( ) => {
19101911 let firstVisibleItem : Element ;
@@ -2072,7 +2073,7 @@ describe('igxCombo', () => {
20722073 const scrollbar = fixture . debugElement . query ( By . css ( `.${ CSS_CLASS_SCROLLBAR_VERTICAL } ` ) ) . nativeElement as HTMLElement ;
20732074 expect ( scrollbar . scrollTop ) . toEqual ( 0 ) ;
20742075
2075- combo . virtualScrollContainer . scrollTo ( 16 ) ;
2076+ combo . virtualScrollContainer . scrollTo ( 12 ) ;
20762077 await firstValueFrom ( combo . virtualScrollContainer . chunkLoad ) ;
20772078 fixture . detectChanges ( ) ;
20782079 let selectedItem = fixture . debugElement . queryAll ( By . css ( `.${ CSS_CLASS_DROPDOWNLISTITEM } ` ) ) [ 1 ] ;
@@ -2088,7 +2089,7 @@ describe('igxCombo', () => {
20882089 // Content was scrolled to bottom
20892090 expect ( scrollbar . scrollHeight - scrollbar . scrollTop ) . toEqual ( scrollbar . clientHeight ) ;
20902091
2091- combo . virtualScrollContainer . scrollTo ( 5 ) ;
2092+ combo . virtualScrollContainer . scrollTo ( 4 ) ;
20922093 await firstValueFrom ( combo . virtualScrollContainer . chunkLoad ) ;
20932094 fixture . detectChanges ( ) ;
20942095 selectedItem = fixture . debugElement . query ( By . css ( `.${ CSS_CLASS_SELECTED } ` ) ) ;
@@ -2163,15 +2164,14 @@ describe('igxCombo', () => {
21632164 expect ( input . nativeElement . value ) . toEqual ( expectedOutput ) ;
21642165 } ) ;
21652166 it ( 'should dismiss all selected items by pressing clear button' , ( ) => {
2166- const expectedOutput = 'Kentucky, Ohio, Indiana' ;
2167- combo . select ( [ 'Kentucky' , ' Ohio', 'Indiana' ] ) ;
2167+ const expectedOutput = 'Ohio, Indiana' ;
2168+ combo . select ( [ 'Ohio' , 'Indiana' ] ) ;
21682169 fixture . detectChanges ( ) ;
21692170 expect ( input . nativeElement . value ) . toEqual ( expectedOutput ) ;
21702171 combo . toggle ( ) ;
21712172 fixture . detectChanges ( ) ;
21722173 expect ( combo . dropdown . items [ 1 ] . selected ) . toBeTruthy ( ) ;
21732174 expect ( combo . dropdown . items [ 4 ] . selected ) . toBeTruthy ( ) ;
2174- expect ( combo . dropdown . items [ 6 ] . selected ) . toBeTruthy ( ) ;
21752175
21762176 const clearBtn = fixture . debugElement . query ( By . css ( `.${ CSS_CLASS_CLEARBUTTON } ` ) ) ;
21772177 clearBtn . triggerEventHandler ( 'click' , UIInteractions . getMouseEvent ( 'click' ) ) ;
@@ -2184,7 +2184,6 @@ describe('igxCombo', () => {
21842184 fixture . detectChanges ( ) ;
21852185 expect ( combo . dropdown . items [ 1 ] . selected ) . toBeFalsy ( ) ;
21862186 expect ( combo . dropdown . items [ 4 ] . selected ) . toBeFalsy ( ) ;
2187- expect ( combo . dropdown . items [ 6 ] . selected ) . toBeFalsy ( ) ;
21882187 } ) ;
21892188 it ( 'should show/hide clear button after selecting/deselecting items' , ( ) => {
21902189 // This is a workaround for issue github.com/angular/angular/issues/14235
@@ -2242,8 +2241,8 @@ describe('igxCombo', () => {
22422241 cancel : false
22432242 } ) ;
22442243
2245- const selectedItem_2 = dropdown . items [ 5 ] ;
2246- simulateComboItemClick ( 5 ) ;
2244+ const selectedItem_2 = dropdown . items [ 4 ] ;
2245+ simulateComboItemClick ( 4 ) ;
22472246 expect ( combo . selection [ 1 ] ) . toEqual ( selectedItem_2 . value ) ;
22482247 expect ( combo . value [ 1 ] ) . toEqual ( selectedItem_2 . value [ combo . valueKey ] ) ;
22492248 expect ( selectedItem_2 . selected ) . toBeTruthy ( ) ;
@@ -3768,7 +3767,6 @@ class IgxComboFormComponent {
37683767 password : [ '' , Validators . required ] ,
37693768 townCombo : [ [ this . items [ 0 ] ] , Validators . required ]
37703769 } ) ;
3771-
37723770 }
37733771 public onSubmitReactive ( ) { }
37743772
0 commit comments