Skip to content

Commit

Permalink
Address TODOs as part of the migration.
Browse files Browse the repository at this point in the history
This addresses TODOs for #4119 and #4120. It also updates TODOs on #3715
to #4463, instead, since these apparently weren't correctly originally.
  • Loading branch information
BenHenning committed Apr 3, 2023
1 parent 0709b3d commit e44b59d
Show file tree
Hide file tree
Showing 32 changed files with 4,844 additions and 5,433 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ import org.oppia.android.testing.data.DataProviderTestMonitor
import org.oppia.android.testing.junit.OppiaParameterizedTestRunner
import org.oppia.android.testing.junit.OppiaParameterizedTestRunner.Iteration
import org.oppia.android.testing.junit.OppiaParameterizedTestRunner.Parameter
import org.oppia.android.testing.junit.OppiaParameterizedTestRunner.RunParameterized
import org.oppia.android.testing.junit.OppiaParameterizedTestRunner.SelectRunnerPlatform
import org.oppia.android.testing.junit.ParameterizedAutoAndroidTestRunner
import org.oppia.android.testing.robolectric.RobolectricModule
Expand Down Expand Up @@ -400,12 +399,10 @@ class SplashActivityTest {
}

@Test
@RunParameterized(
Iteration("testing_to_beta", "firstOpen=TESTING", "secondOpen=BETA"),
Iteration("dev_to_beta", "firstOpen=DEVELOPER", "secondOpen=BETA"),
Iteration("alpha_to_beta", "firstOpen=ALPHA", "secondOpen=BETA"),
Iteration("ga_to_beta", "firstOpen=GENERAL_AVAILABILITY", "secondOpen=BETA")
)
@Iteration("testing_to_beta", "firstOpen=TESTING", "secondOpen=BETA")
@Iteration("dev_to_beta", "firstOpen=DEVELOPER", "secondOpen=BETA")
@Iteration("alpha_to_beta", "firstOpen=ALPHA", "secondOpen=BETA")
@Iteration("ga_to_beta", "firstOpen=GENERAL_AVAILABILITY", "secondOpen=BETA")
fun testSplashActivity_newUser_betaFlavorTransitions_showsBetaNotice() {
simulateAppAlreadyOpenedWithFlavor(firstOpenFlavor)

Expand All @@ -418,12 +415,10 @@ class SplashActivityTest {
}

@Test
@RunParameterized(
Iteration("testing_to_beta", "firstOpen=TESTING", "secondOpen=BETA"),
Iteration("dev_to_beta", "firstOpen=DEVELOPER", "secondOpen=BETA"),
Iteration("alpha_to_beta", "firstOpen=ALPHA", "secondOpen=BETA"),
Iteration("ga_to_beta", "firstOpen=GENERAL_AVAILABILITY", "secondOpen=BETA")
)
@Iteration("testing_to_beta", "firstOpen=TESTING", "secondOpen=BETA")
@Iteration("dev_to_beta", "firstOpen=DEVELOPER", "secondOpen=BETA")
@Iteration("alpha_to_beta", "firstOpen=ALPHA", "secondOpen=BETA")
@Iteration("ga_to_beta", "firstOpen=GENERAL_AVAILABILITY", "secondOpen=BETA")
fun testSplashActivity_newUser_betaFlavorTransitions_closeNotice_routesToOnboardingFlow() {
simulateAppAlreadyOpenedWithFlavor(firstOpenFlavor)
initializeTestApplicationWithFlavor(secondOpenFlavor)
Expand All @@ -439,12 +434,10 @@ class SplashActivityTest {
}

@Test
@RunParameterized(
Iteration("testing_to_beta", "firstOpen=TESTING", "secondOpen=BETA"),
Iteration("dev_to_beta", "firstOpen=DEVELOPER", "secondOpen=BETA"),
Iteration("alpha_to_beta", "firstOpen=ALPHA", "secondOpen=BETA"),
Iteration("ga_to_beta", "firstOpen=GENERAL_AVAILABILITY", "secondOpen=BETA")
)
@Iteration("testing_to_beta", "firstOpen=TESTING", "secondOpen=BETA")
@Iteration("dev_to_beta", "firstOpen=DEVELOPER", "secondOpen=BETA")
@Iteration("alpha_to_beta", "firstOpen=ALPHA", "secondOpen=BETA")
@Iteration("ga_to_beta", "firstOpen=GENERAL_AVAILABILITY", "secondOpen=BETA")
fun testSplashActivity_newUser_betaFlavorTransitions_doNotShowAgain_routesToOnboardingFlow() {
simulateAppAlreadyOpenedWithFlavor(firstOpenFlavor)
initializeTestApplicationWithFlavor(secondOpenFlavor)
Expand Down Expand Up @@ -539,10 +532,8 @@ class SplashActivityTest {
}

@Test
@RunParameterized(
Iteration("alpha_to_ga", "firstOpen=ALPHA", "secondOpen=GENERAL_AVAILABILITY"),
Iteration("beta_to_ga", "firstOpen=BETA", "secondOpen=GENERAL_AVAILABILITY")
)
@Iteration("alpha_to_ga", "firstOpen=ALPHA", "secondOpen=GENERAL_AVAILABILITY")
@Iteration("beta_to_ga", "firstOpen=BETA", "secondOpen=GENERAL_AVAILABILITY")
fun testSplashActivity_onboarded_gaFlavorTransitions_showsGaUpgradeNotice() {
simulateAppAlreadyOnboardedWithFlavor(firstOpenFlavor)

Expand All @@ -556,10 +547,8 @@ class SplashActivityTest {
}

@Test
@RunParameterized(
Iteration("alpha_to_ga", "firstOpen=ALPHA", "secondOpen=GENERAL_AVAILABILITY"),
Iteration("beta_to_ga", "firstOpen=BETA", "secondOpen=GENERAL_AVAILABILITY")
)
@Iteration("alpha_to_ga", "firstOpen=ALPHA", "secondOpen=GENERAL_AVAILABILITY")
@Iteration("beta_to_ga", "firstOpen=BETA", "secondOpen=GENERAL_AVAILABILITY")
fun testSplashActivity_onboarded_gaFlavorTransitions_closeNotice_routesToProfileChooser() {
simulateAppAlreadyOnboardedWithFlavor(firstOpenFlavor)
initializeTestApplicationWithFlavor(secondOpenFlavor)
Expand All @@ -576,10 +565,8 @@ class SplashActivityTest {
}

@Test
@RunParameterized(
Iteration("alpha_to_ga", "firstOpen=ALPHA", "secondOpen=GENERAL_AVAILABILITY"),
Iteration("beta_to_ga", "firstOpen=BETA", "secondOpen=GENERAL_AVAILABILITY")
)
@Iteration("alpha_to_ga", "firstOpen=ALPHA", "secondOpen=GENERAL_AVAILABILITY")
@Iteration("beta_to_ga", "firstOpen=BETA", "secondOpen=GENERAL_AVAILABILITY")
fun testSplashActivity_onboarded_gaFlavorTransitions_doNotShowAgain_routesToProfileChooser() {
simulateAppAlreadyOnboardedWithFlavor(firstOpenFlavor)
initializeTestApplicationWithFlavor(secondOpenFlavor)
Expand Down Expand Up @@ -749,27 +736,25 @@ class SplashActivityTest {
}

@Test
@RunParameterized(
Iteration("testing_to_testing", "firstOpen=TESTING", "secondOpen=TESTING"),
Iteration("testing_to_dev", "firstOpen=TESTING", "secondOpen=DEVELOPER"),
Iteration("testing_to_alpha", "firstOpen=TESTING", "secondOpen=ALPHA"),
Iteration("testing_to_ga", "firstOpen=TESTING", "secondOpen=GENERAL_AVAILABILITY"),
Iteration("dev_to_testing", "firstOpen=DEVELOPER", "secondOpen=TESTING"),
Iteration("dev_to_dev", "firstOpen=DEVELOPER", "secondOpen=DEVELOPER"),
Iteration("dev_to_alpha", "firstOpen=DEVELOPER", "secondOpen=ALPHA"),
Iteration("dev_to_ga", "firstOpen=DEVELOPER", "secondOpen=GENERAL_AVAILABILITY"),
Iteration("alpha_to_testing", "firstOpen=ALPHA", "secondOpen=TESTING"),
Iteration("alpha_to_dev", "firstOpen=ALPHA", "secondOpen=DEVELOPER"),
Iteration("alpha_to_alpha", "firstOpen=ALPHA", "secondOpen=ALPHA"),
Iteration("beta_to_testing", "firstOpen=BETA", "secondOpen=TESTING"),
Iteration("beta_to_dev", "firstOpen=BETA", "secondOpen=DEVELOPER"),
Iteration("beta_to_alpha", "firstOpen=BETA", "secondOpen=ALPHA"),
Iteration("beta_to_beta", "firstOpen=BETA", "secondOpen=BETA"),
Iteration("ga_to_testing", "firstOpen=GENERAL_AVAILABILITY", "secondOpen=TESTING"),
Iteration("ga_to_dev", "firstOpen=GENERAL_AVAILABILITY", "secondOpen=DEVELOPER"),
Iteration("ga_to_alpha", "firstOpen=GENERAL_AVAILABILITY", "secondOpen=ALPHA"),
Iteration("ga_to_ga", "firstOpen=GENERAL_AVAILABILITY", "secondOpen=GENERAL_AVAILABILITY")
)
@Iteration("testing_to_testing", "firstOpen=TESTING", "secondOpen=TESTING")
@Iteration("testing_to_dev", "firstOpen=TESTING", "secondOpen=DEVELOPER")
@Iteration("testing_to_alpha", "firstOpen=TESTING", "secondOpen=ALPHA")
@Iteration("testing_to_ga", "firstOpen=TESTING", "secondOpen=GENERAL_AVAILABILITY")
@Iteration("dev_to_testing", "firstOpen=DEVELOPER", "secondOpen=TESTING")
@Iteration("dev_to_dev", "firstOpen=DEVELOPER", "secondOpen=DEVELOPER")
@Iteration("dev_to_alpha", "firstOpen=DEVELOPER", "secondOpen=ALPHA")
@Iteration("dev_to_ga", "firstOpen=DEVELOPER", "secondOpen=GENERAL_AVAILABILITY")
@Iteration("alpha_to_testing", "firstOpen=ALPHA", "secondOpen=TESTING")
@Iteration("alpha_to_dev", "firstOpen=ALPHA", "secondOpen=DEVELOPER")
@Iteration("alpha_to_alpha", "firstOpen=ALPHA", "secondOpen=ALPHA")
@Iteration("beta_to_testing", "firstOpen=BETA", "secondOpen=TESTING")
@Iteration("beta_to_dev", "firstOpen=BETA", "secondOpen=DEVELOPER")
@Iteration("beta_to_alpha", "firstOpen=BETA", "secondOpen=ALPHA")
@Iteration("beta_to_beta", "firstOpen=BETA", "secondOpen=BETA")
@Iteration("ga_to_testing", "firstOpen=GENERAL_AVAILABILITY", "secondOpen=TESTING")
@Iteration("ga_to_dev", "firstOpen=GENERAL_AVAILABILITY", "secondOpen=DEVELOPER")
@Iteration("ga_to_alpha", "firstOpen=GENERAL_AVAILABILITY", "secondOpen=ALPHA")
@Iteration("ga_to_ga", "firstOpen=GENERAL_AVAILABILITY", "secondOpen=GENERAL_AVAILABILITY")
fun testSplashActivity_newUser_ignoredFlavorTransitions_routesToOnboardingFlow() {
simulateAppAlreadyOpenedWithFlavor(firstOpenFlavor)

Expand All @@ -783,27 +768,25 @@ class SplashActivityTest {
}

@Test
@RunParameterized(
Iteration("testing_to_testing", "firstOpen=TESTING", "secondOpen=TESTING"),
Iteration("testing_to_dev", "firstOpen=TESTING", "secondOpen=DEVELOPER"),
Iteration("testing_to_alpha", "firstOpen=TESTING", "secondOpen=ALPHA"),
Iteration("testing_to_ga", "firstOpen=TESTING", "secondOpen=GENERAL_AVAILABILITY"),
Iteration("dev_to_testing", "firstOpen=DEVELOPER", "secondOpen=TESTING"),
Iteration("dev_to_dev", "firstOpen=DEVELOPER", "secondOpen=DEVELOPER"),
Iteration("dev_to_alpha", "firstOpen=DEVELOPER", "secondOpen=ALPHA"),
Iteration("dev_to_ga", "firstOpen=DEVELOPER", "secondOpen=GENERAL_AVAILABILITY"),
Iteration("alpha_to_testing", "firstOpen=ALPHA", "secondOpen=TESTING"),
Iteration("alpha_to_dev", "firstOpen=ALPHA", "secondOpen=DEVELOPER"),
Iteration("alpha_to_alpha", "firstOpen=ALPHA", "secondOpen=ALPHA"),
Iteration("beta_to_testing", "firstOpen=BETA", "secondOpen=TESTING"),
Iteration("beta_to_dev", "firstOpen=BETA", "secondOpen=DEVELOPER"),
Iteration("beta_to_alpha", "firstOpen=BETA", "secondOpen=ALPHA"),
Iteration("beta_to_beta", "firstOpen=BETA", "secondOpen=BETA"),
Iteration("ga_to_testing", "firstOpen=GENERAL_AVAILABILITY", "secondOpen=TESTING"),
Iteration("ga_to_dev", "firstOpen=GENERAL_AVAILABILITY", "secondOpen=DEVELOPER"),
Iteration("ga_to_alpha", "firstOpen=GENERAL_AVAILABILITY", "secondOpen=ALPHA"),
Iteration("ga_to_ga", "firstOpen=GENERAL_AVAILABILITY", "secondOpen=GENERAL_AVAILABILITY")
)
@Iteration("testing_to_testing", "firstOpen=TESTING", "secondOpen=TESTING")
@Iteration("testing_to_dev", "firstOpen=TESTING", "secondOpen=DEVELOPER")
@Iteration("testing_to_alpha", "firstOpen=TESTING", "secondOpen=ALPHA")
@Iteration("testing_to_ga", "firstOpen=TESTING", "secondOpen=GENERAL_AVAILABILITY")
@Iteration("dev_to_testing", "firstOpen=DEVELOPER", "secondOpen=TESTING")
@Iteration("dev_to_dev", "firstOpen=DEVELOPER", "secondOpen=DEVELOPER")
@Iteration("dev_to_alpha", "firstOpen=DEVELOPER", "secondOpen=ALPHA")
@Iteration("dev_to_ga", "firstOpen=DEVELOPER", "secondOpen=GENERAL_AVAILABILITY")
@Iteration("alpha_to_testing", "firstOpen=ALPHA", "secondOpen=TESTING")
@Iteration("alpha_to_dev", "firstOpen=ALPHA", "secondOpen=DEVELOPER")
@Iteration("alpha_to_alpha", "firstOpen=ALPHA", "secondOpen=ALPHA")
@Iteration("beta_to_testing", "firstOpen=BETA", "secondOpen=TESTING")
@Iteration("beta_to_dev", "firstOpen=BETA", "secondOpen=DEVELOPER")
@Iteration("beta_to_alpha", "firstOpen=BETA", "secondOpen=ALPHA")
@Iteration("beta_to_beta", "firstOpen=BETA", "secondOpen=BETA")
@Iteration("ga_to_testing", "firstOpen=GENERAL_AVAILABILITY", "secondOpen=TESTING")
@Iteration("ga_to_dev", "firstOpen=GENERAL_AVAILABILITY", "secondOpen=DEVELOPER")
@Iteration("ga_to_alpha", "firstOpen=GENERAL_AVAILABILITY", "secondOpen=ALPHA")
@Iteration("ga_to_ga", "firstOpen=GENERAL_AVAILABILITY", "secondOpen=GENERAL_AVAILABILITY")
fun testSplashActivity_onboarded_ignoredFlavorTransitions_routesToProfileChooser() {
simulateAppAlreadyOnboardedWithFlavor(firstOpenFlavor)

Expand All @@ -817,33 +800,31 @@ class SplashActivityTest {
}

@Test
@RunParameterized(
Iteration("testing_to_testing", "firstOpen=TESTING", "secondOpen=TESTING"),
Iteration("testing_to_dev", "firstOpen=TESTING", "secondOpen=DEVELOPER"),
Iteration("testing_to_alpha", "firstOpen=TESTING", "secondOpen=ALPHA"),
Iteration("testing_to_beta", "firstOpen=TESTING", "secondOpen=BETA"),
Iteration("testing_to_ga", "firstOpen=TESTING", "secondOpen=GENERAL_AVAILABILITY"),
Iteration("dev_to_testing", "firstOpen=DEVELOPER", "secondOpen=TESTING"),
Iteration("dev_to_dev", "firstOpen=DEVELOPER", "secondOpen=DEVELOPER"),
Iteration("dev_to_alpha", "firstOpen=DEVELOPER", "secondOpen=ALPHA"),
Iteration("dev_to_beta", "firstOpen=DEVELOPER", "secondOpen=BETA"),
Iteration("dev_to_ga", "firstOpen=DEVELOPER", "secondOpen=GENERAL_AVAILABILITY"),
Iteration("alpha_to_testing", "firstOpen=ALPHA", "secondOpen=TESTING"),
Iteration("alpha_to_dev", "firstOpen=ALPHA", "secondOpen=DEVELOPER"),
Iteration("alpha_to_alpha", "firstOpen=ALPHA", "secondOpen=ALPHA"),
Iteration("alpha_to_beta", "firstOpen=ALPHA", "secondOpen=BETA"),
Iteration("alpha_to_ga", "firstOpen=ALPHA", "secondOpen=GENERAL_AVAILABILITY"),
Iteration("beta_to_testing", "firstOpen=BETA", "secondOpen=TESTING"),
Iteration("beta_to_dev", "firstOpen=BETA", "secondOpen=DEVELOPER"),
Iteration("beta_to_alpha", "firstOpen=BETA", "secondOpen=ALPHA"),
Iteration("beta_to_beta", "firstOpen=BETA", "secondOpen=BETA"),
Iteration("beta_to_ga", "firstOpen=BETA", "secondOpen=GENERAL_AVAILABILITY"),
Iteration("ga_to_testing", "firstOpen=GENERAL_AVAILABILITY", "secondOpen=TESTING"),
Iteration("ga_to_dev", "firstOpen=GENERAL_AVAILABILITY", "secondOpen=DEVELOPER"),
Iteration("ga_to_alpha", "firstOpen=GENERAL_AVAILABILITY", "secondOpen=ALPHA"),
Iteration("ga_to_beta", "firstOpen=GENERAL_AVAILABILITY", "secondOpen=BETA"),
Iteration("ga_to_ga", "firstOpen=GENERAL_AVAILABILITY", "secondOpen=GENERAL_AVAILABILITY")
)
@Iteration("testing_to_testing", "firstOpen=TESTING", "secondOpen=TESTING")
@Iteration("testing_to_dev", "firstOpen=TESTING", "secondOpen=DEVELOPER")
@Iteration("testing_to_alpha", "firstOpen=TESTING", "secondOpen=ALPHA")
@Iteration("testing_to_beta", "firstOpen=TESTING", "secondOpen=BETA")
@Iteration("testing_to_ga", "firstOpen=TESTING", "secondOpen=GENERAL_AVAILABILITY")
@Iteration("dev_to_testing", "firstOpen=DEVELOPER", "secondOpen=TESTING")
@Iteration("dev_to_dev", "firstOpen=DEVELOPER", "secondOpen=DEVELOPER")
@Iteration("dev_to_alpha", "firstOpen=DEVELOPER", "secondOpen=ALPHA")
@Iteration("dev_to_beta", "firstOpen=DEVELOPER", "secondOpen=BETA")
@Iteration("dev_to_ga", "firstOpen=DEVELOPER", "secondOpen=GENERAL_AVAILABILITY")
@Iteration("alpha_to_testing", "firstOpen=ALPHA", "secondOpen=TESTING")
@Iteration("alpha_to_dev", "firstOpen=ALPHA", "secondOpen=DEVELOPER")
@Iteration("alpha_to_alpha", "firstOpen=ALPHA", "secondOpen=ALPHA")
@Iteration("alpha_to_beta", "firstOpen=ALPHA", "secondOpen=BETA")
@Iteration("alpha_to_ga", "firstOpen=ALPHA", "secondOpen=GENERAL_AVAILABILITY")
@Iteration("beta_to_testing", "firstOpen=BETA", "secondOpen=TESTING")
@Iteration("beta_to_dev", "firstOpen=BETA", "secondOpen=DEVELOPER")
@Iteration("beta_to_alpha", "firstOpen=BETA", "secondOpen=ALPHA")
@Iteration("beta_to_beta", "firstOpen=BETA", "secondOpen=BETA")
@Iteration("beta_to_ga", "firstOpen=BETA", "secondOpen=GENERAL_AVAILABILITY")
@Iteration("ga_to_testing", "firstOpen=GENERAL_AVAILABILITY", "secondOpen=TESTING")
@Iteration("ga_to_dev", "firstOpen=GENERAL_AVAILABILITY", "secondOpen=DEVELOPER")
@Iteration("ga_to_alpha", "firstOpen=GENERAL_AVAILABILITY", "secondOpen=ALPHA")
@Iteration("ga_to_beta", "firstOpen=GENERAL_AVAILABILITY", "secondOpen=BETA")
@Iteration("ga_to_ga", "firstOpen=GENERAL_AVAILABILITY", "secondOpen=GENERAL_AVAILABILITY")
fun testSplashActivity_appDeprecated_allFlavorTransitions_showsDeprecationNotice() {
simulateAppAlreadyOnboardedWithFlavor(firstOpenFlavor)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ import org.oppia.android.testing.junit.InitializeDefaultLocaleRule
import org.oppia.android.testing.junit.OppiaParameterizedTestRunner
import org.oppia.android.testing.junit.OppiaParameterizedTestRunner.Iteration
import org.oppia.android.testing.junit.OppiaParameterizedTestRunner.Parameter
import org.oppia.android.testing.junit.OppiaParameterizedTestRunner.RunParameterized
import org.oppia.android.testing.junit.OppiaParameterizedTestRunner.SelectRunnerPlatform
import org.oppia.android.testing.junit.ParameterizedRobolectricTestRunner
import org.oppia.android.testing.robolectric.RobolectricModule
Expand Down Expand Up @@ -492,16 +491,14 @@ class AppLanguageResourceHandlerTest {
// testing functionality that's expected to go away with later language selection work.
// TODO(#3793): Remove this once OppiaLanguage is used as the source of truth.
@Test
@RunParameterized(
Iteration("hi", "lang=HINDI_AUDIO_LANGUAGE", "expectedDisplayText=हिन्दी"),
Iteration("fr", "lang=FRENCH_AUDIO_LANGUAGE", "expectedDisplayText=Français"),
Iteration("zh", "lang=CHINESE_AUDIO_LANGUAGE", "expectedDisplayText=中文"),
Iteration("pr-pt", "lang=BRAZILIAN_PORTUGUESE_LANGUAGE", "expectedDisplayText=Português"),
Iteration("unsp", "lang=AUDIO_LANGUAGE_UNSPECIFIED", "expectedDisplayText=English"),
Iteration("none", "lang=NO_AUDIO", "expectedDisplayText=English"),
Iteration("unknown", "lang=UNRECOGNIZED", "expectedDisplayText=English"),
Iteration("en", "lang=ENGLISH_AUDIO_LANGUAGE", "expectedDisplayText=English")
)
@Iteration("hi", "lang=HINDI_AUDIO_LANGUAGE", "expectedDisplayText=हिन्दी")
@Iteration("fr", "lang=FRENCH_AUDIO_LANGUAGE", "expectedDisplayText=Français")
@Iteration("zh", "lang=CHINESE_AUDIO_LANGUAGE", "expectedDisplayText=中文")
@Iteration("pr-pt", "lang=BRAZILIAN_PORTUGUESE_LANGUAGE", "expectedDisplayText=Português")
@Iteration("unsp", "lang=AUDIO_LANGUAGE_UNSPECIFIED", "expectedDisplayText=English")
@Iteration("none", "lang=NO_AUDIO", "expectedDisplayText=English")
@Iteration("unknown", "lang=UNRECOGNIZED", "expectedDisplayText=English")
@Iteration("en", "lang=ENGLISH_AUDIO_LANGUAGE", "expectedDisplayText=English")
fun testComputeLocalizedDisplayName_englishLocale_forAllLanguages_hasTheExpectedOutput() {
updateAppLanguageTo(OppiaLanguage.ENGLISH)
val handler = retrieveAppLanguageResourceHandler()
Expand Down
Loading

0 comments on commit e44b59d

Please sign in to comment.