From 697fffbc9935ff689d768797e333c7d4ed179fb6 Mon Sep 17 00:00:00 2001 From: KristianTashkov Date: Sun, 12 Sep 2021 13:50:27 +0300 Subject: [PATCH] fix tests --- .../activities/habits/list/views/NumberButtonViewTest.kt | 5 ++++- .../activities/habits/list/views/NumberPanelViewTest.kt | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/uhabits-android/src/androidTest/java/org/isoron/uhabits/activities/habits/list/views/NumberButtonViewTest.kt b/uhabits-android/src/androidTest/java/org/isoron/uhabits/activities/habits/list/views/NumberButtonViewTest.kt index 6f1923aaa..c06aa5fb3 100644 --- a/uhabits-android/src/androidTest/java/org/isoron/uhabits/activities/habits/list/views/NumberButtonViewTest.kt +++ b/uhabits-android/src/androidTest/java/org/isoron/uhabits/activities/habits/list/views/NumberButtonViewTest.kt @@ -24,6 +24,7 @@ import androidx.test.filters.MediumTest import org.hamcrest.CoreMatchers.equalTo import org.hamcrest.MatcherAssert.assertThat import org.isoron.uhabits.BaseViewTest +import org.isoron.uhabits.core.models.NumericalHabitType import org.isoron.uhabits.utils.PaletteUtils import org.junit.Before import org.junit.Test @@ -42,7 +43,9 @@ class NumberButtonViewTest : BaseViewTest() { super.setUp() view = component.getNumberButtonViewFactory().create().apply { units = "steps" - threshold = 100.0 + targetType = NumericalHabitType.AT_LEAST + lowerThreshold = 0.0 + higherThreshold = 100.0 color = PaletteUtils.getAndroidTestColor(8) onEdit = { edited = true } } diff --git a/uhabits-android/src/androidTest/java/org/isoron/uhabits/activities/habits/list/views/NumberPanelViewTest.kt b/uhabits-android/src/androidTest/java/org/isoron/uhabits/activities/habits/list/views/NumberPanelViewTest.kt index bd046acc7..f5d992f62 100644 --- a/uhabits-android/src/androidTest/java/org/isoron/uhabits/activities/habits/list/views/NumberPanelViewTest.kt +++ b/uhabits-android/src/androidTest/java/org/isoron/uhabits/activities/habits/list/views/NumberPanelViewTest.kt @@ -24,6 +24,7 @@ import androidx.test.filters.MediumTest import org.hamcrest.CoreMatchers.equalTo import org.hamcrest.MatcherAssert.assertThat import org.isoron.uhabits.BaseViewTest +import org.isoron.uhabits.core.models.NumericalHabitType import org.isoron.uhabits.core.models.Timestamp import org.isoron.uhabits.utils.PaletteUtils import org.junit.After @@ -55,7 +56,9 @@ class NumberPanelViewTest : BaseViewTest() { buttonCount = 4 color = PaletteUtils.getAndroidTestColor(7) units = "steps" - threshold = 5000.0 + targetType = NumericalHabitType.AT_LEAST + lowerThreshold = 0.0 + higherThreshold = 5000.0 } view.onAttachedToWindow() measureView(view, dpToPixels(200), dpToPixels(200))