mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-08-03 18:56:44 -04:00
fix release intents in a separate method
This commit is contained in:
parent
18daf6b817
commit
7c38b7cec6
@ -61,12 +61,12 @@ public class SplashActivityTest {
|
||||
|
||||
@Before
|
||||
public void setUp(){
|
||||
Intents.init();
|
||||
context = getInstrumentation().getTargetContext();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFirstRun() {
|
||||
Intents.init();
|
||||
activityTestRule.launchActivity();
|
||||
BaristaSleepInteractions.sleep(TEST_PAUSE_MS);
|
||||
|
||||
@ -76,12 +76,10 @@ public class SplashActivityTest {
|
||||
// Verify that the value of the "intro shown" boolean inside the SharedPreferences Database is not changed until the "Get started" button is pressed
|
||||
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
assertEquals(true, preferences.getBoolean(PREF_SHOW_INTRO, true));
|
||||
Intents.release();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNormalRun() {
|
||||
Intents.init();
|
||||
SharedPreferences.Editor preferencesEditor = PreferenceManager.getDefaultSharedPreferences(context).edit();
|
||||
preferencesEditor.putBoolean(PREF_SHOW_INTRO, false).apply();
|
||||
|
||||
@ -90,6 +88,10 @@ public class SplashActivityTest {
|
||||
|
||||
// Verify that the SplashActivity is followed by MainActivity
|
||||
intended(hasComponent(MainActivity.class.getName()));
|
||||
}
|
||||
|
||||
@After
|
||||
public void endTest() {
|
||||
Intents.release();
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user