Loading app/src/androidTest/java/foundation/e/apps/ui/compose/components/SearchResultsContentTest.kt +21 −7 Original line number Diff line number Diff line Loading @@ -28,8 +28,8 @@ import androidx.compose.runtime.setValue import androidx.compose.ui.test.assertCountEquals import androidx.compose.ui.test.assertIsDisplayed import androidx.compose.ui.test.junit4.createAndroidComposeRule import androidx.compose.ui.test.onNodeWithTag import androidx.compose.ui.test.onAllNodesWithText import androidx.compose.ui.test.onNodeWithTag import androidx.compose.ui.test.onNodeWithText import androidx.compose.ui.test.performClick import androidx.paging.LoadState Loading @@ -37,12 +37,6 @@ import androidx.paging.LoadStates import androidx.paging.PagingData import androidx.paging.compose.collectAsLazyPagingItems import androidx.test.ext.junit.runners.AndroidJUnit4 import kotlinx.coroutines.flow.flowOf import org.junit.Assert.assertEquals import org.junit.Assert.assertTrue import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith import foundation.e.apps.R import foundation.e.apps.data.application.data.Application import foundation.e.apps.data.application.data.Ratings Loading @@ -53,6 +47,12 @@ import foundation.e.apps.ui.compose.state.InstallButtonAction import foundation.e.apps.ui.compose.state.InstallButtonState import foundation.e.apps.ui.compose.theme.AppTheme import foundation.e.apps.ui.search.v2.SearchTabType import kotlinx.coroutines.flow.flowOf import org.junit.Assert.assertEquals import org.junit.Assert.assertTrue import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith import java.util.Locale @RunWith(AndroidJUnit4::class) Loading Loading @@ -86,6 +86,20 @@ class SearchResultsContentTest { composeRule.onAllNodesWithText(noAppsText).assertCountEquals(0) } @Test fun singleTabSelection_rendersContentWithoutTabs() { val openSourceLabel = composeRule.activity.getString(R.string.search_tab_open_source) renderSearchResults( tabs = listOf(SearchTabType.OPEN_SOURCE), selectedTab = SearchTabType.OPEN_SOURCE, fossPagingData = pagingData(listOf(sampleApp("Single Tab App"))), ) composeRule.onNodeWithText("Single Tab App").assertIsDisplayed() composeRule.onAllNodesWithText(openSourceLabel).assertCountEquals(0) } @Test fun tabSelection_updatesDisplayedResults() { val selectedTabs = mutableListOf<SearchTabType>() Loading Loading
app/src/androidTest/java/foundation/e/apps/ui/compose/components/SearchResultsContentTest.kt +21 −7 Original line number Diff line number Diff line Loading @@ -28,8 +28,8 @@ import androidx.compose.runtime.setValue import androidx.compose.ui.test.assertCountEquals import androidx.compose.ui.test.assertIsDisplayed import androidx.compose.ui.test.junit4.createAndroidComposeRule import androidx.compose.ui.test.onNodeWithTag import androidx.compose.ui.test.onAllNodesWithText import androidx.compose.ui.test.onNodeWithTag import androidx.compose.ui.test.onNodeWithText import androidx.compose.ui.test.performClick import androidx.paging.LoadState Loading @@ -37,12 +37,6 @@ import androidx.paging.LoadStates import androidx.paging.PagingData import androidx.paging.compose.collectAsLazyPagingItems import androidx.test.ext.junit.runners.AndroidJUnit4 import kotlinx.coroutines.flow.flowOf import org.junit.Assert.assertEquals import org.junit.Assert.assertTrue import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith import foundation.e.apps.R import foundation.e.apps.data.application.data.Application import foundation.e.apps.data.application.data.Ratings Loading @@ -53,6 +47,12 @@ import foundation.e.apps.ui.compose.state.InstallButtonAction import foundation.e.apps.ui.compose.state.InstallButtonState import foundation.e.apps.ui.compose.theme.AppTheme import foundation.e.apps.ui.search.v2.SearchTabType import kotlinx.coroutines.flow.flowOf import org.junit.Assert.assertEquals import org.junit.Assert.assertTrue import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith import java.util.Locale @RunWith(AndroidJUnit4::class) Loading Loading @@ -86,6 +86,20 @@ class SearchResultsContentTest { composeRule.onAllNodesWithText(noAppsText).assertCountEquals(0) } @Test fun singleTabSelection_rendersContentWithoutTabs() { val openSourceLabel = composeRule.activity.getString(R.string.search_tab_open_source) renderSearchResults( tabs = listOf(SearchTabType.OPEN_SOURCE), selectedTab = SearchTabType.OPEN_SOURCE, fossPagingData = pagingData(listOf(sampleApp("Single Tab App"))), ) composeRule.onNodeWithText("Single Tab App").assertIsDisplayed() composeRule.onAllNodesWithText(openSourceLabel).assertCountEquals(0) } @Test fun tabSelection_updatesDisplayedResults() { val selectedTabs = mutableListOf<SearchTabType>() Loading