diff --git a/app/src/androidTest/java/at/tomtasche/reader/test/MainActivityTests.java b/app/src/androidTest/java/at/tomtasche/reader/test/MainActivityTests.java index 706b8a96cc6b..0831cdefbca4 100644 --- a/app/src/androidTest/java/at/tomtasche/reader/test/MainActivityTests.java +++ b/app/src/androidTest/java/at/tomtasche/reader/test/MainActivityTests.java @@ -19,6 +19,7 @@ import android.net.Uri; import android.util.ArrayMap; +import androidx.appcompat.widget.SwitchCompat; import androidx.core.content.FileProvider; import androidx.test.espresso.IdlingRegistry; import androidx.test.espresso.IdlingResource; @@ -184,4 +185,22 @@ public void testPDF() { .perform(click()); }); } + + @Test + public void testFileTypeSwitch() { + // Test the file type registration switch functionality + SwitchCompat fileTypeSwitch = mainActivityActivityTestRule.getActivity().findViewById(R.id.landing_catch_all); + Assert.assertNotNull("File type switch should exist", fileTypeSwitch); + + // Test toggling the switch + onView(withId(R.id.landing_catch_all)) + .perform(click()); + + // Switch should now be in opposite state + onView(withId(R.id.landing_catch_all)) + .perform(click()); + + // Should be back to original state + // This test verifies the switch is functional and doesn't crash + } } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index cc46b74f9676..59aaff6c72d2 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -218,6 +218,95 @@ android:label="@string/app_title" android:targetActivity="at.tomtasche.reader.ui.activity.MainActivity" tools:ignore="AppLinkUrlError"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +