From c16940a615a74ea470ec8b732dbdda5768234b76 Mon Sep 17 00:00:00 2001 From: yongsuk44 Date: Fri, 10 May 2024 15:15:34 +0900 Subject: [PATCH] Fix reversed follow/unfollow states in InterestsItem-ToggleButton contentDescription. --- .../google/samples/apps/nowinandroid/core/ui/InterestsItem.kt | 4 ++-- .../apps/nowinandroid/interests/InterestsScreenTest.kt | 2 +- .../apps/nowinandroid/feature/search/SearchScreenTest.kt | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/ui/src/main/kotlin/com/google/samples/apps/nowinandroid/core/ui/InterestsItem.kt b/core/ui/src/main/kotlin/com/google/samples/apps/nowinandroid/core/ui/InterestsItem.kt index 28cd8d938..58c4be884 100644 --- a/core/ui/src/main/kotlin/com/google/samples/apps/nowinandroid/core/ui/InterestsItem.kt +++ b/core/ui/src/main/kotlin/com/google/samples/apps/nowinandroid/core/ui/InterestsItem.kt @@ -70,7 +70,7 @@ fun InterestsItem( Icon( imageVector = NiaIcons.Add, contentDescription = stringResource( - id = string.core_ui_interests_card_follow_button_content_desc, + id = string.core_ui_interests_card_unfollow_button_content_desc, ), ) }, @@ -78,7 +78,7 @@ fun InterestsItem( Icon( imageVector = NiaIcons.Check, contentDescription = stringResource( - id = string.core_ui_interests_card_unfollow_button_content_desc, + id = string.core_ui_interests_card_follow_button_content_desc, ), ) }, diff --git a/feature/interests/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/interests/InterestsScreenTest.kt b/feature/interests/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/interests/InterestsScreenTest.kt index a441f5a9d..19baa5cd1 100644 --- a/feature/interests/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/interests/InterestsScreenTest.kt +++ b/feature/interests/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/interests/InterestsScreenTest.kt @@ -93,7 +93,7 @@ class InterestsScreenTest { .assertIsDisplayed() composeTestRule - .onAllNodesWithContentDescription(interestsTopicCardFollowButton) + .onAllNodesWithContentDescription(interestsTopicCardUnfollowButton) .assertCountEquals(numberOfUnfollowedTopics) } diff --git a/feature/search/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchScreenTest.kt b/feature/search/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchScreenTest.kt index a9e2fa98f..432bf7d1f 100644 --- a/feature/search/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchScreenTest.kt +++ b/feature/search/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchScreenTest.kt @@ -157,10 +157,10 @@ class SearchScreenTest { composeTestRule .onAllNodesWithContentDescription(followButtonContentDesc) - .assertCountEquals(2) + .assertCountEquals(1) composeTestRule .onAllNodesWithContentDescription(unfollowButtonContentDesc) - .assertCountEquals(1) + .assertCountEquals(2) } @Test