Browse Source

prepare pop by id

Daniel Zlotin 7 years ago
parent
commit
c02c75a42f

+ 2
- 0
AndroidE2E/app/src/androidTest/java/com/reactnativenavigation/e2e/androide2e/ApplicationLifecycleTest.java View File

3
 import android.support.test.uiautomator.By;
3
 import android.support.test.uiautomator.By;
4
 
4
 
5
 import org.junit.FixMethodOrder;
5
 import org.junit.FixMethodOrder;
6
+import org.junit.Ignore;
6
 import org.junit.Test;
7
 import org.junit.Test;
7
 import org.junit.runners.MethodSorters;
8
 import org.junit.runners.MethodSorters;
8
 
9
 
9
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
10
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
11
+@Ignore
10
 public class ApplicationLifecycleTest extends BaseTest {
12
 public class ApplicationLifecycleTest extends BaseTest {
11
 
13
 
12
 	@Test
14
 	@Test

+ 4
- 2
AndroidE2E/app/src/androidTest/java/com/reactnativenavigation/e2e/androide2e/ScreenStackTest.java View File

2
 
2
 
3
 import android.support.test.uiautomator.By;
3
 import android.support.test.uiautomator.By;
4
 
4
 
5
-import org.junit.Ignore;
6
 import org.junit.Test;
5
 import org.junit.Test;
7
 
6
 
8
 public class ScreenStackTest extends BaseTest {
7
 public class ScreenStackTest extends BaseTest {
18
 	}
17
 	}
19
 
18
 
20
 	@Test
19
 	@Test
21
-	@Ignore
22
 	public void popScreenDeepInTheStack() throws Exception {
20
 	public void popScreenDeepInTheStack() throws Exception {
23
 		launchTheApp();
21
 		launchTheApp();
24
 		assertMainShown();
22
 		assertMainShown();
27
 		assertExists(By.text("Stack Position: 1"));
25
 		assertExists(By.text("Stack Position: 1"));
28
 		elementByText("PUSH").click();
26
 		elementByText("PUSH").click();
29
 		assertExists(By.text("Stack Position: 2"));
27
 		assertExists(By.text("Stack Position: 2"));
28
+		elementByText("Pop Previous").click();
29
+		assertExists(By.text("Stack Position: 2"));
30
+		elementByText("Pop").click();
31
+		assertMainShown();
30
 	}
32
 	}
31
 }
33
 }

+ 2
- 0
AndroidE2E/app/src/androidTest/java/com/reactnativenavigation/e2e/androide2e/TopLevelApiTest.java View File

2
 
2
 
3
 import android.support.test.uiautomator.By;
3
 import android.support.test.uiautomator.By;
4
 
4
 
5
+import org.junit.Ignore;
5
 import org.junit.Test;
6
 import org.junit.Test;
6
 
7
 
8
+@Ignore
7
 public class TopLevelApiTest extends BaseTest {
9
 public class TopLevelApiTest extends BaseTest {
8
 
10
 
9
 	@Test
11
 	@Test

+ 4
- 0
lib/android/app/src/main/java/com/reactnativenavigation/layout/impl/StackLayout.java View File

38
 		}
38
 		}
39
 	}
39
 	}
40
 
40
 
41
+	public void pop(String containerId) {
42
+
43
+	}
44
+
41
 	public boolean onBackPressed() {
45
 	public boolean onBackPressed() {
42
 		if (stack.isEmpty()) {
46
 		if (stack.isEmpty()) {
43
 			return false;
47
 			return false;

+ 2
- 1
lib/android/app/src/main/java/com/reactnativenavigation/react/NavigationModule.java View File

16
 
16
 
17
 public class NavigationModule extends ReactContextBaseJavaModule {
17
 public class NavigationModule extends ReactContextBaseJavaModule {
18
 	private static final String NAME = "RNNBridgeModule";
18
 	private static final String NAME = "RNNBridgeModule";
19
-	private ReactInstanceManager reactInstanceManager;
19
+	private final ReactInstanceManager reactInstanceManager;
20
 
20
 
21
 	public NavigationModule(final ReactApplicationContext reactContext, final ReactInstanceManager reactInstanceManager) {
21
 	public NavigationModule(final ReactApplicationContext reactContext, final ReactInstanceManager reactInstanceManager) {
22
 		super(reactContext);
22
 		super(reactContext);
60
 		handle(new Runnable() {
60
 		handle(new Runnable() {
61
 			@Override
61
 			@Override
62
 			public void run() {
62
 			public void run() {
63
+
63
 				((StackLayout) activity().getLayout()).pop();
64
 				((StackLayout) activity().getLayout()).pop();
64
 			}
65
 			}
65
 		});
66
 		});