diff --git a/WordPress/src/test/java/org/wordpress/android/ui/stats/refresh/lists/sections/insights/management/InsightsManagementMapperTest.kt b/WordPress/src/test/java/org/wordpress/android/ui/stats/refresh/lists/sections/insights/management/InsightsManagementMapperTest.kt index b1b0a69db246..14e5bf6c057d 100644 --- a/WordPress/src/test/java/org/wordpress/android/ui/stats/refresh/lists/sections/insights/management/InsightsManagementMapperTest.kt +++ b/WordPress/src/test/java/org/wordpress/android/ui/stats/refresh/lists/sections/insights/management/InsightsManagementMapperTest.kt @@ -4,6 +4,7 @@ import kotlinx.coroutines.ExperimentalCoroutinesApi import org.assertj.core.api.Assertions.assertThat import org.junit.Before import org.junit.Test +import org.mockito.Mock import org.wordpress.android.BaseUnitTest import org.wordpress.android.R import org.wordpress.android.fluxc.store.StatsStore.InsightType @@ -16,22 +17,26 @@ import org.wordpress.android.fluxc.store.StatsStore.InsightType.MOST_POPULAR_DAY import org.wordpress.android.fluxc.store.StatsStore.InsightType.POSTING_ACTIVITY import org.wordpress.android.fluxc.store.StatsStore.InsightType.PUBLICIZE import org.wordpress.android.fluxc.store.StatsStore.InsightType.TAGS_AND_CATEGORIES -import org.wordpress.android.fluxc.store.StatsStore.InsightType.TODAY_STATS import org.wordpress.android.ui.stats.refresh.lists.sections.insights.management.InsightsManagementViewModel.InsightListItem import org.wordpress.android.ui.stats.refresh.lists.sections.insights.management.InsightsManagementViewModel.InsightListItem.Header import org.wordpress.android.ui.stats.refresh.lists.sections.insights.management.InsightsManagementViewModel.InsightListItem.InsightModel import org.wordpress.android.ui.stats.refresh.lists.sections.insights.management.InsightsManagementViewModel.InsightListItem.InsightModel.Status +import org.wordpress.android.util.config.StatsTrafficTabFeatureConfig @ExperimentalCoroutinesApi class InsightsManagementMapperTest : BaseUnitTest() { + @Mock + private lateinit var trafficTabFeatureConfig: StatsTrafficTabFeatureConfig + private lateinit var insightsManagementMapper: InsightsManagementMapper - private val insightTypeCount = 10 // POSTS_AND_PAGES_INSIGHTS.size + ACTIVITY_INSIGHTS.size + GENERAL_INSIGHTS.size + private var insightTypeCount = 9 // POSTS_AND_PAGES_INSIGHTS.size + ACTIVITY_INSIGHTS.size + GENERAL_INSIGHTS.size private val sectionsCount = 3 @Before fun setUp() { insightsManagementMapper = InsightsManagementMapper( - testDispatcher() + testDispatcher(), + trafficTabFeatureConfig ) } @@ -49,15 +54,14 @@ class InsightsManagementMapperTest : BaseUnitTest() { assertInsight(result[1], ALL_TIME_STATS, true) assertInsight(result[2], MOST_POPULAR_DAY_AND_HOUR, true) assertInsight(result[3], ANNUAL_SITE_STATS, true) - assertInsight(result[4], TODAY_STATS, true) - assertHeader(result[5], R.string.stats_insights_management_posts_and_pages) - assertInsight(result[6], LATEST_POST_SUMMARY, true) - assertInsight(result[7], POSTING_ACTIVITY, true) - assertInsight(result[8], TAGS_AND_CATEGORIES, true) - assertHeader(result[9], R.string.stats_insights_management_activity) - assertInsight(result[10], FOLLOWERS, true) - assertInsight(result[11], FOLLOWER_TOTALS, true) - assertInsight(result[12], PUBLICIZE, true) + assertHeader(result[4], R.string.stats_insights_management_posts_and_pages) + assertInsight(result[5], LATEST_POST_SUMMARY, true) + assertInsight(result[6], POSTING_ACTIVITY, true) + assertInsight(result[7], TAGS_AND_CATEGORIES, true) + assertHeader(result[8], R.string.stats_insights_management_activity) + assertInsight(result[9], FOLLOWERS, true) + assertInsight(result[10], FOLLOWER_TOTALS, true) + assertInsight(result[11], PUBLICIZE, true) } @Test @@ -74,15 +78,14 @@ class InsightsManagementMapperTest : BaseUnitTest() { assertInsight(result[1], ALL_TIME_STATS, true) assertInsight(result[2], MOST_POPULAR_DAY_AND_HOUR, false) assertInsight(result[3], ANNUAL_SITE_STATS, false) - assertInsight(result[4], TODAY_STATS, false) - assertHeader(result[5], R.string.stats_insights_management_posts_and_pages) - assertInsight(result[6], LATEST_POST_SUMMARY, false) - assertInsight(result[7], POSTING_ACTIVITY, false) - assertInsight(result[8], TAGS_AND_CATEGORIES, false) - assertHeader(result[9], R.string.stats_insights_management_activity) - assertInsight(result[10], FOLLOWERS, false) - assertInsight(result[11], FOLLOWER_TOTALS, false) - assertInsight(result[12], PUBLICIZE, true) + assertHeader(result[4], R.string.stats_insights_management_posts_and_pages) + assertInsight(result[5], LATEST_POST_SUMMARY, false) + assertInsight(result[6], POSTING_ACTIVITY, false) + assertInsight(result[7], TAGS_AND_CATEGORIES, false) + assertHeader(result[8], R.string.stats_insights_management_activity) + assertInsight(result[9], FOLLOWERS, false) + assertInsight(result[10], FOLLOWER_TOTALS, false) + assertInsight(result[11], PUBLICIZE, true) } @Test @@ -96,15 +99,14 @@ class InsightsManagementMapperTest : BaseUnitTest() { assertInsight(result[1], ALL_TIME_STATS, false) assertInsight(result[2], MOST_POPULAR_DAY_AND_HOUR, false) assertInsight(result[3], ANNUAL_SITE_STATS, false) - assertInsight(result[4], TODAY_STATS, false) - assertHeader(result[5], R.string.stats_insights_management_posts_and_pages) - assertInsight(result[6], LATEST_POST_SUMMARY, false) - assertInsight(result[7], POSTING_ACTIVITY, false) - assertInsight(result[8], TAGS_AND_CATEGORIES, false) - assertHeader(result[9], R.string.stats_insights_management_activity) - assertInsight(result[10], FOLLOWERS, false) - assertInsight(result[11], FOLLOWER_TOTALS, false) - assertInsight(result[12], PUBLICIZE, false) + assertHeader(result[4], R.string.stats_insights_management_posts_and_pages) + assertInsight(result[5], LATEST_POST_SUMMARY, false) + assertInsight(result[6], POSTING_ACTIVITY, false) + assertInsight(result[7], TAGS_AND_CATEGORIES, false) + assertHeader(result[8], R.string.stats_insights_management_activity) + assertInsight(result[9], FOLLOWERS, false) + assertInsight(result[10], FOLLOWER_TOTALS, false) + assertInsight(result[11], PUBLICIZE, false) } private fun assertHeader(item: InsightListItem, text: Int) {