mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 21:03:54 +01:00
Enable support toolbar for ProfileActivity and added a couple of unit… (#5188)
* Enable support toolbar for ProfileActivity and added a couple of unit tests * Nit fixes * Nit Fixes * Minor styling changes in ContributionsFragment
This commit is contained in:
parent
fc672dbd9b
commit
07616485ae
7 changed files with 97 additions and 50 deletions
|
|
@ -67,7 +67,7 @@ class MediaDetailPagerFragmentUnitTests {
|
|||
|
||||
val activity = Robolectric.buildActivity(SearchActivity::class.java).create().get()
|
||||
|
||||
fragment = MediaDetailPagerFragment()
|
||||
fragment = MediaDetailPagerFragment(false, true)
|
||||
fragment = MediaDetailPagerFragment(false, false)
|
||||
fragment = MediaDetailPagerFragment(false, false, 0)
|
||||
fragmentManager = activity.supportFragmentManager
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import android.graphics.Bitmap
|
|||
import android.os.Looper
|
||||
import android.view.Menu
|
||||
import android.view.MenuItem
|
||||
import androidx.appcompat.widget.Toolbar
|
||||
import androidx.test.core.app.ApplicationProvider
|
||||
import fr.free.nrw.commons.R
|
||||
import fr.free.nrw.commons.TestCommonsApplication
|
||||
|
|
@ -106,4 +107,17 @@ class ProfileActivityTest {
|
|||
fun testOnSupportNavigateUp() {
|
||||
activity.onSupportNavigateUp()
|
||||
}
|
||||
@Test
|
||||
fun testToolbarNotNull() {
|
||||
val toolbar = activity.findViewById<Toolbar>(R.id.toolbar)
|
||||
Assert.assertNotNull(toolbar)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testOptionsMenu() {
|
||||
val menu: Menu = RoboMenu(mockContext)
|
||||
activity.onCreateOptionsMenu(menu)
|
||||
Assert.assertEquals(1, menu.size())
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue