mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-06 09:08:52 -06:00
Opt-in skips: Update tests
This commit is contained in:
@@ -56,6 +56,7 @@ public class HistoryChartTest extends BaseViewTest
|
||||
today = new Timestamp(DateUtils.getStartOfToday());
|
||||
|
||||
chart = new HistoryChart(targetContext);
|
||||
chart.setSkipEnabled(true);
|
||||
chart.setCheckmarks(habit.getCheckmarks().getAllValues());
|
||||
chart.setColor(PaletteUtils.getAndroidTestColor(habit.getColor()));
|
||||
measureView(chart, dpToPixels(400), dpToPixels(200));
|
||||
|
||||
@@ -52,6 +52,7 @@ public class CheckmarkWidgetTest extends BaseViewTest
|
||||
super.setUp();
|
||||
setTheme(R.style.WidgetTheme);
|
||||
prefs.setWidgetOpacity(255);
|
||||
prefs.setSkipEnabled(true);
|
||||
|
||||
habit = fixtures.createVeryLongHabit();
|
||||
checkmarks = habit.getCheckmarks();
|
||||
|
||||
@@ -22,6 +22,7 @@ package org.isoron.uhabits.receivers;
|
||||
import org.isoron.uhabits.*;
|
||||
import org.isoron.uhabits.core.commands.*;
|
||||
import org.isoron.uhabits.core.models.*;
|
||||
import org.isoron.uhabits.core.preferences.*;
|
||||
import org.isoron.uhabits.core.ui.*;
|
||||
import org.isoron.uhabits.core.ui.widgets.*;
|
||||
import org.isoron.uhabits.core.utils.*;
|
||||
@@ -44,6 +45,8 @@ public class WidgetControllerTest extends BaseAndroidJVMTest
|
||||
|
||||
private NotificationTray notificationTray;
|
||||
|
||||
private Preferences preferences;
|
||||
|
||||
@Override
|
||||
public void setUp()
|
||||
{
|
||||
@@ -53,8 +56,9 @@ public class WidgetControllerTest extends BaseAndroidJVMTest
|
||||
habit = fixtures.createEmptyHabit();
|
||||
commandRunner = mock(CommandRunner.class);
|
||||
notificationTray = mock(NotificationTray.class);
|
||||
preferences = mock(Preferences.class);
|
||||
controller =
|
||||
new WidgetBehavior(habitList, commandRunner, notificationTray);
|
||||
new WidgetBehavior(habitList, commandRunner, notificationTray, preferences);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -343,6 +343,11 @@ public class Preferences
|
||||
return storage.getBoolean("pref_skip_enabled", false);
|
||||
}
|
||||
|
||||
public void setSkipEnabled(boolean value)
|
||||
{
|
||||
storage.putBoolean("pref_skip_enabled", value);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return An integer representing the first day of the week. Sunday
|
||||
|
||||
Reference in New Issue
Block a user