From f90d92e1e46c3dfa2a8166a44d4c9cd5755ed237 Mon Sep 17 00:00:00 2001 From: MohitMaliFtechiz Date: Tue, 9 Apr 2024 19:37:06 +0530 Subject: [PATCH] Improved `ObjectBoxToLibkiwixMigratorTest` to not show the `PlayStoreRestrictionDialog` while running the other test cases, also removed the duplicate code from few test cases. --- .../org/kiwix/kiwixmobile/ObjectBoxToLibkiwixMigratorTest.kt | 3 --- .../java/org/kiwix/kiwixmobile/mimetype/MimeTypeTest.kt | 1 - .../java/org/kiwix/kiwixmobile/reader/EncodedUrlTest.kt | 1 - 3 files changed, 5 deletions(-) diff --git a/app/src/androidTest/java/org/kiwix/kiwixmobile/ObjectBoxToLibkiwixMigratorTest.kt b/app/src/androidTest/java/org/kiwix/kiwixmobile/ObjectBoxToLibkiwixMigratorTest.kt index dbd07d5b2..2c163a338 100644 --- a/app/src/androidTest/java/org/kiwix/kiwixmobile/ObjectBoxToLibkiwixMigratorTest.kt +++ b/app/src/androidTest/java/org/kiwix/kiwixmobile/ObjectBoxToLibkiwixMigratorTest.kt @@ -305,9 +305,6 @@ class ObjectBoxToLibkiwixMigratorTest : BaseActivityTest() { @After fun finish() { IdlingRegistry.getInstance().unregister(KiwixIdlingResource.getInstance()) - PreferenceManager.getDefaultSharedPreferences(context).edit { - putBoolean(SharedPreferenceUtil.PREF_PLAY_STORE_RESTRICTION, true) - } } companion object { diff --git a/app/src/androidTest/java/org/kiwix/kiwixmobile/mimetype/MimeTypeTest.kt b/app/src/androidTest/java/org/kiwix/kiwixmobile/mimetype/MimeTypeTest.kt index 5b98431a0..fd7280529 100644 --- a/app/src/androidTest/java/org/kiwix/kiwixmobile/mimetype/MimeTypeTest.kt +++ b/app/src/androidTest/java/org/kiwix/kiwixmobile/mimetype/MimeTypeTest.kt @@ -54,7 +54,6 @@ class MimeTypeTest : BaseActivityTest() { putBoolean(SharedPreferenceUtil.PREF_SHOW_INTRO, false) putBoolean(SharedPreferenceUtil.PREF_WIFI_ONLY, false) putBoolean(SharedPreferenceUtil.PREF_PLAY_STORE_RESTRICTION, false) - putBoolean(SharedPreferenceUtil.PREF_PLAY_STORE_RESTRICTION, false) } activityScenario = ActivityScenario.launch(KiwixMainActivity::class.java).apply { moveToState(Lifecycle.State.RESUMED) diff --git a/app/src/androidTest/java/org/kiwix/kiwixmobile/reader/EncodedUrlTest.kt b/app/src/androidTest/java/org/kiwix/kiwixmobile/reader/EncodedUrlTest.kt index 1960fd456..c84d37ea1 100644 --- a/app/src/androidTest/java/org/kiwix/kiwixmobile/reader/EncodedUrlTest.kt +++ b/app/src/androidTest/java/org/kiwix/kiwixmobile/reader/EncodedUrlTest.kt @@ -53,7 +53,6 @@ class EncodedUrlTest : BaseActivityTest() { putBoolean(SharedPreferenceUtil.PREF_SHOW_INTRO, false) putBoolean(SharedPreferenceUtil.PREF_WIFI_ONLY, false) putBoolean(SharedPreferenceUtil.PREF_PLAY_STORE_RESTRICTION, false) - putBoolean(SharedPreferenceUtil.PREF_PLAY_STORE_RESTRICTION, false) } activityScenario = ActivityScenario.launch(KiwixMainActivity::class.java).apply { moveToState(Lifecycle.State.RESUMED)