Skip to content

Commit

Permalink
General cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
adhiamboperes committed Jul 18, 2024
1 parent cd25696 commit eb64975
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import org.oppia.android.app.model.AudioLanguage.FRENCH_AUDIO_LANGUAGE
import org.oppia.android.app.model.Profile
import org.oppia.android.app.model.ProfileDatabase
import org.oppia.android.app.model.ProfileId
import org.oppia.android.app.model.ProfileOnboardingState
import org.oppia.android.app.model.ProfileOnboardingMode
import org.oppia.android.app.model.ProfileType
import org.oppia.android.app.model.ReadingTextSize.MEDIUM_TEXT_SIZE
import org.oppia.android.domain.classroom.TEST_CLASSROOM_ID_1
Expand Down Expand Up @@ -1540,25 +1540,25 @@ class ProfileManagementControllerTest {
setUpTestWithOnboardingV2Enabled(true)
addAdminProfileAndWait(name = "James", pin = "")

val profileOnboardingStateProvider = profileManagementController.getProfileOnboardingState()
val profileOnboardingModeProvider = profileManagementController.getProfileOnboardingState()

val profileOnboardingStateResult =
monitorFactory.waitForNextSuccessfulResult(profileOnboardingStateProvider)
val profileOnboardingModeResult =
monitorFactory.waitForNextSuccessfulResult(profileOnboardingModeProvider)

assertThat(profileOnboardingStateResult).isEqualTo(ProfileOnboardingState.SOLE_LEARNER_PROFILE)
assertThat(profileOnboardingModeResult).isEqualTo(ProfileOnboardingMode.SOLE_LEARNER_PROFILE)
}

@Test
fun testProfileOnboardingState_oneAdminProfileWithPassword_returnsAdminOnlyState() {
setUpTestWithOnboardingV2Enabled(true)
addAdminProfileAndWait(name = "James")

val profileOnboardingStateProvider = profileManagementController.getProfileOnboardingState()
val profileOnboardingModeProvider = profileManagementController.getProfileOnboardingState()

val profileOnboardingStateResult =
monitorFactory.waitForNextSuccessfulResult(profileOnboardingStateProvider)
val profileOnboardingModeResult =
monitorFactory.waitForNextSuccessfulResult(profileOnboardingModeProvider)

assertThat(profileOnboardingStateResult).isEqualTo(ProfileOnboardingState.ADMIN_PROFILE_ONLY)
assertThat(profileOnboardingModeResult).isEqualTo(ProfileOnboardingMode.ADMIN_PROFILE_ONLY)
}

@Test
Expand All @@ -1568,24 +1568,24 @@ class ProfileManagementControllerTest {
addNonAdminProfileAndWait(name = "Rajat", pin = "01234")
addNonAdminProfileAndWait(name = "Rohit", pin = "")

val profileOnboardingStateProvider = profileManagementController.getProfileOnboardingState()
val profileOnboardingModeProvider = profileManagementController.getProfileOnboardingState()

val profileOnboardingStateResult =
monitorFactory.waitForNextSuccessfulResult(profileOnboardingStateProvider)
val profileOnboardingModeResult =
monitorFactory.waitForNextSuccessfulResult(profileOnboardingModeProvider)

assertThat(profileOnboardingStateResult).isEqualTo(ProfileOnboardingState.MULTIPLE_PROFILES)
assertThat(profileOnboardingModeResult).isEqualTo(ProfileOnboardingMode.MULTIPLE_PROFILES)
}

@Test
fun testProfileOnboardingState_noProfilesFound_returnsNewInstallState() {
setUpTestWithOnboardingV2Enabled(true)

val profileOnboardingStateProvider = profileManagementController.getProfileOnboardingState()
val profileOnboardingModeProvider = profileManagementController.getProfileOnboardingState()

val profileOnboardingStateResult =
monitorFactory.waitForNextSuccessfulResult(profileOnboardingStateProvider)
val profileOnboardingModeResult =
monitorFactory.waitForNextSuccessfulResult(profileOnboardingModeProvider)

assertThat(profileOnboardingStateResult).isEqualTo(ProfileOnboardingState.NEW_INSTALL)
assertThat(profileOnboardingModeResult).isEqualTo(ProfileOnboardingMode.NEW_INSTALL)
}

@Test
Expand Down
4 changes: 2 additions & 2 deletions model/src/main/proto/oppia_logger.proto
Original file line number Diff line number Diff line change
Expand Up @@ -230,11 +230,11 @@ message EventLog {

// The event being logged indicates that the profile user has started going through the
// onboarding flow.
ProfileOnboardingContext start_profile_onboarding_event = 56;
ProfileOnboardingContext start_profile_onboarding_event = 57;

// The event being logged indicates that the profile user has reached the home screen for the
// first time.
ProfileOnboardingContext end_profile_onboarding_event = 57;
ProfileOnboardingContext end_profile_onboarding_event = 58;
}
}

Expand Down

0 comments on commit eb64975

Please sign in to comment.