@@ -2237,9 +2237,8 @@ describe('MDC-based MatSelect', () => {
2237
2237
dispatchKeyboardEvent ( host , 'keydown' , DOWN_ARROW ) ;
2238
2238
}
2239
2239
2240
- // <top padding> + <option index * height> - <panel height> = 8 + 16 * 48 - 256 = 520
2241
- // <top padding> + <option index * height> - <panel height> = 8 + 16 * 48 - 256 = 520
2242
- expect ( panel . scrollTop ) . withContext ( 'Expected scroll to be at the 16th option.' ) . toBe ( 520 ) ;
2240
+ // <top padding> + <option index * height> - <panel height> = 8 + 16 * 48 - 275 = 501
2241
+ expect ( panel . scrollTop ) . withContext ( 'Expected scroll to be at the 16th option.' ) . toBe ( 501 ) ;
2243
2242
} ) ) ;
2244
2243
2245
2244
it ( 'should scroll up to the active option' , fakeAsync ( ( ) => {
@@ -2252,7 +2251,6 @@ describe('MDC-based MatSelect', () => {
2252
2251
dispatchKeyboardEvent ( host , 'keydown' , UP_ARROW ) ;
2253
2252
}
2254
2253
2255
- // <top padding> + <option index * height> = 8 + 9 * 48 = 440
2256
2254
// <top padding> + <option index * height> = 8 + 9 * 48 = 440
2257
2255
expect ( panel . scrollTop ) . withContext ( 'Expected scroll to be at the 9th option.' ) . toBe ( 440 ) ;
2258
2256
} ) ) ;
@@ -2277,12 +2275,8 @@ describe('MDC-based MatSelect', () => {
2277
2275
// Note that we press down 5 times, but it will skip
2278
2276
// 3 options because the second group is disabled.
2279
2277
// <top padding> + <(option index + group labels) * height> - <panel height> =
2280
- // 8 + (9 + 3) * 48 - 256 = 328
2281
- // Note that we press down 5 times, but it will skip
2282
- // 3 options because the second group is disabled.
2283
- // <top padding> + <(option index + group labels) * height> - <panel height> =
2284
- // 8 + (9 + 3) * 48 - 256 = 328
2285
- expect ( panel . scrollTop ) . withContext ( 'Expected scroll to be at the 9th option.' ) . toBe ( 328 ) ;
2278
+ // 8 + (9 + 3) * 48 - 275 = 309
2279
+ expect ( panel . scrollTop ) . withContext ( 'Expected scroll to be at the 9th option.' ) . toBe ( 309 ) ;
2286
2280
} ) ) ;
2287
2281
2288
2282
it ( 'should scroll to the top when pressing HOME' , fakeAsync ( ( ) => {
@@ -2298,7 +2292,6 @@ describe('MDC-based MatSelect', () => {
2298
2292
dispatchKeyboardEvent ( host , 'keydown' , HOME ) ;
2299
2293
fixture . detectChanges ( ) ;
2300
2294
2301
- // 8px is the top padding of the panel.
2302
2295
// 8px is the top padding of the panel.
2303
2296
expect ( panel . scrollTop ) . withContext ( 'Expected panel to be scrolled to the top' ) . toBe ( 8 ) ;
2304
2297
} ) ) ;
@@ -2308,12 +2301,10 @@ describe('MDC-based MatSelect', () => {
2308
2301
fixture . detectChanges ( ) ;
2309
2302
2310
2303
// <top padding> + <option amount> * <option height> - <panel height> =
2311
- // 8 + 30 * 48 - 256 = 1192
2312
- // <top padding> + <option amount> * <option height> - <panel height> =
2313
- // 8 + 30 * 48 - 256 = 1192
2304
+ // 8 + 30 * 48 - 275 = 1173
2314
2305
expect ( panel . scrollTop )
2315
2306
. withContext ( 'Expected panel to be scrolled to the bottom' )
2316
- . toBe ( 1192 ) ;
2307
+ . toBe ( 1173 ) ;
2317
2308
} ) ) ;
2318
2309
2319
2310
it ( 'should scroll to the active option when typing' , fakeAsync ( ( ) => {
@@ -2325,9 +2316,8 @@ describe('MDC-based MatSelect', () => {
2325
2316
}
2326
2317
flush ( ) ;
2327
2318
2328
- // <top padding> + <option index * height> - <panel height> = 8 + 16 * 48 - 256 = 520
2329
- // <top padding> + <option index * height> - <panel height> = 8 + 16 * 48 - 256 = 520
2330
- expect ( panel . scrollTop ) . withContext ( 'Expected scroll to be at the 16th option.' ) . toBe ( 520 ) ;
2319
+ // <top padding> + <option index * height> - <panel height> = 8 + 16 * 48 - 275 = 501
2320
+ expect ( panel . scrollTop ) . withContext ( 'Expected scroll to be at the 16th option.' ) . toBe ( 501 ) ;
2331
2321
} ) ) ;
2332
2322
2333
2323
it ( 'should scroll to top when going to first option in top group' , fakeAsync ( ( ) => {
0 commit comments