fix(home): 모두 팔로우 완료 상태를 반영한다

This commit is contained in:
2026-06-04 17:59:29 +09:00
parent 3e8ea0473f
commit 02480a96e9
3 changed files with 62 additions and 4 deletions

View File

@@ -19,6 +19,7 @@ import kr.co.vividnext.sodalive.v2.main.home.model.HomeRecommendationFirstAudioC
import kr.co.vividnext.sodalive.v2.main.home.model.HomeRecommendationLiveUiModel
import kr.co.vividnext.sodalive.v2.main.home.ui.HomeAiCharacterAdapter
import kr.co.vividnext.sodalive.v2.main.home.ui.HomeFirstAudioAdapter
import kr.co.vividnext.sodalive.v2.main.home.ui.HomeFollowAllButtonBinder
import kr.co.vividnext.sodalive.v2.main.home.ui.HomeLiveAdapter
import kr.co.vividnext.sodalive.v2.main.home.ui.HomeRecentDebutCreatorAdapter
import kr.co.vividnext.sodalive.v2.widget.AudioContentCardView
@@ -112,6 +113,49 @@ class HomeMainFragmentLayoutTest {
assertNotNull(followAllButton.findViewById<TextView>(R.id.tv_home_follow_all))
}
@Test
fun `follow all button default state matches figma active capsule`() {
val context = ApplicationProvider.getApplicationContext<Context>()
val followAllButton = inflateView(R.layout.view_home_follow_all_button)
val icon = followAllButton.findViewById<ImageView>(R.id.iv_home_follow_all_icon)
val text = followAllButton.findViewById<TextView>(R.id.tv_home_follow_all)
HomeFollowAllButtonBinder.bind(
view = followAllButton,
creatorIds = listOf(1L),
isFollowCompleted = false,
onClick = {}
)
assertEquals(R.drawable.ic_new_follow, shadowOf(icon.drawable).createdFromResId)
assertEquals(R.drawable.bg_home_follow_all_button, shadowOf(followAllButton.background).createdFromResId)
assertEquals(context.getString(R.string.home_recommendation_follow_all), text.text.toString())
assertEquals(context.getColor(R.color.white), text.currentTextColor)
}
@Test
fun `follow all button completed state matches figma completed capsule and ignores clicks`() {
val context = ApplicationProvider.getApplicationContext<Context>()
val followAllButton = inflateView(R.layout.view_home_follow_all_button)
val icon = followAllButton.findViewById<ImageView>(R.id.iv_home_follow_all_icon)
val text = followAllButton.findViewById<TextView>(R.id.tv_home_follow_all)
var clickCount = 0
HomeFollowAllButtonBinder.bind(
view = followAllButton,
creatorIds = listOf(1L),
isFollowCompleted = true,
onClick = { clickCount += 1 }
)
followAllButton.performClick()
assertEquals(R.drawable.ic_new_following, shadowOf(icon.drawable).createdFromResId)
assertEquals(R.drawable.bg_round_corner_999_white, shadowOf(followAllButton.background).createdFromResId)
assertEquals(context.getString(R.string.home_recommendation_follow_all_done), text.text.toString())
assertEquals(context.getColor(R.color.black), text.currentTextColor)
assertEquals(0, clickCount)
}
@Test
fun `recent activity creator item matches figma capsule dimensions`() {
val recentActivity = inflateViewWithParent(R.layout.item_home_recent_activity_creator)