fix(home): 팔로잉 empty 문구를 중앙 표시한다

This commit is contained in:
2026-07-13 16:17:12 +09:00
parent da36964347
commit 2c609836fd
3 changed files with 46 additions and 5 deletions
@@ -82,9 +82,9 @@ class HomeFollowingFragmentSourceTest {
assertTrue(source.contains("followingStateLiveData.observe(viewLifecycleOwner)"))
assertTrue(source.contains("is HomeFollowingUiState.Content -> bindHomeFollowingContent(state)"))
assertTrue(source.contains("HomeFollowingUiState.Empty -> bindHomeFollowingEmpty(showEmptyMessage = true)"))
assertTrue(source.contains("HomeFollowingUiState.LoginRequired,"))
assertTrue(source.contains("HomeFollowingUiState.Empty,"))
assertTrue(source.contains("is HomeFollowingUiState.Error -> bindHomeFollowingEmpty()"))
assertTrue(source.contains("is HomeFollowingUiState.Error -> bindHomeFollowingEmpty(showEmptyMessage = false)"))
assertTrue(source.contains("followingCreatorAdapter.submitItems(emptyList())"))
assertTrue(source.contains("followingLiveAdapter.submitItems(emptyList())"))
assertTrue(source.contains("followingChatAdapter.submitItems(emptyList())"))
@@ -97,6 +97,34 @@ class HomeFollowingFragmentSourceTest {
assertTrue(source.contains("bindFollowingNewsSection(content.recentNews)"))
}
@Test
fun `following empty state shows centered reusable empty string only for all empty content`() {
val layout = homeMainLayoutSource()
val emptyText = layout.substringAfter("@+id/tv_home_following_empty")
.substringBefore("@+id/ll_home_following_creators_section")
val source = homeMainFragmentSource()
val strings = projectFile("app/src/main/res/values/strings.xml").readText()
val stringsEn = projectFile("app/src/main/res/values-en/strings.xml").readText()
val stringsJa = projectFile("app/src/main/res/values-ja/strings.xml").readText()
assertTrue(layout.contains("@+id/tv_home_following_empty"))
assertTrue(emptyText.contains("android:layout_width=\"match_parent\""))
assertTrue(emptyText.contains("android:layout_height=\"match_parent\""))
assertTrue(emptyText.contains("android:gravity=\"center\""))
assertTrue(emptyText.contains("android:textAlignment=\"center\""))
assertTrue(emptyText.contains("android:text=\"@string/screen_home_following_empty\""))
assertTrue(emptyText.contains("android:visibility=\"gone\""))
assertTrue(strings.contains("<string name=\"screen_home_following_empty\">아직 팔로잉 소식이 없어요.\\n관심 있는 크리에이터를 팔로우해 보세요.</string>"))
assertTrue(stringsEn.contains("<string name=\"screen_home_following_empty\">No following updates yet.\\nFollow creators you are interested in.</string>"))
assertTrue(stringsJa.contains("<string name=\"screen_home_following_empty\">フォロー中のお知らせはまだありません。\\n気になるクリエイターをフォローしてみましょう。</string>"))
assertTrue(source.contains("binding.tvHomeFollowingEmpty.visibility = View.GONE"))
assertTrue(source.contains("binding.tvHomeFollowingEmpty.visibility = if (showEmptyMessage) View.VISIBLE else View.GONE"))
assertTrue(source.contains("HomeFollowingUiState.Empty -> bindHomeFollowingEmpty(showEmptyMessage = true)"))
assertTrue(source.contains("is HomeFollowingUiState.Error -> bindHomeFollowingEmpty(showEmptyMessage = false)"))
}
@Test
fun `following adapters bind figma required item fields`() {
val liveAdapter = projectFile(