Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #2587: testHomeActivity_allTopicsCompleted_displaysAllTopicCards() test not working #5330

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1333,8 +1333,9 @@ class HomeActivityTest {
}
}

@Config(qualifiers = "+port")
@Test
fun testHomeActivity_allTopicsCompleted_displaysAllTopicCards() {
fun testHomeActivity_allTopicsCompleted_mobilePortrait_displaysAllTopicCardsIn2Columns() {
fakeOppiaClock.setFakeTimeMode(FakeOppiaClock.FakeTimeMode.MODE_UPTIME_MILLIS)
storyProgressTestHelper.markAllTopicsAsCompleted(
profileId = profileId,
Expand All @@ -1344,11 +1345,55 @@ class HomeActivityTest {
launch<HomeActivity>(createHomeActivityIntent(internalProfileId)).use {
testCoroutineDispatchers.runCurrent()
scrollToPosition(position = 3)
if (context.resources.getBoolean(R.bool.isTablet)) {
verifyHomeRecyclerViewHasGridColumnCount(columnCount = 3)
} else {
verifyHomeRecyclerViewHasGridColumnCount(columnCount = 2)
}
verifyHomeRecyclerViewHasGridColumnCount(columnCount = 2)
}
}

@Config(qualifiers = "+land")
@Test
fun testHomeActivity_allTopicsCompleted_mobileLandscape_displaysAllTopicCardsIn3Columns() {
fakeOppiaClock.setFakeTimeMode(FakeOppiaClock.FakeTimeMode.MODE_UPTIME_MILLIS)
storyProgressTestHelper.markAllTopicsAsCompleted(
profileId = profileId,
timestampOlderThanOneWeek = false
)
logIntoAdminTwice()
launch<HomeActivity>(createHomeActivityIntent(internalProfileId)).use {
testCoroutineDispatchers.runCurrent()
scrollToPosition(position = 3)
verifyHomeRecyclerViewHasGridColumnCount(columnCount = 3)
}
}

@Config(qualifiers = "+sw600dp-port")
@Test
fun testHomeActivity_allTopicsCompleted_tabletPortrait_displaysAllTopicCardsIn3Columns() {
fakeOppiaClock.setFakeTimeMode(FakeOppiaClock.FakeTimeMode.MODE_UPTIME_MILLIS)
storyProgressTestHelper.markAllTopicsAsCompleted(
profileId = profileId,
timestampOlderThanOneWeek = false
)
logIntoAdminTwice()
launch<HomeActivity>(createHomeActivityIntent(internalProfileId)).use {
testCoroutineDispatchers.runCurrent()
scrollToPosition(position = 3)
verifyHomeRecyclerViewHasGridColumnCount(columnCount = 3)
}
}

@Config(qualifiers = "+sw600dp-land")
@Test
fun testHomeActivity_allTopicsCompleted_tabletLandscape_displaysAllTopicCardsIn4Columns() {
fakeOppiaClock.setFakeTimeMode(FakeOppiaClock.FakeTimeMode.MODE_UPTIME_MILLIS)
storyProgressTestHelper.markAllTopicsAsCompleted(
profileId = profileId,
timestampOlderThanOneWeek = false
)
logIntoAdminTwice()
launch<HomeActivity>(createHomeActivityIntent(internalProfileId)).use {
testCoroutineDispatchers.runCurrent()
scrollToPosition(position = 3)
verifyHomeRecyclerViewHasGridColumnCount(columnCount = 4)
}
}

Expand Down
Loading