From 318aeae50072d575c975bbf1f708d526c41adc20 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Wed, 3 Feb 2021 01:25:34 +0530 Subject: Rework clear clipboard feature (#1295) Signed-off-by: Harsh Shandilya --- .../java/dev/msfjarvis/aps/util/settings/MigrationsTest.kt | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'app/src/androidTest') 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)) + } } -- cgit v1.2.3