Fix subtasks moving tests

pull/820/head
Alex Baker 5 years ago
parent 5d3b72c54b
commit 697951a7e4

@ -66,8 +66,6 @@ public class SubtasksHelperTest extends SubtasksTestCase {
@Override
protected void inject(TestComponent component) {
super.inject(component);
component.inject(this);
}
}

@ -4,10 +4,10 @@ import androidx.test.runner.AndroidJUnit4;
import com.todoroo.astrid.dao.TaskDao;
import com.todoroo.astrid.data.Task;
import javax.inject.Inject;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.tasks.data.TaskListMetadata;
import org.tasks.injection.TestComponent;
@RunWith(AndroidJUnit4.class)
public class SubtasksMovingTest extends SubtasksTestCase {
@ -16,8 +16,8 @@ public class SubtasksMovingTest extends SubtasksTestCase {
private Task A, B, C, D, E, F;
// @Override
protected void disabled_setUp() {
@Override
public void setUp() {
super.setUp();
createTasks();
TaskListMetadata m = new TaskListMetadata();
@ -34,6 +34,11 @@ public class SubtasksMovingTest extends SubtasksTestCase {
expectParentAndPosition(F, null, 2);
}
@Override
protected void inject(TestComponent component) {
component.inject(this);
}
private void createTasks() {
A = createTask("A");
B = createTask("B");
@ -65,7 +70,6 @@ public class SubtasksMovingTest extends SubtasksTestCase {
* F
*/
@Ignore
@Test
public void testMoveBeforeIntoSelf() { // Should have no effect
whenTriggerMoveBefore(A, B);
@ -78,7 +82,6 @@ public class SubtasksMovingTest extends SubtasksTestCase {
expectParentAndPosition(F, null, 2);
}
@Ignore
@Test
public void testMoveIntoDescendant() { // Should have no effect
whenTriggerMoveBefore(A, C);
@ -91,7 +94,6 @@ public class SubtasksMovingTest extends SubtasksTestCase {
expectParentAndPosition(F, null, 2);
}
@Ignore
@Test
public void testMoveToEndOfChildren() { // Should have no effect
whenTriggerMoveBefore(A, E);
@ -104,7 +106,6 @@ public class SubtasksMovingTest extends SubtasksTestCase {
expectParentAndPosition(F, null, 2);
}
@Ignore
@Test
public void testStandardMove() {
whenTriggerMoveBefore(A, F);
@ -117,7 +118,6 @@ public class SubtasksMovingTest extends SubtasksTestCase {
expectParentAndPosition(F, null, 2);
}
@Ignore
@Test
public void testMoveToEndOfList() {
whenTriggerMoveBefore(A, null);

@ -12,7 +12,6 @@ import com.todoroo.astrid.subtasks.SubtasksFilterUpdater.Node;
import javax.inject.Inject;
import org.tasks.data.TaskListMetadataDao;
import org.tasks.injection.InjectingTestCase;
import org.tasks.injection.TestComponent;
import org.tasks.preferences.Preferences;
/**
@ -20,7 +19,7 @@ import org.tasks.preferences.Preferences;
*
* @author Sam
*/
public class SubtasksTestCase extends InjectingTestCase {
public abstract class SubtasksTestCase extends InjectingTestCase {
/* Starting State:
*
@ -46,11 +45,6 @@ public class SubtasksTestCase extends InjectingTestCase {
updater = new SubtasksFilterUpdater(taskListMetadataDao, taskDao);
}
@Override
protected void inject(TestComponent component) {
component.inject(this);
}
void expectParentAndPosition(Task task, Task parent, int positionInParent) {
String parentId = (parent == null ? "-1" : parent.getUuid());
Node n = updater.findNodeForTask(task.getUuid());

@ -13,7 +13,7 @@ import com.todoroo.astrid.repeats.RepeatTaskHelperTest;
import com.todoroo.astrid.service.QuickAddMarkupTest;
import com.todoroo.astrid.service.TitleParserTest;
import com.todoroo.astrid.subtasks.SubtasksHelperTest;
import com.todoroo.astrid.subtasks.SubtasksTestCase;
import com.todoroo.astrid.subtasks.SubtasksMovingTest;
import com.todoroo.astrid.sync.NewSyncTestCase;
import dagger.Component;
import org.tasks.data.DeletionDaoTests;
@ -39,7 +39,7 @@ public interface TestComponent extends ApplicationComponent {
void inject(NewSyncTestCase newSyncTestCase);
void inject(SubtasksTestCase subtasksTestCase);
void inject(SubtasksMovingTest subtasksTestCase);
void inject(SubtasksHelperTest subtasksHelperTest);

Loading…
Cancel
Save