Unit tests failing (#4889)

* tests

* fixed tests
This commit is contained in:
Devarsh Mavani 2022-03-13 06:11:45 +05:30 committed by GitHub
parent ed572aab6f
commit caad8644a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 27 additions and 2 deletions

View file

@ -17,6 +17,7 @@ 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 fr.free.nrw.commons.utils.ConfigUtils
import org.junit.Assert
import org.junit.Before
import org.junit.Test
@ -372,7 +373,16 @@ class AchievementsFragmentUnitTests {
)
method.isAccessible = true
method.invoke(fragment, true)
Assert.assertEquals(ShadowToast.getTextOfLatestToast().toString(), context.getString(R.string.achievements_unavailable_beta))
if(ConfigUtils.isBetaFlavour) {
Assert.assertEquals(
ShadowToast.getTextOfLatestToast().toString(),
context.getString(R.string.achievements_unavailable_beta)
)
} else {
Assert.assertNull(
ShadowToast.getTextOfLatestToast()
)
}
}
}