use of io.github.hidroh.materialistic.test.shadow.ShadowNestedScrollView in project materialistic by hidroh.
the class WebFragmentTest method testScroll.
@Config(shadows = ShadowNestedScrollView.class)
@Test
public void testScroll() {
ShadowNestedScrollView shadowScrollView = customShadowOf((NestedScrollView) activity.findViewById(R.id.nested_scroll_view));
WebFragment fragment = (WebFragment) activity.getSupportFragmentManager().findFragmentByTag(WebFragment.class.getName());
fragment.scrollToNext();
assertThat(shadowScrollView.getLastScrollDirection()).isEqualTo(View.FOCUS_DOWN);
fragment.scrollToPrevious();
assertThat(shadowScrollView.getLastScrollDirection()).isEqualTo(View.FOCUS_UP);
fragment.scrollToTop();
assertThat(shadowScrollView.getSmoothScrollY()).isEqualTo(0);
}
Aggregations