aboutsummaryrefslogtreecommitdiff
path: root/app/src/androidTest
diff options
context:
space:
mode:
authorHarsh Shandilya <me@msfjarvis.dev>2021-02-03 01:25:34 +0530
committerGitHub <noreply@github.com>2021-02-03 01:25:34 +0530
commit318aeae50072d575c975bbf1f708d526c41adc20 (patch)
tree794dd596f67e14956b0cf8351f151121db723fca /app/src/androidTest
parent4694c5ac8575a7e85e6b950eaed99049719b6151 (diff)
Rework clear clipboard feature (#1295)
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
Diffstat (limited to 'app/src/androidTest')
-rw-r--r--app/src/androidTest/java/dev/msfjarvis/aps/util/settings/MigrationsTest.kt13
1 files changed, 13 insertions, 0 deletions
diff --git a/app/src/androidTest/java/dev/msfjarvis/aps/util/settings/MigrationsTest.kt b/app/src/androidTest/java/dev/msfjarvis/aps/util/settings/MigrationsTest.kt
index d27b4c1c..0c3afebe 100644
--- a/app/src/androidTest/java/dev/msfjarvis/aps/util/settings/MigrationsTest.kt
+++ b/app/src/androidTest/java/dev/msfjarvis/aps/util/settings/MigrationsTest.kt
@@ -13,6 +13,7 @@ import dev.msfjarvis.aps.Application
import dev.msfjarvis.aps.util.extensions.getString
import dev.msfjarvis.aps.util.extensions.sharedPrefs
import org.junit.Assert.assertEquals
+import org.junit.Assert.assertFalse
import org.junit.Assert.assertNull
import org.junit.Test
@@ -104,4 +105,16 @@ class MigrationsTest {
assertEquals(false, context.sharedPrefs.getBoolean(PreferenceKeys.SHOW_HIDDEN_FOLDERS, false))
assertEquals(true, context.sharedPrefs.getBoolean(PreferenceKeys.SHOW_HIDDEN_CONTENTS, false))
}
+
+ @Test
+ fun verifyClearClipboardHistoryMigration() {
+ val context = Application.instance.applicationContext
+ context.sharedPrefs.edit {
+ clear()
+ putBoolean(PreferenceKeys.CLEAR_CLIPBOARD_20X, true)
+ }
+ runMigrations(context)
+ assertEquals(true, context.sharedPrefs.getBoolean(PreferenceKeys.CLEAR_CLIPBOARD_HISTORY, false))
+ assertFalse(context.sharedPrefs.contains(PreferenceKeys.CLEAR_CLIPBOARD_20X))
+ }
}