@@ -2237,9 +2237,8 @@ describe('MDC-based MatSelect', () => {
22372237 dispatchKeyboardEvent ( host , 'keydown' , DOWN_ARROW ) ;
22382238 }
22392239
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 ) ;
22432242 } ) ) ;
22442243
22452244 it ( 'should scroll up to the active option' , fakeAsync ( ( ) => {
@@ -2252,7 +2251,6 @@ describe('MDC-based MatSelect', () => {
22522251 dispatchKeyboardEvent ( host , 'keydown' , UP_ARROW ) ;
22532252 }
22542253
2255- // <top padding> + <option index * height> = 8 + 9 * 48 = 440
22562254 // <top padding> + <option index * height> = 8 + 9 * 48 = 440
22572255 expect ( panel . scrollTop ) . withContext ( 'Expected scroll to be at the 9th option.' ) . toBe ( 440 ) ;
22582256 } ) ) ;
@@ -2277,12 +2275,8 @@ describe('MDC-based MatSelect', () => {
22772275 // Note that we press down 5 times, but it will skip
22782276 // 3 options because the second group is disabled.
22792277 // <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 ) ;
22862280 } ) ) ;
22872281
22882282 it ( 'should scroll to the top when pressing HOME' , fakeAsync ( ( ) => {
@@ -2298,7 +2292,6 @@ describe('MDC-based MatSelect', () => {
22982292 dispatchKeyboardEvent ( host , 'keydown' , HOME ) ;
22992293 fixture . detectChanges ( ) ;
23002294
2301- // 8px is the top padding of the panel.
23022295 // 8px is the top padding of the panel.
23032296 expect ( panel . scrollTop ) . withContext ( 'Expected panel to be scrolled to the top' ) . toBe ( 8 ) ;
23042297 } ) ) ;
@@ -2308,12 +2301,10 @@ describe('MDC-based MatSelect', () => {
23082301 fixture . detectChanges ( ) ;
23092302
23102303 // <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
23142305 expect ( panel . scrollTop )
23152306 . withContext ( 'Expected panel to be scrolled to the bottom' )
2316- . toBe ( 1192 ) ;
2307+ . toBe ( 1173 ) ;
23172308 } ) ) ;
23182309
23192310 it ( 'should scroll to the active option when typing' , fakeAsync ( ( ) => {
@@ -2325,9 +2316,8 @@ describe('MDC-based MatSelect', () => {
23252316 }
23262317 flush ( ) ;
23272318
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 ) ;
23312321 } ) ) ;
23322322
23332323 it ( 'should scroll to top when going to first option in top group' , fakeAsync ( ( ) => {
0 commit comments