@Test public void testScrollToWithTwoArguments() { final Element target = mock(Element.class); final Element container = mock(Element.class); doNothing().when(scrollHelper).scrollTo(any(), any(), anyInt()); scrollHelper.scrollTo(target, container); verify(scrollHelper).scrollTo(target, container, 0); }
public void scrollTo(final Element target, final Element container, final int padding) { final double targetOffsetTop = ((HTMLElement) target).offsetTop; final double containerOffsetTop = ((HTMLElement) container).offsetTop; container.scrollTop = targetOffsetTop - containerOffsetTop - padding; }
ScrollHelper { public void scrollTo(final Element target, final Element container, final int padding) { final double targetOffsetTop = ((HTMLElement) target).offsetTop; final double containerOffsetTop = ((HTMLElement) container).offsetTop; container.scrollTop = targetOffsetTop - containerOffsetTop - padding; } }
ScrollHelper { public void scrollTo(final Element target, final Element container, final int padding) { final double targetOffsetTop = ((HTMLElement) target).offsetTop; final double containerOffsetTop = ((HTMLElement) container).offsetTop; container.scrollTop = targetOffsetTop - containerOffsetTop - padding; }  }
ScrollHelper { public void scrollTo(final Element target, final Element container, final int padding) { final double targetOffsetTop = ((HTMLElement) target).offsetTop; final double containerOffsetTop = ((HTMLElement) container).offsetTop; container.scrollTop = targetOffsetTop - containerOffsetTop - padding; }  void animatedScrollToBottom(final Element element); void scrollToBottom(final Element element); void scrollTo(final Element target,
                         final Element container,
                         final int padding); void scrollTo(final Element target,
                         final Element container); }
ScrollHelper { public void scrollTo(final Element target, final Element container, final int padding) { final double targetOffsetTop = ((HTMLElement) target).offsetTop; final double containerOffsetTop = ((HTMLElement) container).offsetTop; container.scrollTop = targetOffsetTop - containerOffsetTop - padding; }  void animatedScrollToBottom(final Element element); void scrollToBottom(final Element element); void scrollTo(final Element target,
                         final Element container,
                         final int padding); void scrollTo(final Element target,
                         final Element container);  }