Skip to content

Commit 601fd45

Browse files
natiginfogithub-actions[bot]
authored andcommitted
[maps-android] fix ignored tests (#11844)
GitOrigin-RevId: 90d03defbbab7a17aa811cdd2918c729f2473660
1 parent 4840dcc commit 601fd45

File tree

4 files changed

+3
-7
lines changed

4 files changed

+3
-7
lines changed

app/src/androidTest/java/com/mapbox/maps/testapp/gestures/GestureActivityTest.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import org.junit.Assert.assertEquals
1818
import org.junit.Assert.assertNotEquals
1919
import org.junit.Assert.assertTrue
2020
import org.junit.Before
21-
import org.junit.Ignore
2221
import org.junit.Test
2322
import org.junit.runner.RunWith
2423
import java.util.concurrent.CountDownLatch
@@ -308,7 +307,6 @@ class GestureActivityTest : BaseMapTest() {
308307
}
309308

310309
@Test
311-
@Ignore("Flaky test, expected:<3.0> but was:<2.8510000000000004>")
312310
fun quickZoom_roundTripping() {
313311
rule.scenario.onActivity {
314312
it.runOnUiThread {

app/src/androidTest/java/com/mapbox/maps/testapp/integration/surface/MapViewSurfaceModeWithRecyclerViewTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import androidx.test.uiautomator.UiObject2
1515
import com.mapbox.maps.testapp.examples.SurfaceRecyclerViewActivity
1616
import com.mapbox.maps.testapp.integration.BaseReuseIntegrationTest
1717
import org.hamcrest.core.Is
18-
import org.junit.Ignore
1918
import org.junit.Test
2019
import org.junit.runner.RunWith
2120

@@ -28,13 +27,14 @@ class MapViewSurfaceModeWithRecyclerViewTest : BaseReuseIntegrationTest(SurfaceR
2827

2928
@Test
3029
@LargeTest
31-
@Ignore("Flaky test")
3230
fun scrollSurfaceRecyclerView() {
3331
// wait extra seconds to make sure recycler view is indeed added to hierarchy
3432
Thread.sleep(2_000)
3533
device.waitForIdle()
3634
val recyclerObject = By.clazz(RecyclerView::class.java)
3735
val recyclerView: UiObject2 = device.findObject(recyclerObject)
36+
// we set gesture margin to keep touches at least 100 pixels away from the edges
37+
recyclerView.setGestureMargin(100)
3838
repeat(2) {
3939
onMapView(matches(isDisplayed()))
4040
recyclerView.scroll(Direction.DOWN, 100.0f)

app/src/androidTest/java/com/mapbox/maps/testapp/overlay/MapOverlayPluginTest.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import com.mapbox.maps.plugin.overlay.mapboxOverlay
1010
import com.mapbox.maps.testapp.BaseMapTest
1111
import junit.framework.Assert.*
1212
import org.junit.Before
13-
import org.junit.Ignore
1413
import org.junit.Test
1514

1615
/**
@@ -40,7 +39,6 @@ class MapOverlayPluginTest : BaseMapTest() {
4039
}
4140

4241
@Test
43-
@Ignore("flaky test, expected:<[top: 50.0, left: 0.0, bottom: 0.0, right: 0.0]> but was:<[top: 0.0, left: 20.0, bottom: 0.0, right: 0.0]>")
4442
fun registerOverlay() {
4543
var edgeInsets = mapOverlayPlugin.getEdgeInsets()
4644
assertEquals(

plugin-overlay/src/main/java/com/mapbox/maps/plugin/overlay/MapOverlayPluginImpl.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ internal class MapOverlayPluginImpl : MapOverlayPlugin {
190190
if (it.left - subMapRect.left < subMapRect.right - it.right) {
191191
// overlay rect is on the left part of MapRect, create a new MapRect with the right part
192192
queue.offerLast(subMapRect.updateLeft(it.right))
193-
} else if (it.left - subMapRect.left < subMapRect.right - it.right) {
193+
} else if (it.left - subMapRect.left > subMapRect.right - it.right) {
194194
// overlay rect is on the right part of MapRect, create a new MapRect with the left part
195195
queue.offerLast(subMapRect.updateRight(it.left))
196196
} else {

0 commit comments

Comments
 (0)