feat(creator): 후원 empty 레이아웃을 보정한다

This commit is contained in:
2026-06-22 22:06:46 +09:00
parent a3ea2051cb
commit ecaa1f01e8
4 changed files with 60 additions and 2 deletions

View File

@@ -4,6 +4,7 @@ import android.app.Application
import android.view.LayoutInflater
import android.view.View
import android.widget.ImageView
import android.widget.LinearLayout
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import androidx.test.core.app.ApplicationProvider
@@ -30,6 +31,7 @@ class CreatorChannelDonationFragmentLayoutTest {
val donationList = requireNotNull(root.findViewById<RecyclerView>(R.id.rv_creator_channel_donation))
val emptyContainer = requireNotNull(root.findViewById<View>(R.id.layout_creator_channel_donation_empty))
val emptyMessage = requireNotNull(root.findViewById<TextView>(R.id.tv_creator_channel_donation_empty_message))
val emptyDonationButton = requireNotNull(root.findViewById<LinearLayout>(R.id.btn_creator_channel_donation_empty_write))
val errorMessage = requireNotNull(root.findViewById<TextView>(R.id.tv_creator_channel_donation_error_message))
val retryButton = requireNotNull(root.findViewById<TextView>(R.id.btn_creator_channel_donation_retry))
val donationButton = requireNotNull(root.findViewById<ImageView>(R.id.btn_creator_channel_donation_write))
@@ -38,6 +40,7 @@ class CreatorChannelDonationFragmentLayoutTest {
assertSame(root, donationList.parent)
assertSame(root, emptyContainer.parent)
assertSame(emptyContainer, emptyMessage.parent)
assertSame(emptyContainer, emptyDonationButton.parent)
assertSame(root, errorMessage.parent)
assertSame(root, retryButton.parent)
assertSame(root, donationButton.parent)
@@ -46,6 +49,29 @@ class CreatorChannelDonationFragmentLayoutTest {
assertTrue(!layout.contains("creator_channel_donation_sort"))
}
@Test
fun `후원 empty layout은 Figma 중앙 capsule 후원하기 button을 제공한다`() {
val root = inflateView(R.layout.fragment_creator_channel_donation)
val layout = projectFile("app/src/main/res/layout/fragment_creator_channel_donation.xml").readText()
val emptyContainer = requireNotNull(root.findViewById<View>(R.id.layout_creator_channel_donation_empty))
val emptyDonationButton = requireNotNull(root.findViewById<LinearLayout>(R.id.btn_creator_channel_donation_empty_write))
assertSame(emptyContainer, emptyDonationButton.parent)
assertNotNull(emptyDonationButton.findViewById<ImageView>(R.id.iv_creator_channel_donation_empty_write))
assertNotNull(emptyDonationButton.findViewById<TextView>(R.id.tv_creator_channel_donation_empty_write))
assertTrue(layout.contains("android:text=\"@string/creator_channel_donation_empty_title\""))
assertTrue(layout.contains("android:text=\"@string/creator_channel_donation_action\""))
assertTrue(layout.contains("android:background=\"@drawable/bg_creator_channel_donation_empty_button\""))
assertTrue(layout.contains("android:layout_marginTop=\"@dimen/spacing_14\""))
assertTrue(layout.contains("android:src=\"@drawable/ic_new_donation\""))
assertTrue(
projectFile("app/src/main/res/drawable/bg_creator_channel_donation_empty_button.xml")
.readText()
.contains("<solid android:color=\"@color/soda_400\" />")
)
}
@Test
fun `후원 count bar는 전체 label과 count만 제공하고 sort UI를 만들지 않는다`() {
val root = inflateView(R.layout.fragment_creator_channel_donation)
@@ -112,6 +138,7 @@ class CreatorChannelDonationFragmentLayoutTest {
assertTrue(strings.contains("name=\"creator_channel_donation_error_message\""))
assertTrue(strings.contains("name=\"creator_channel_donation_retry\""))
}
assertTrue(ko.contains("name=\"creator_channel_donation_empty_title\">아직 후원이 없습니다.\\n처음으로 크리에이터를 후원해 보세요!"))
}
private fun inflateView(layoutResId: Int): View {