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 2 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_mobilePortraitDisplaysAllTopicCardsIn2Columns() {
deonwaju marked this conversation as resolved.
Show resolved Hide resolved
fakeOppiaClock.setFakeTimeMode(FakeOppiaClock.FakeTimeMode.MODE_UPTIME_MILLIS)
storyProgressTestHelper.markAllTopicsAsCompleted(
profileId = profileId,
Expand All @@ -1352,6 +1353,58 @@ class HomeActivityTest {
}
}

@Config(qualifiers = "+land")
@Test
fun testHomeActivity_allTopicsCompleted_mobileLandscapeDisplaysAllTopicCardsIn3Columns() {
adhiamboperes marked this conversation as resolved.
Show resolved Hide resolved
fakeOppiaClock.setFakeTimeMode(FakeOppiaClock.FakeTimeMode.MODE_UPTIME_MILLIS)
storyProgressTestHelper.markAllTopicsAsCompleted(
profileId = profileId,
timestampOlderThanOneWeek = false
)
logIntoAdminTwice()
launch<HomeActivity>(createHomeActivityIntent(internalProfileId)).use {
testCoroutineDispatchers.runCurrent()
scrollToPosition(position = 3)
if (context.resources.getBoolean(R.bool.isTablet)) {
verifyHomeRecyclerViewHasGridColumnCount(columnCount = 4)
} else {
verifyHomeRecyclerViewHasGridColumnCount(columnCount = 3)
}
}
}

@Config(qualifiers = "+sw600dp-port")
@Test
fun testHomeActivity_allTopicsCompleted_tabletPortraitDisplaysAllTopicCardsIn3Columns() {
deonwaju marked this conversation as resolved.
Show resolved Hide resolved
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_tabletLandscapeDisplaysAllTopicCardsIn4Columns() {
deonwaju marked this conversation as resolved.
Show resolved Hide resolved
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)
}
}

@Test
fun testHomeActivity_noTopicsCompleted_displaysAllTopicsHeader() {
// Only new users will have no progress for any topics.
Expand Down
Loading