Fixed: After canceling a sharing, application goes back to the search menu #2296 (#5156)

* fixed:After canceling a sharing, application goes back to the search menu #2296

* fixed:After canceling a sharing, application goes back to the search menu #2296

* fixed:After canceling a sharing, application goes back to the search menu #2296

* fixed SeachActivityUnityTest failure when calling testOnBackPressed and cleaned up unnecessary code
This commit is contained in:
Arman Navodia 2023-02-27 12:12:20 +05:30 committed by GitHub
parent 7d895c4379
commit 94d462cafb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 4 deletions

View file

@ -26,6 +26,7 @@ import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Assertions.assertNull
import org.junit.runner.RunWith
import org.mockito.Mock
import org.mockito.Mockito.times
import org.mockito.Mockito.`when`
import org.mockito.MockitoAnnotations
import org.powermock.api.mockito.PowerMockito.mock
@ -124,7 +125,7 @@ class SearchActivityUnitTests {
`when`(mFragments.supportFragmentManager).thenReturn(supportFragmentManager)
`when`(supportFragmentManager.backStackEntryCount).thenReturn(0)
activity.onBackPressed()
verify(supportFragmentManager).backStackEntryCount
verify(supportFragmentManager, times(2)).backStackEntryCount
}
@Test