|
|
@ -17,7 +17,7 @@
|
|
|
|
package com.google.samples.apps.nowinandroid.feature.foryou
|
|
|
|
package com.google.samples.apps.nowinandroid.feature.foryou
|
|
|
|
|
|
|
|
|
|
|
|
import androidx.activity.ComponentActivity
|
|
|
|
import androidx.activity.ComponentActivity
|
|
|
|
import androidx.compose.foundation.layout.BoxWithConstraints
|
|
|
|
import androidx.compose.foundation.layout.Box
|
|
|
|
import androidx.compose.ui.test.assertHasClickAction
|
|
|
|
import androidx.compose.ui.test.assertHasClickAction
|
|
|
|
import androidx.compose.ui.test.assertIsEnabled
|
|
|
|
import androidx.compose.ui.test.assertIsEnabled
|
|
|
|
import androidx.compose.ui.test.assertIsNotEnabled
|
|
|
|
import androidx.compose.ui.test.assertIsNotEnabled
|
|
|
@ -52,7 +52,7 @@ class ForYouScreenTest {
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
fun circularProgressIndicator_whenScreenIsLoading_exists() {
|
|
|
|
fun circularProgressIndicator_whenScreenIsLoading_exists() {
|
|
|
|
composeTestRule.setContent {
|
|
|
|
composeTestRule.setContent {
|
|
|
|
BoxWithConstraints {
|
|
|
|
Box {
|
|
|
|
ForYouScreen(
|
|
|
|
ForYouScreen(
|
|
|
|
isSyncing = false,
|
|
|
|
isSyncing = false,
|
|
|
|
onboardingUiState = OnboardingUiState.Loading,
|
|
|
|
onboardingUiState = OnboardingUiState.Loading,
|
|
|
@ -78,7 +78,7 @@ class ForYouScreenTest {
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
fun circularProgressIndicator_whenScreenIsSyncing_exists() {
|
|
|
|
fun circularProgressIndicator_whenScreenIsSyncing_exists() {
|
|
|
|
composeTestRule.setContent {
|
|
|
|
composeTestRule.setContent {
|
|
|
|
BoxWithConstraints {
|
|
|
|
Box {
|
|
|
|
ForYouScreen(
|
|
|
|
ForYouScreen(
|
|
|
|
isSyncing = true,
|
|
|
|
isSyncing = true,
|
|
|
|
onboardingUiState = OnboardingUiState.NotShown,
|
|
|
|
onboardingUiState = OnboardingUiState.NotShown,
|
|
|
@ -106,7 +106,7 @@ class ForYouScreenTest {
|
|
|
|
val testData = followableTopicTestData.map { it.copy(isFollowed = false) }
|
|
|
|
val testData = followableTopicTestData.map { it.copy(isFollowed = false) }
|
|
|
|
|
|
|
|
|
|
|
|
composeTestRule.setContent {
|
|
|
|
composeTestRule.setContent {
|
|
|
|
BoxWithConstraints {
|
|
|
|
Box {
|
|
|
|
ForYouScreen(
|
|
|
|
ForYouScreen(
|
|
|
|
isSyncing = false,
|
|
|
|
isSyncing = false,
|
|
|
|
onboardingUiState = OnboardingUiState.Shown(
|
|
|
|
onboardingUiState = OnboardingUiState.Shown(
|
|
|
@ -149,7 +149,7 @@ class ForYouScreenTest {
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
fun topicSelector_whenSomeTopicsSelected_showsTopicChipsAndEnabledDoneButton() {
|
|
|
|
fun topicSelector_whenSomeTopicsSelected_showsTopicChipsAndEnabledDoneButton() {
|
|
|
|
composeTestRule.setContent {
|
|
|
|
composeTestRule.setContent {
|
|
|
|
BoxWithConstraints {
|
|
|
|
Box {
|
|
|
|
ForYouScreen(
|
|
|
|
ForYouScreen(
|
|
|
|
isSyncing = false,
|
|
|
|
isSyncing = false,
|
|
|
|
onboardingUiState =
|
|
|
|
onboardingUiState =
|
|
|
@ -196,7 +196,7 @@ class ForYouScreenTest {
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
fun feed_whenInterestsSelectedAndLoading_showsLoadingIndicator() {
|
|
|
|
fun feed_whenInterestsSelectedAndLoading_showsLoadingIndicator() {
|
|
|
|
composeTestRule.setContent {
|
|
|
|
composeTestRule.setContent {
|
|
|
|
BoxWithConstraints {
|
|
|
|
Box {
|
|
|
|
ForYouScreen(
|
|
|
|
ForYouScreen(
|
|
|
|
isSyncing = false,
|
|
|
|
isSyncing = false,
|
|
|
|
onboardingUiState =
|
|
|
|
onboardingUiState =
|
|
|
@ -223,7 +223,7 @@ class ForYouScreenTest {
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
fun feed_whenNoInterestsSelectionAndLoading_showsLoadingIndicator() {
|
|
|
|
fun feed_whenNoInterestsSelectionAndLoading_showsLoadingIndicator() {
|
|
|
|
composeTestRule.setContent {
|
|
|
|
composeTestRule.setContent {
|
|
|
|
BoxWithConstraints {
|
|
|
|
Box {
|
|
|
|
ForYouScreen(
|
|
|
|
ForYouScreen(
|
|
|
|
isSyncing = false,
|
|
|
|
isSyncing = false,
|
|
|
|
onboardingUiState = OnboardingUiState.NotShown,
|
|
|
|
onboardingUiState = OnboardingUiState.NotShown,
|
|
|
|