@ -18,6 +18,7 @@
* /
* /
package org.isoron.uhabits.activities.common.views
package org.isoron.uhabits.activities.common.views
import android.view.MotionEvent
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.MediumTest
import androidx.test.filters.MediumTest
import org.isoron.uhabits.BaseViewTest
import org.isoron.uhabits.BaseViewTest
@ -52,7 +53,12 @@ class FrequencyChartTest : BaseViewTest() {
@Test
@Test
@Throws ( Throwable :: class )
@Throws ( Throwable :: class )
fun testRender _withDataOffset ( ) {
fun testRender _withDataOffset ( ) {
view . onScroll ( null , null , - dpToPixels ( 150 ) , 0f )
view . onScroll (
MotionEvent . obtain ( 0L , 0L , MotionEvent . ACTION _SCROLL , 0f , 0f , 0 ) ,
MotionEvent . obtain ( 0L , 0L , MotionEvent . ACTION _SCROLL , 0f , 0f , 0 ) ,
- dpToPixels ( 150 ) ,
0f
)
view . invalidate ( )
view . invalidate ( )
assertRenders ( view , BASE _PATH + " renderDataOffset.png " )
assertRenders ( view , BASE _PATH + " renderDataOffset.png " )
}
}