From 8881a1f485ca3498c06a3da227d1762e5706be4a Mon Sep 17 00:00:00 2001 From: Asaf Korem Date: Wed, 27 Sep 2023 16:44:27 +0300 Subject: [PATCH] fix(MaterialSliderHelper): return float value, not double. --- .../com/wix/detox/espresso/common/MaterialSliderHelper.kt | 4 ++-- .../com/wix/detox/espresso/common/MaterialSliderHelperTest.kt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/detox/android/detox/src/full/java/com/wix/detox/espresso/common/MaterialSliderHelper.kt b/detox/android/detox/src/full/java/com/wix/detox/espresso/common/MaterialSliderHelper.kt index 8ba28680db..479ac09c82 100644 --- a/detox/android/detox/src/full/java/com/wix/detox/espresso/common/MaterialSliderHelper.kt +++ b/detox/android/detox/src/full/java/com/wix/detox/espresso/common/MaterialSliderHelper.kt @@ -7,7 +7,7 @@ import org.joor.Reflect private const val CLASS_MATERIAL_SLIDER = "com.google.android.material.slider.Slider" open class MaterialSliderHelper(protected val view: View) { - fun getValueIfSlider(): Double? { + fun getValueIfSlider(): Float? { if (!isSlider()) { return null } @@ -17,5 +17,5 @@ open class MaterialSliderHelper(protected val view: View) { private fun isSlider() = ReflectUtils.isAssignableFrom(view, CLASS_MATERIAL_SLIDER) - private fun getValue() = Reflect.on(view).call("getValue").get() as Double + private fun getValue() = Reflect.on(view).call("getValue").get() as Float } diff --git a/detox/android/detox/src/testFull/java/com/wix/detox/espresso/common/MaterialSliderHelperTest.kt b/detox/android/detox/src/testFull/java/com/wix/detox/espresso/common/MaterialSliderHelperTest.kt index ba60b2ea0a..8466ec4bc0 100644 --- a/detox/android/detox/src/testFull/java/com/wix/detox/espresso/common/MaterialSliderHelperTest.kt +++ b/detox/android/detox/src/testFull/java/com/wix/detox/espresso/common/MaterialSliderHelperTest.kt @@ -19,7 +19,7 @@ class MaterialSliderHelperTest { val uut = MaterialSliderHelper(slider) - assertThat(uut.getValueIfSlider()).isEqualTo(0.2) + assertThat(uut.getValueIfSlider()).isEqualTo(0.2f) } @Test