mirror of
				https://github.com/commons-app/apps-android-commons.git
				synced 2025-10-31 06:43:56 +01:00 
			
		
		
		
	* Fixes #3389 - Show User profiles * Don't show dummy achievements data - show data only when loaded
This commit is contained in:
		
							parent
							
								
									7ce80aa804
								
							
						
					
					
						commit
						88b21a678e
					
				
					 20 changed files with 358 additions and 48 deletions
				
			
		|  | @ -80,7 +80,7 @@ class ProfileActivityTest { | |||
|     @Test | ||||
|     @Throws(Exception::class) | ||||
|     fun testStartYourself() { | ||||
|         ProfileActivity.startYourself(activity) | ||||
|         ProfileActivity.startYourself(activity, "test", false) | ||||
|     } | ||||
| 
 | ||||
|     @Test | ||||
|  |  | |||
|  | @ -11,12 +11,14 @@ import androidx.fragment.app.FragmentTransaction | |||
| import com.dinuscxj.progressbar.CircleProgressBar | ||||
| import fr.free.nrw.commons.TestAppAdapter | ||||
| import fr.free.nrw.commons.TestCommonsApplication | ||||
| import fr.free.nrw.commons.auth.SessionManager | ||||
| import fr.free.nrw.commons.profile.ProfileActivity | ||||
| import org.junit.Assert | ||||
| import org.junit.Before | ||||
| import org.junit.Test | ||||
| import org.junit.runner.RunWith | ||||
| import org.mockito.Mock | ||||
| import org.mockito.Mockito | ||||
| import org.mockito.MockitoAnnotations | ||||
| import org.powermock.reflect.Whitebox | ||||
| import org.robolectric.Robolectric | ||||
|  | @ -85,6 +87,9 @@ class AchievementsFragmentUnitTests { | |||
|     @Mock | ||||
|     private lateinit var progressBar: ProgressBar | ||||
| 
 | ||||
|     @Mock | ||||
|     private lateinit var sessionManager: SessionManager | ||||
| 
 | ||||
|     @Before | ||||
|     fun setUp() { | ||||
|         MockitoAnnotations.initMocks(this) | ||||
|  | @ -131,6 +136,10 @@ class AchievementsFragmentUnitTests { | |||
|         Whitebox.setInternalState(fragment, "progressBar", progressBar) | ||||
|         Whitebox.setInternalState(fragment, "imagesRevertLimitText", imagesRevertLimitText) | ||||
|         Whitebox.setInternalState(fragment, "item", menuItem) | ||||
|         Whitebox.setInternalState(fragment, "sessionManager", sessionManager) | ||||
| 
 | ||||
|         Mockito.`when`(sessionManager.userName).thenReturn("Test") | ||||
| 
 | ||||
|     } | ||||
| 
 | ||||
|     @Test | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Ashish
						Ashish