@@ -286,7 +286,6 @@ describe('MatSelect', () => {
286
286
287
287
const event = dispatchKeyboardEvent ( trigger , 'keydown' , HOME ) ;
288
288
fixture . detectChanges ( ) ;
289
- tick ( ) ;
290
289
291
290
expect ( fixture . componentInstance . select . _keyManager . activeItemIndex ) . toBe ( 0 ) ;
292
291
expect ( event . defaultPrevented ) . toBe ( true ) ;
@@ -302,7 +301,6 @@ describe('MatSelect', () => {
302
301
303
302
const event = dispatchKeyboardEvent ( trigger , 'keydown' , END ) ;
304
303
fixture . detectChanges ( ) ;
305
- tick ( ) ;
306
304
307
305
expect ( fixture . componentInstance . select . _keyManager . activeItemIndex ) . toBe ( 7 ) ;
308
306
expect ( event . defaultPrevented ) . toBe ( true ) ;
@@ -2037,25 +2035,20 @@ describe('MatSelect', () => {
2037
2035
expect ( formControl . value ) . toBeFalsy ( 'Expected no initial value.' ) ;
2038
2036
2039
2037
dispatchKeyboardEvent ( select , 'keydown' , DOWN_ARROW ) ;
2040
- tick ( ) ;
2041
2038
2042
2039
expect ( options [ 0 ] . selected ) . toBe ( true , 'Expected first option to be selected.' ) ;
2043
2040
expect ( formControl . value ) . toBe ( options [ 0 ] . value ,
2044
2041
'Expected value from first option to have been set on the model.' ) ;
2045
2042
2046
2043
dispatchKeyboardEvent ( select , 'keydown' , DOWN_ARROW ) ;
2047
- tick ( ) ;
2048
-
2049
2044
dispatchKeyboardEvent ( select , 'keydown' , DOWN_ARROW ) ;
2050
- tick ( ) ;
2051
2045
2052
2046
// Note that the third option is skipped, because it is disabled.
2053
2047
expect ( options [ 3 ] . selected ) . toBe ( true , 'Expected fourth option to be selected.' ) ;
2054
2048
expect ( formControl . value ) . toBe ( options [ 3 ] . value ,
2055
2049
'Expected value from fourth option to have been set on the model.' ) ;
2056
2050
2057
2051
dispatchKeyboardEvent ( select , 'keydown' , UP_ARROW ) ;
2058
- tick ( ) ;
2059
2052
2060
2053
expect ( options [ 1 ] . selected ) . toBe ( true , 'Expected second option to be selected.' ) ;
2061
2054
expect ( formControl . value ) . toBe ( options [ 1 ] . value ,
@@ -2089,7 +2082,6 @@ describe('MatSelect', () => {
2089
2082
expect ( formControl . pristine ) . toBe ( true , 'Expected form control to be clean.' ) ;
2090
2083
2091
2084
dispatchKeyboardEvent ( select , 'keydown' , 16 ) ; // Press a random key.
2092
- tick ( ) ;
2093
2085
2094
2086
expect ( formControl . value ) . toBeNull ( 'Expected form control value to stay empty.' ) ;
2095
2087
expect ( formControl . pristine ) . toBe ( true , 'Expected form control to stay clean.' ) ;
@@ -2101,10 +2093,8 @@ describe('MatSelect', () => {
2101
2093
2102
2094
formControl . setValue ( 'eggs-5' ) ;
2103
2095
fixture . detectChanges ( ) ;
2104
- tick ( ) ;
2105
2096
2106
2097
dispatchKeyboardEvent ( select , 'keydown' , DOWN_ARROW ) ;
2107
- tick ( ) ;
2108
2098
2109
2099
expect ( formControl . value ) . toBe ( 'pasta-6' ) ;
2110
2100
expect ( fixture . componentInstance . options . toArray ( ) [ 6 ] . selected ) . toBe ( true ) ;
@@ -2141,7 +2131,6 @@ describe('MatSelect', () => {
2141
2131
formControl . disable ( ) ;
2142
2132
2143
2133
dispatchKeyboardEvent ( select , 'keydown' , DOWN_ARROW ) ;
2144
- tick ( ) ;
2145
2134
2146
2135
expect ( formControl . value ) . toBe ( 'eggs-5' , 'Expected value to remain unchaged.' ) ;
2147
2136
} ) ) ;
@@ -2151,13 +2140,11 @@ describe('MatSelect', () => {
2151
2140
2152
2141
fixture . componentInstance . options . forEach ( ( ) => {
2153
2142
dispatchKeyboardEvent ( select , 'keydown' , DOWN_ARROW ) ;
2154
- tick ( ) ;
2155
2143
} ) ;
2156
2144
2157
2145
expect ( lastOption . selected ) . toBe ( true , 'Expected last option to be selected.' ) ;
2158
2146
2159
2147
dispatchKeyboardEvent ( select , 'keydown' , DOWN_ARROW ) ;
2160
- tick ( ) ;
2161
2148
2162
2149
expect ( lastOption . selected ) . toBe ( true , 'Expected last option to stay selected.' ) ;
2163
2150
} ) ) ;
@@ -2190,7 +2177,6 @@ describe('MatSelect', () => {
2190
2177
const subscription = map . call ( option . onSelectionChange , e => e . isUserInput ) . subscribe ( spy ) ;
2191
2178
2192
2179
dispatchKeyboardEvent ( select , 'keydown' , DOWN_ARROW ) ;
2193
- tick ( ) ;
2194
2180
expect ( spy ) . toHaveBeenCalledWith ( true ) ;
2195
2181
2196
2182
subscription . unsubscribe ( ) ;
@@ -2269,14 +2255,12 @@ describe('MatSelect', () => {
2269
2255
2270
2256
[ 1 , 2 , 3 ] . forEach ( ( ) => {
2271
2257
dispatchKeyboardEvent ( host , 'keydown' , DOWN_ARROW ) ;
2272
- tick ( ) ;
2273
2258
fixture . detectChanges ( ) ;
2274
2259
} ) ;
2275
2260
2276
2261
expect ( host . getAttribute ( 'aria-activedescendant' ) ) . toBe ( options [ 4 ] . id ) ;
2277
2262
2278
2263
dispatchKeyboardEvent ( host , 'keydown' , UP_ARROW ) ;
2279
- tick ( ) ;
2280
2264
fixture . detectChanges ( ) ;
2281
2265
2282
2266
expect ( host . getAttribute ( 'aria-activedescendant' ) ) . toBe ( options [ 3 ] . id ) ;
@@ -2561,7 +2545,6 @@ describe('MatSelect', () => {
2561
2545
fakeAsync ( ( ) => {
2562
2546
const select = fixture . debugElement . query ( By . css ( 'mat-select' ) ) . nativeElement ;
2563
2547
dispatchKeyboardEvent ( select , 'keydown' , DOWN_ARROW ) ;
2564
- tick ( ) ;
2565
2548
2566
2549
expect ( fixture . componentInstance . changeListener ) . toHaveBeenCalledTimes ( 1 ) ;
2567
2550
} ) ) ;
@@ -3155,18 +3138,14 @@ describe('MatSelect', () => {
3155
3138
} ) ;
3156
3139
} ) ) ;
3157
3140
3158
- } ) ;
3159
-
3160
- describe ( 'when using a non-function comparator' , ( ) => {
3161
- beforeEach ( ( ) => {
3141
+ it ( 'should throw an error when using a non-function comparator' , ( ) => {
3162
3142
instance . useNullComparator ( ) ;
3163
- } ) ;
3164
3143
3165
- it ( 'should throw an error' , ( ) => {
3166
3144
expect ( ( ) => {
3167
3145
fixture . detectChanges ( ) ;
3168
3146
} ) . toThrowError ( wrappedErrorMessage ( getMatSelectNonFunctionValueError ( ) ) ) ;
3169
3147
} ) ;
3148
+
3170
3149
} ) ;
3171
3150
} ) ;
3172
3151
@@ -3198,8 +3177,6 @@ describe('MatSelect', () => {
3198
3177
3199
3178
[ 1 , 2 , 3 ] . forEach ( ( ) => {
3200
3179
dispatchKeyboardEvent ( host , 'keydown' , DOWN_ARROW ) ;
3201
- tick ( ) ;
3202
- fixture . detectChanges ( ) ;
3203
3180
} ) ;
3204
3181
3205
3182
expect ( panel . scrollTop ) . toBe ( initialScrollPosition , 'Expected scroll position not to change' ) ;
@@ -3208,8 +3185,6 @@ describe('MatSelect', () => {
3208
3185
it ( 'should scroll down to the active option' , fakeAsync ( ( ) => {
3209
3186
for ( let i = 0 ; i < 15 ; i ++ ) {
3210
3187
dispatchKeyboardEvent ( host , 'keydown' , DOWN_ARROW ) ;
3211
- tick ( ) ;
3212
- fixture . detectChanges ( ) ;
3213
3188
}
3214
3189
3215
3190
// <option index * height> - <panel height> = 16 * 48 - 256 = 512
@@ -3220,14 +3195,10 @@ describe('MatSelect', () => {
3220
3195
// Scroll to the bottom.
3221
3196
for ( let i = 0 ; i < fixture . componentInstance . foods . length ; i ++ ) {
3222
3197
dispatchKeyboardEvent ( host , 'keydown' , DOWN_ARROW ) ;
3223
- tick ( ) ;
3224
- fixture . detectChanges ( ) ;
3225
3198
}
3226
3199
3227
3200
for ( let i = 0 ; i < 20 ; i ++ ) {
3228
3201
dispatchKeyboardEvent ( host , 'keydown' , UP_ARROW ) ;
3229
- tick ( ) ;
3230
- fixture . detectChanges ( ) ;
3231
3202
}
3232
3203
3233
3204
// <option index * height> = 9 * 48 = 432
@@ -3250,8 +3221,6 @@ describe('MatSelect', () => {
3250
3221
3251
3222
for ( let i = 0 ; i < 5 ; i ++ ) {
3252
3223
dispatchKeyboardEvent ( host , 'keydown' , DOWN_ARROW ) ;
3253
- tick ( ) ;
3254
- groupFixture . detectChanges ( ) ;
3255
3224
}
3256
3225
3257
3226
// Note that we press down 5 times, but it will skip
0 commit comments