Skip to content

Commit

Permalink
Add test for updating classroomId twice
Browse files Browse the repository at this point in the history
  • Loading branch information
theMr17 committed Jun 26, 2024
1 parent afd7251 commit b4d6bd5
Showing 1 changed file with 30 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1194,6 +1194,36 @@ class ProfileManagementControllerTest {
assertThat(lastSelectedClassroomId).isEqualTo(TEST_CLASSROOM_ID_1)
}

@Test
fun testFetchLastSelectedClassroomId_updateClassroomIdTwice_checkUpdateIsSuccessful() {
setUpTestApplicationComponent()
addTestProfiles()

monitorFactory.ensureDataProviderExecutes(
profileManagementController.loginToProfile(PROFILE_ID_0)
)

monitorFactory.waitForNextSuccessfulResult(
profileManagementController.updateLastSelectedClassroomId(
PROFILE_ID_0,
TEST_CLASSROOM_ID_1
)
)

monitorFactory.waitForNextSuccessfulResult(
profileManagementController.updateLastSelectedClassroomId(
PROFILE_ID_0,
TEST_CLASSROOM_ID_2
)
)

val lastSelectedClassroomId = monitorFactory.waitForNextSuccessfulResult(
profileManagementController.retrieveLastSelectedClassroomId(PROFILE_ID_0)
)

assertThat(lastSelectedClassroomId).isEqualTo(TEST_CLASSROOM_ID_2)
}

@Test
fun testFetchLastSelectedClassroomId_updateClassroomIds_checkUpdateIsSuccessfulPerProfile() {
setUpTestApplicationComponent()
Expand Down

0 comments on commit b4d6bd5

Please sign in to comment.