diff --git a/app/src/sharedTest/java/org/oppia/android/app/home/HomeActivityTest.kt b/app/src/sharedTest/java/org/oppia/android/app/home/HomeActivityTest.kt index f5e058dfb62..771d5456801 100644 --- a/app/src/sharedTest/java/org/oppia/android/app/home/HomeActivityTest.kt +++ b/app/src/sharedTest/java/org/oppia/android/app/home/HomeActivityTest.kt @@ -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, @@ -1344,11 +1345,55 @@ class HomeActivityTest { launch(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(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(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(createHomeActivityIntent(internalProfileId)).use { + testCoroutineDispatchers.runCurrent() + scrollToPosition(position = 3) + verifyHomeRecyclerViewHasGridColumnCount(columnCount = 4) } }