mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 21:03:54 +01:00
* Fix #5182 Switch From Mapbox to MapLibre * Fix #5182 Switch From Mapbox to MapLibre - Resolved requestFeature() issue * Fix #5182 Switch From Mapbox to MapLibre - Resolved dark mode issue on two screens * Fix #5182 Switch From Mapbox to MapLibre - Resolved dark mode issue on additional screens * Fix #5182 Switch From Mapbox to MapLibre - Resolved dark mode issue on notification screen * Fix #5182 Switch From Mapbox to MapLibre - Test errors
This commit is contained in:
parent
2989b73dee
commit
8f8dcc0d52
27 changed files with 63 additions and 77 deletions
|
|
@ -10,6 +10,7 @@ import androidx.appcompat.widget.AppCompatTextView
|
|||
import com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
import com.mapbox.mapboxsdk.camera.CameraPosition
|
||||
import com.mapbox.mapboxsdk.camera.CameraUpdateFactory
|
||||
import com.mapbox.mapboxsdk.exceptions.MapboxConfigurationException
|
||||
import com.mapbox.mapboxsdk.geometry.LatLng
|
||||
import com.mapbox.mapboxsdk.maps.MapboxMap
|
||||
import com.mapbox.mapboxsdk.maps.Style
|
||||
|
|
@ -24,6 +25,7 @@ import fr.free.nrw.commons.kvstore.JsonKvStore
|
|||
import fr.free.nrw.commons.upload.mediaDetails.UploadMediaDetailFragment.LAST_LOCATION
|
||||
import fr.free.nrw.commons.upload.mediaDetails.UploadMediaDetailFragment.LAST_ZOOM
|
||||
import org.junit.Assert
|
||||
import org.junit.Assert.*
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
|
|
@ -37,6 +39,7 @@ import org.robolectric.RuntimeEnvironment
|
|||
import org.robolectric.Shadows
|
||||
import org.robolectric.annotation.Config
|
||||
import org.robolectric.annotation.LooperMode
|
||||
import java.lang.reflect.InvocationTargetException
|
||||
import java.lang.reflect.Method
|
||||
|
||||
@RunWith(RobolectricTestRunner::class)
|
||||
|
|
@ -136,7 +139,17 @@ class LocationPickerActivityUnitTests {
|
|||
MapboxMap::class.java
|
||||
)
|
||||
method.isAccessible = true
|
||||
method.invoke(activity, mapboxMap)
|
||||
try {
|
||||
method.invoke(activity, mapboxMap)
|
||||
fail("Expected an exception to be thrown")
|
||||
} catch (e: InvocationTargetException) {
|
||||
assertTrue(e.targetException is MapboxConfigurationException)
|
||||
assertEquals(
|
||||
"\nUsing MapView requires calling Mapbox.getInstance(Context context, String apiKey,"
|
||||
+ " WellKnownTileServer wellKnownTileServer) before inflating or creating the view.",
|
||||
e.targetException.message
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -234,9 +247,9 @@ class LocationPickerActivityUnitTests {
|
|||
method.isAccessible = true
|
||||
method.invoke(activity)
|
||||
verify(applicationKvStore, times(1))
|
||||
.putString(LAST_LOCATION, position.target.latitude.toString()
|
||||
.putString(LAST_LOCATION, position.target!!.latitude.toString()
|
||||
+ ","
|
||||
+ position.target.longitude
|
||||
+ position.target!!.longitude
|
||||
)
|
||||
verify(applicationKvStore, times(1))
|
||||
.putString(LAST_ZOOM, position.zoom.toString())
|
||||
|
|
|
|||
|
|
@ -98,17 +98,6 @@ class SettingsFragmentUnitTests {
|
|||
method.invoke(fragment)
|
||||
}
|
||||
|
||||
@Test
|
||||
@Throws(Exception::class)
|
||||
fun testTelemetryOptInOut() {
|
||||
val method: Method = SettingsFragment::class.java.getDeclaredMethod(
|
||||
"telemetryOptInOut",
|
||||
Boolean::class.java
|
||||
)
|
||||
method.isAccessible = true
|
||||
method.invoke(fragment, true)
|
||||
}
|
||||
|
||||
@Test
|
||||
@Throws(Exception::class)
|
||||
fun testCheckPermissionsAndSendLogs() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue