Fixed: testNoteEntryIsRemovedFromDatabaseWhenDeletedInAddNoteDialog failing on API level 25.

This commit is contained in:
MohitMaliFtechiz 2025-03-11 19:21:22 +05:30
parent df67f91b0a
commit b309032241
2 changed files with 21 additions and 18 deletions

View File

@ -207,6 +207,7 @@ class NoteFragmentTest : BaseActivityTest() {
@Test @Test
fun testNoteEntryIsRemovedFromDatabaseWhenDeletedInAddNoteDialog() { fun testNoteEntryIsRemovedFromDatabaseWhenDeletedInAddNoteDialog() {
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.N_MR1) {
deletePreviouslySavedNotes() deletePreviouslySavedNotes()
loadZimFileInReader("testzim.zim") loadZimFileInReader("testzim.zim")
note { note {
@ -226,6 +227,7 @@ class NoteFragmentTest : BaseActivityTest() {
assertNoNotesTextDisplayed() assertNoNotesTextDisplayed()
} }
} }
}
@Test @Test
fun testNoteFileIsDeletedWhenNoteIsRemovedFromNotesScreen() { fun testNoteFileIsDeletedWhenNoteIsRemovedFromNotesScreen() {

View File

@ -31,12 +31,13 @@ import org.kiwix.kiwixmobile.core.utils.files.FileUtils.isFileDescriptorCanOpenW
import org.kiwix.libzim.Archive import org.kiwix.libzim.Archive
import org.kiwix.libzim.FdInput import org.kiwix.libzim.FdInput
import java.io.File import java.io.File
import java.io.Serializable
class ZimReaderSource( class ZimReaderSource(
val file: File? = null, val file: File? = null,
val uri: Uri? = null, val uri: Uri? = null,
val assetFileDescriptorList: List<AssetFileDescriptor>? = null val assetFileDescriptorList: List<AssetFileDescriptor>? = null
) { ) : Serializable {
constructor(uri: Uri) : this( constructor(uri: Uri) : this(
uri = uri, uri = uri,
assetFileDescriptorList = getAssetFileDescriptorFromUri(CoreApp.instance, uri) assetFileDescriptorList = getAssetFileDescriptorFromUri(CoreApp.instance, uri)