Skip to content

Commit

Permalink
Fix broken test
Browse files Browse the repository at this point in the history
  • Loading branch information
adhiamboperes committed Aug 27, 2024
1 parent 99913bb commit 982d6f5
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import android.view.ViewGroup
import androidx.appcompat.app.AppCompatActivity
import androidx.fragment.app.Fragment
import org.oppia.android.app.model.CreateProfileActivityParams
import org.oppia.android.app.model.ProfileChooserActivityParams
import org.oppia.android.app.model.ProfileId
import org.oppia.android.app.model.ProfileType
import org.oppia.android.app.profile.ProfileChooserActivity
import org.oppia.android.databinding.OnboardingProfileTypeFragmentBinding
import org.oppia.android.util.extensions.putProtoExtra
import org.oppia.android.util.profile.CurrentUserProfileIdIntentDecorator.decorateWithUserProfileId
import javax.inject.Inject
import org.oppia.android.app.model.ProfileChooserActivityParams

/** Argument key for [CreateProfileActivity] intent parameters. */
const val CREATE_PROFILE_PARAMS_KEY = "CreateProfileActivity.params"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@ import android.content.Intent
import android.os.Bundle
import org.oppia.android.app.activity.ActivityComponentImpl
import org.oppia.android.app.activity.InjectableSystemLocalizedAppCompatActivity
import org.oppia.android.app.model.ScreenName.PROFILE_CHOOSER_ACTIVITY
import org.oppia.android.util.logging.CurrentAppScreenNameIntentDecorator.decorateWithScreenName
import javax.inject.Inject
import org.oppia.android.app.model.CreateProfileActivityParams
import org.oppia.android.app.model.ProfileChooserActivityParams
import org.oppia.android.app.onboarding.CREATE_PROFILE_PARAMS_KEY
import org.oppia.android.app.model.ScreenName.PROFILE_CHOOSER_ACTIVITY
import org.oppia.android.app.onboarding.PROFILE_CHOOSER_PARAMS_KEY
import org.oppia.android.util.extensions.getProtoExtra
import org.oppia.android.util.logging.CurrentAppScreenNameIntentDecorator.decorateWithScreenName
import org.oppia.android.util.profile.CurrentUserProfileIdIntentDecorator.extractCurrentUserProfileId
import javax.inject.Inject

/** Activity that controls profile creation and selection. */
class ProfileChooserActivity : InjectableSystemLocalizedAppCompatActivity() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ package org.oppia.android.app.profile
import androidx.appcompat.app.AppCompatActivity
import org.oppia.android.R
import org.oppia.android.app.activity.ActivityScope
import org.oppia.android.app.testing.ProfileChooserFragmentTestActivity
import org.oppia.android.domain.profile.ProfileManagementController
import javax.inject.Inject
import org.oppia.android.app.model.ProfileId
import org.oppia.android.app.model.ProfileType
import org.oppia.android.app.testing.ProfileChooserFragmentTestActivity
import org.oppia.android.domain.profile.ProfileManagementController
import org.oppia.android.util.platformparameter.EnableOnboardingFlowV2
import org.oppia.android.util.platformparameter.PlatformParameterValue
import javax.inject.Inject

/** The presenter for [ProfileChooserActivity]. */
@ActivityScope
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import org.oppia.android.app.home.HomeActivity
import org.oppia.android.app.model.IntroActivityParams
import org.oppia.android.app.model.Profile
import org.oppia.android.app.model.ProfileId
import org.oppia.android.app.model.ProfileType
import org.oppia.android.app.onboarding.IntroActivity
import org.oppia.android.app.recyclerview.BindableAdapter
import org.oppia.android.app.recyclerview.StartSnapHelper
Expand All @@ -38,7 +39,6 @@ import org.oppia.android.util.platformparameter.PlatformParameterValue
import org.oppia.android.util.profile.CurrentUserProfileIdIntentDecorator.decorateWithUserProfileId
import org.oppia.android.util.statusbar.StatusBarColor
import javax.inject.Inject
import org.oppia.android.app.model.ProfileType

private val COLORS_LIST = listOf(
R.color.component_color_avatar_background_1_color,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -651,8 +651,8 @@ class ProfileChooserFragmentTest {
testCoroutineDispatchers.runCurrent()
orientationLandscape()
testCoroutineDispatchers.runCurrent()
onView(withId(R.id.profile_scroll_left)).check(matches(isDisplayed()))
onView(withId(R.id.profile_scroll_right)).check(matches(isDisplayed()))
onView(withId(R.id.profile_list_scroll_left)).check(matches(isDisplayed()))
onView(withId(R.id.profile_list_scroll_right)).check(matches(isDisplayed()))
}
}

Expand All @@ -665,8 +665,8 @@ class ProfileChooserFragmentTest {
testCoroutineDispatchers.runCurrent()
orientationLandscape()
testCoroutineDispatchers.runCurrent()
onView(withId(R.id.profile_scroll_left)).check(matches(not(isDisplayed())))
onView(withId(R.id.profile_scroll_right)).check(matches(not(isDisplayed())))
onView(withId(R.id.profile_list_scroll_left)).check(matches(not(isDisplayed())))
onView(withId(R.id.profile_list_scroll_right)).check(matches(not(isDisplayed())))
}
}

Expand Down

0 comments on commit 982d6f5

Please sign in to comment.