@@ -8,6 +8,9 @@ async function customizeFixture({ initialPosition, monthScrollerItems, monthScro
88 const overlay = fixtureSync ( `<vaadin-date-picker-overlay-content></vaadin-date-picker-overlay-content>` ) ;
99 await untilOverlayScrolled ( overlay ) ;
1010 const monthScroller = overlay . _monthScroller ;
11+ // Pin item height to a clean integer pixel value so percentage-based buffer
12+ // offsets resolve to whole pixels and revealDate position math stays exact.
13+ monthScroller . style . setProperty ( '--vaadin-infinite-scroller-item-height' , '270px' ) ;
1114 monthScroller . style . setProperty ( '--vaadin-infinite-scroller-buffer-offset' , monthScrollerOffset ) ;
1215 monthScroller . style . height = `${ 270 * monthScrollerItems } px` ;
1316 overlay . i18n = getDefaultI18n ( ) ;
@@ -426,8 +429,7 @@ describe('overlay', () => {
426429 it ( 'should scroll when the month is below the visible area' , ( ) => {
427430 const position = monthScroller . position ;
428431 overlay . revealDate ( new Date ( 2021 , 3 , 1 ) , false ) ;
429- // FIXME: fails with base styles: "expected -51.04545454545455 to equal -51"
430- expect ( monthScroller . position ) . to . be . closeTo ( position + 1 , 0.1 ) ;
432+ expect ( monthScroller . position ) . to . equal ( position + 1 ) ;
431433 } ) ;
432434 } ) ;
433435
@@ -456,8 +458,7 @@ describe('overlay', () => {
456458 it ( 'should scroll when the month is below the visible area' , ( ) => {
457459 const position = monthScroller . position ;
458460 overlay . revealDate ( new Date ( 2021 , 3 , 1 ) , false ) ;
459- // FIXME: fails with base styles: "expected -51.45454545454545 to equal -51.4"
460- expect ( monthScroller . position ) . to . be . closeTo ( position + 0.6 , 0.1 /* The bottom 10% offset is ensured by JS */ ) ;
461+ expect ( monthScroller . position ) . to . equal ( position + 0.6 /* The bottom 10% offset is ensured by JS */ ) ;
461462 } ) ;
462463 } ) ;
463464 } ) ;
0 commit comments