package com.vikashkothary.life;

import android.content.Intent;
import android.support.test.InstrumentationRegistry;
import android.support.test.rule.ActivityTestRule;
import android.support.test.runner.AndroidJUnit4;

import com.vikashkothary.life.test.common.TestComponentRule;
import com.vikashkothary.life.ui.main.MainActivity;

import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.RuleChain;
import org.junit.rules.TestRule;
import org.junit.runner.RunWith;

@RunWith(AndroidJUnit4.class)
public class MainActivityTest {

    public final TestComponentRule component =
            new TestComponentRule(InstrumentationRegistry.getTargetContext());
    public final ActivityTestRule<MainActivity> main =
            new ActivityTestRule<MainActivity>(MainActivity.class, false, false) {
                @Override
                protected Intent getActivityIntent() {
                    // Override the default intent so we pass a false flag for syncing so it doesn't
                    // start a sync service in the background that would affect  the behaviour of
                    // this test.
                    return MainActivity.newIntent(
                            InstrumentationRegistry.getTargetContext());
                }
            };

    // TestComponentRule needs to go first to make sure the Dagger ApplicationTestComponent is set
    // in the Application before any Activity is launched.
    @Rule
    public final TestRule chain = RuleChain.outerRule(component).around(main);

    @Test
    public void listOfRibotsShows() {
//        List<Ribot> testDataRibots = TestDataFactory.makeListRibots(20);
//        when(component.getMockDataManager().getRibots())
//                .thenReturn(Observable.just(testDataRibots));
//
//        main.launchActivity(null);
//
//        int position = 0;
//        for (Ribot ribot : testDataRibots) {
//            onView(withId(R.id.recycler_view))
//                    .perform(RecyclerViewActions.scrollToPosition(position));
//            String name = String.format("%s %s", ribot.profile().name().first(),
//                    ribot.profile().name().last());
//            onView(withText(name))
//                    .check(matches(isDisplayed()));
//            onView(withText(ribot.profile().email()))
//                    .check(matches(isDisplayed()));
//            position++;
//        }
    }

}
@@ -30,39 +30,8 @@
 e;%0A%0A
-import android.content.Intent;%0A
 impo
@@ -83,59 +83,8 @@
 ry;%0A
-import android.support.test.rule.ActivityTestRule;%0A
 impo
@@ -195,172 +195,30 @@
 le;%0A
-import com.vikashkothary.life.ui.main.MainActivity;%0A%0Aimport org.junit.Rule;%0Aimport org.junit.Test;%0Aimport org.junit.rules.RuleChain;%0Aimport org.junit.rules.TestRule
+%0Aimport org.junit.Test
 ;%0Aim
@@ -434,24 +434,26 @@
 Context());%0A
+//
     public f
@@ -495,16 +495,18 @@
  main =%0A
+//
         
@@ -576,24 +576,26 @@
 e, false) %7B%0A
+//
             
@@ -608,16 +608,18 @@
 verride%0A
+//
         
@@ -665,16 +665,18 @@
 ent() %7B%0A
+//
         
@@ -768,16 +768,18 @@
 doesn't%0A
+//
         
@@ -868,16 +868,18 @@
 iour of%0A
+//
         
@@ -904,16 +904,18 @@
 s test.%0A
+//
         
@@ -957,16 +957,18 @@
 Intent(%0A
+//
         
@@ -1032,16 +1032,18 @@
 ext());%0A
+//
         
@@ -1048,24 +1048,26 @@
           %7D%0A
+//
             
@@ -1228,16 +1228,18 @@
 unched.%0A
+//
     @Rul
@@ -1240,16 +1240,18 @@
   @Rule%0A
+//
     publ

Comment out MainActivityTest code