@@ -22,7 +22,7 @@ import { UIInteractions, wait } from '../test-utils/ui-interactions.spec';
22
22
import { IgxComboAddItemComponent } from './combo-add-item.component' ;
23
23
import { IgxComboDropDownComponent } from './combo-dropdown.component' ;
24
24
import { IgxComboItemComponent } from './combo-item.component' ;
25
- import { IComboFilteringOptions , IgxComboState } from './combo.common' ;
25
+ import { IComboFilteringOptions } from './combo.common' ;
26
26
import {
27
27
IComboItemAdditionEvent , IComboSearchInputEventArgs , IComboSelectionChangingEventArgs , IgxComboComponent
28
28
} from './combo.component' ;
@@ -3019,26 +3019,26 @@ describe('igxCombo', () => {
3019
3019
expect ( combo . value ) . toEqual ( comboFormReference . value ) ;
3020
3020
expect ( combo . selection . length ) . toEqual ( 1 ) ;
3021
3021
expect ( combo . selection [ 0 ] . field ) . toEqual ( 'Connecticut' ) ;
3022
- expect ( combo . valid ) . toEqual ( IgxComboState . INITIAL ) ;
3022
+ expect ( combo . valid ) . toEqual ( IgxInputState . INITIAL ) ;
3023
3023
expect ( combo . comboInput . valid ) . toEqual ( IgxInputState . INITIAL ) ;
3024
3024
const clearButton = fixture . debugElement . query ( By . css ( `.${ CSS_CLASS_CLEARBUTTON } ` ) ) ;
3025
3025
clearButton . triggerEventHandler ( 'click' , UIInteractions . getMouseEvent ( 'click' ) ) ;
3026
3026
fixture . detectChanges ( ) ;
3027
- expect ( combo . valid ) . toEqual ( IgxComboState . INVALID ) ;
3027
+ expect ( combo . valid ) . toEqual ( IgxInputState . INVALID ) ;
3028
3028
expect ( combo . comboInput . valid ) . toEqual ( IgxInputState . INVALID ) ;
3029
3029
3030
3030
combo . onBlur ( ) ;
3031
3031
fixture . detectChanges ( ) ;
3032
- expect ( combo . valid ) . toEqual ( IgxComboState . INVALID ) ;
3032
+ expect ( combo . valid ) . toEqual ( IgxInputState . INVALID ) ;
3033
3033
expect ( combo . comboInput . valid ) . toEqual ( IgxInputState . INVALID ) ;
3034
3034
3035
3035
combo . select ( [ combo . dropdown . items [ 0 ] , combo . dropdown . items [ 1 ] ] ) ;
3036
- expect ( combo . valid ) . toEqual ( IgxComboState . VALID ) ;
3036
+ expect ( combo . valid ) . toEqual ( IgxInputState . VALID ) ;
3037
3037
expect ( combo . comboInput . valid ) . toEqual ( IgxInputState . VALID ) ;
3038
3038
3039
3039
combo . onBlur ( ) ;
3040
3040
fixture . detectChanges ( ) ;
3041
- expect ( combo . valid ) . toEqual ( IgxComboState . INITIAL ) ;
3041
+ expect ( combo . valid ) . toEqual ( IgxInputState . INITIAL ) ;
3042
3042
expect ( combo . comboInput . valid ) . toEqual ( IgxInputState . INITIAL ) ;
3043
3043
} ) ;
3044
3044
it ( 'should properly initialize when used as a form control - without validators' , ( ) => {
@@ -3051,26 +3051,26 @@ describe('igxCombo', () => {
3051
3051
expect ( combo . value ) . toEqual ( comboFormReference . value ) ;
3052
3052
expect ( combo . selection . length ) . toEqual ( 1 ) ;
3053
3053
expect ( combo . selection [ 0 ] . field ) . toEqual ( 'Connecticut' ) ;
3054
- expect ( combo . valid ) . toEqual ( IgxComboState . INITIAL ) ;
3054
+ expect ( combo . valid ) . toEqual ( IgxInputState . INITIAL ) ;
3055
3055
expect ( combo . comboInput . valid ) . toEqual ( IgxInputState . INITIAL ) ;
3056
3056
const clearButton = fixture . debugElement . query ( By . css ( `.${ CSS_CLASS_CLEARBUTTON } ` ) ) ;
3057
3057
clearButton . triggerEventHandler ( 'click' , UIInteractions . getMouseEvent ( 'click' ) ) ;
3058
3058
fixture . detectChanges ( ) ;
3059
- expect ( combo . valid ) . toEqual ( IgxComboState . INITIAL ) ;
3059
+ expect ( combo . valid ) . toEqual ( IgxInputState . INITIAL ) ;
3060
3060
expect ( combo . comboInput . valid ) . toEqual ( IgxInputState . INITIAL ) ;
3061
3061
3062
3062
combo . onBlur ( ) ;
3063
3063
fixture . detectChanges ( ) ;
3064
- expect ( combo . valid ) . toEqual ( IgxComboState . INITIAL ) ;
3064
+ expect ( combo . valid ) . toEqual ( IgxInputState . INITIAL ) ;
3065
3065
expect ( combo . comboInput . valid ) . toEqual ( IgxInputState . INITIAL ) ;
3066
3066
3067
3067
combo . select ( [ combo . dropdown . items [ 0 ] , combo . dropdown . items [ 1 ] ] ) ;
3068
- expect ( combo . valid ) . toEqual ( IgxComboState . INITIAL ) ;
3068
+ expect ( combo . valid ) . toEqual ( IgxInputState . INITIAL ) ;
3069
3069
expect ( combo . comboInput . valid ) . toEqual ( IgxInputState . INITIAL ) ;
3070
3070
3071
3071
combo . onBlur ( ) ;
3072
3072
fixture . detectChanges ( ) ;
3073
- expect ( combo . valid ) . toEqual ( IgxComboState . INITIAL ) ;
3073
+ expect ( combo . valid ) . toEqual ( IgxInputState . INITIAL ) ;
3074
3074
expect ( combo . comboInput . valid ) . toEqual ( IgxInputState . INITIAL ) ;
3075
3075
} ) ;
3076
3076
it ( 'should be possible to be enabled/disabled when used as a form control' , ( ) => {
@@ -3198,32 +3198,32 @@ describe('igxCombo', () => {
3198
3198
inputGroupRequired = fixture . debugElement . query ( By . css ( `.${ CSS_CLASS_INPUTGROUP_REQUIRED } ` ) ) ;
3199
3199
} ) ) ;
3200
3200
it ( 'should properly initialize when used in a template form control' , ( ) => {
3201
- expect ( combo . valid ) . toEqual ( IgxComboState . INITIAL ) ;
3201
+ expect ( combo . valid ) . toEqual ( IgxInputState . INITIAL ) ;
3202
3202
expect ( combo . comboInput . valid ) . toEqual ( IgxInputState . INITIAL ) ;
3203
3203
expect ( inputGroupRequired ) . toBeDefined ( ) ;
3204
3204
combo . onBlur ( ) ;
3205
3205
fixture . detectChanges ( ) ;
3206
- expect ( combo . valid ) . toEqual ( IgxComboState . INVALID ) ;
3206
+ expect ( combo . valid ) . toEqual ( IgxInputState . INVALID ) ;
3207
3207
expect ( combo . comboInput . valid ) . toEqual ( IgxInputState . INVALID ) ;
3208
3208
3209
3209
input . triggerEventHandler ( 'focus' , { } ) ;
3210
3210
combo . selectAllItems ( ) ;
3211
3211
fixture . detectChanges ( ) ;
3212
- expect ( combo . valid ) . toEqual ( IgxComboState . VALID ) ;
3212
+ expect ( combo . valid ) . toEqual ( IgxInputState . VALID ) ;
3213
3213
expect ( combo . comboInput . valid ) . toEqual ( IgxInputState . VALID ) ;
3214
3214
3215
3215
const clearButton = fixture . debugElement . query ( By . css ( `.${ CSS_CLASS_CLEARBUTTON } ` ) ) ;
3216
3216
clearButton . triggerEventHandler ( 'click' , UIInteractions . getMouseEvent ( 'click' ) ) ;
3217
3217
fixture . detectChanges ( ) ;
3218
- expect ( combo . valid ) . toEqual ( IgxComboState . INVALID ) ;
3218
+ expect ( combo . valid ) . toEqual ( IgxInputState . INVALID ) ;
3219
3219
expect ( combo . comboInput . valid ) . toEqual ( IgxInputState . INVALID ) ;
3220
3220
} ) ;
3221
3221
it ( 'should properly init with empty array and handle consecutive model changes' , fakeAsync ( ( ) => {
3222
3222
const model = fixture . debugElement . query ( By . directive ( NgModel ) ) . injector . get ( NgModel ) ;
3223
3223
fixture . componentInstance . values = [ ] ;
3224
3224
fixture . detectChanges ( ) ;
3225
3225
tick ( ) ;
3226
- expect ( combo . valid ) . toEqual ( IgxComboState . INITIAL ) ;
3226
+ expect ( combo . valid ) . toEqual ( IgxInputState . INITIAL ) ;
3227
3227
expect ( combo . comboInput . valid ) . toEqual ( IgxInputState . INITIAL ) ;
3228
3228
expect ( model . valid ) . toBeFalse ( ) ;
3229
3229
expect ( model . dirty ) . toBeFalse ( ) ;
@@ -3232,7 +3232,7 @@ describe('igxCombo', () => {
3232
3232
fixture . componentInstance . values = [ 'Missouri' ] ;
3233
3233
fixture . detectChanges ( ) ;
3234
3234
tick ( ) ;
3235
- expect ( combo . valid ) . toEqual ( IgxComboState . INITIAL ) ;
3235
+ expect ( combo . valid ) . toEqual ( IgxInputState . INITIAL ) ;
3236
3236
expect ( combo . comboInput . valid ) . toEqual ( IgxInputState . INITIAL ) ;
3237
3237
expect ( combo . selection ) . toEqual ( [ { field : 'Missouri' , region : 'West North Central' } ] ) ;
3238
3238
expect ( combo . value ) . toEqual ( [ 'Missouri' ] ) ;
@@ -3242,7 +3242,7 @@ describe('igxCombo', () => {
3242
3242
3243
3243
fixture . componentInstance . values = [ 'Missouri' , 'Missouri' ] ;
3244
3244
fixture . detectChanges ( ) ;
3245
- expect ( combo . valid ) . toEqual ( IgxComboState . INITIAL ) ;
3245
+ expect ( combo . valid ) . toEqual ( IgxInputState . INITIAL ) ;
3246
3246
expect ( combo . comboInput . valid ) . toEqual ( IgxInputState . INITIAL ) ;
3247
3247
expect ( combo . selection ) . toEqual ( [ { field : 'Missouri' , region : 'West North Central' } ] ) ;
3248
3248
expect ( combo . value ) . toEqual ( [ 'Missouri' ] ) ;
@@ -3253,7 +3253,7 @@ describe('igxCombo', () => {
3253
3253
fixture . componentInstance . values = null ;
3254
3254
fixture . detectChanges ( ) ;
3255
3255
tick ( ) ;
3256
- expect ( combo . valid ) . toEqual ( IgxComboState . INITIAL ) ;
3256
+ expect ( combo . valid ) . toEqual ( IgxInputState . INITIAL ) ;
3257
3257
expect ( combo . comboInput . valid ) . toEqual ( IgxInputState . INITIAL ) ;
3258
3258
expect ( combo . selection ) . toEqual ( [ ] ) ;
3259
3259
expect ( combo . value ) . toEqual ( [ ] ) ;
@@ -3264,7 +3264,7 @@ describe('igxCombo', () => {
3264
3264
3265
3265
combo . onBlur ( ) ;
3266
3266
fixture . detectChanges ( ) ;
3267
- expect ( combo . valid ) . toEqual ( IgxComboState . INVALID ) ;
3267
+ expect ( combo . valid ) . toEqual ( IgxInputState . INVALID ) ;
3268
3268
expect ( combo . comboInput . valid ) . toEqual ( IgxInputState . INVALID ) ;
3269
3269
expect ( model . valid ) . toBeFalse ( ) ;
3270
3270
expect ( model . touched ) . toBeTrue ( ) ;
@@ -3273,7 +3273,7 @@ describe('igxCombo', () => {
3273
3273
fixture . componentInstance . values = [ 'New Jersey' ] ;
3274
3274
fixture . detectChanges ( ) ;
3275
3275
tick ( ) ;
3276
- expect ( combo . valid ) . toEqual ( IgxComboState . INITIAL ) ;
3276
+ expect ( combo . valid ) . toEqual ( IgxInputState . INITIAL ) ;
3277
3277
expect ( combo . comboInput . valid ) . toEqual ( IgxInputState . INITIAL ) ;
3278
3278
expect ( combo . selection ) . toEqual ( [ { field : 'New Jersey' , region : 'Mid-Atlan' } ] ) ;
3279
3279
expect ( combo . value ) . toEqual ( [ 'New Jersey' ] ) ;
@@ -3292,12 +3292,12 @@ describe('igxCombo', () => {
3292
3292
it ( 'should set validity to initial when the form is reset' , fakeAsync ( ( ) => {
3293
3293
combo . onBlur ( ) ;
3294
3294
fixture . detectChanges ( ) ;
3295
- expect ( combo . valid ) . toEqual ( IgxComboState . INVALID ) ;
3295
+ expect ( combo . valid ) . toEqual ( IgxInputState . INVALID ) ;
3296
3296
expect ( combo . comboInput . valid ) . toEqual ( IgxInputState . INVALID ) ;
3297
3297
3298
3298
fixture . componentInstance . form . resetForm ( ) ;
3299
3299
tick ( ) ;
3300
- expect ( combo . valid ) . toEqual ( IgxComboState . INITIAL ) ;
3300
+ expect ( combo . valid ) . toEqual ( IgxInputState . INITIAL ) ;
3301
3301
expect ( combo . comboInput . valid ) . toEqual ( IgxInputState . INITIAL ) ;
3302
3302
} ) ) ;
3303
3303
} ) ;
0 commit comments