HistoryView: test tap at invalid locations

This commit is contained in:
2016-03-31 06:31:13 -04:00
parent 826491bc90
commit 0ea2c8e5c8

View File

@@ -33,6 +33,8 @@ import org.junit.runner.RunWith;
import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertTrue;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
@RunWith(AndroidJUnit4.class)
@SmallTest
@@ -95,6 +97,21 @@ public class HabitHistoryViewTest extends ViewTest
assertFalse(habit.repetitions.contains(today));
}
@Test
public void tapDate_atInvalidLocations() throws Throwable
{
int expectedCheckmarkValues[] = habit.checkmarks.getAllValues();
view.setIsEditable(true);
tap(view, 45, 5); // header
tap(view, 270, 43); // tomorrow's square
tap(view, 280, 30); // right axis
waitForAsyncTasks();
int actualCheckmarkValues[] = habit.checkmarks.getAllValues();
assertThat(actualCheckmarkValues, equalTo(expectedCheckmarkValues));
}
@Test
public void tapDate_withReadOnlyView() throws Throwable
{