fix(gift): 배송지 입력과 표시 제목을 분리한다

This commit is contained in:
2026-10-08 16:29:38 +09:00
parent e2968b35b5
commit f2e991fc9c
6 changed files with 35 additions and 10 deletions
@@ -274,18 +274,32 @@ class GiftDetailViewModelTest {
}
)
mapOf(
Locale.KOREAN to Triple("크리에이터", "취소 완료", "받는 사서함"),
Locale.ENGLISH to Triple("Creator", "Cancellation complete", "Receiving mailbox"),
Locale.JAPANESE to Triple("クリエイター", "キャンセル完了", "受取私書箱")
Locale.KOREAN to listOf("크리에이터", "취소 완료", "받는 사서함", "받는 주소", "배송지 입력"),
Locale.ENGLISH to listOf(
"Creator",
"Cancellation complete",
"Receiving mailbox",
"Delivery address",
"Enter delivery address"
),
Locale.JAPANESE to listOf("クリエイター", "キャンセル完了", "受取私書箱", "受取住所", "配送先を入力")
).forEach { (locale, expected) ->
val localized = context.createConfigurationContext(
Configuration(context.resources.configuration).apply {
setLocale(locale)
}
)
assertEquals(expected.first, localized.getString(R.string.gift_detail_counterpart))
assertEquals(expected.second, localized.resolveGiftDetailText(GiftDetailText.Key.CANCELED_LABEL))
assertEquals(expected.third, localized.getString(R.string.gift_tracking_destination))
assertEquals(expected[0], localized.getString(R.string.gift_detail_counterpart))
assertEquals(expected[1], localized.resolveGiftDetailText(GiftDetailText.Key.CANCELED_LABEL))
assertEquals(expected[2], localized.getString(R.string.gift_tracking_destination))
assertEquals(expected[3], localized.getString(R.string.gift_detail_recipient_address))
val inputId = localized.resources.getIdentifier(
"gift_detail_recipient_address_input",
"string",
localized.packageName
)
assertTrue(inputId != 0)
assertEquals(expected[4], localized.getString(inputId))
GiftDetailText.Key.entries.forEach { key ->
val text = localized.resolveGiftDetailText(key)
assertTrue(text.isNotBlank())
@@ -398,6 +398,7 @@ class GiftNavigationTest {
val recipient = ViewModelProvider(activity)[GiftRecipientAddressViewModel::class.java]
with(activity.binding) {
assertEquals(activity.getString(R.string.gift_recipient_receive), header.text.toString())
assertEquals("배송지 입력", recipientForm.children.filterIsInstance<TextView>().first().text.toString())
assertFalse(receive.isEnabled)
etRecipientName.setText("수령인")
etPhoneNumber.setText("01012345678")
@@ -519,6 +520,7 @@ class GiftNavigationTest {
}
@Test
@Config(qualifiers = "ko")
fun `받은 선물 완료 상태는 모델의 정보 행과 본인 주소 및 전달 안내를 연결한다`() {
api.direction = "RECEIVED"
api.recipientAddressRequired = false
@@ -531,6 +533,12 @@ class GiftNavigationTest {
GiftDetailActivity.newIntent(ApplicationProvider.getApplicationContext(), "completed-gift")
).setup()
val activity = controller.get()
if (address != null) {
assertEquals(
"받는 주소",
activity.binding.recipientSection.children.filterIsInstance<TextView>().first().text.toString()
)
}
val values = activity.binding.giftInfo.children.map {
it.findViewById<TextView>(R.id.value).text.toString()
}.toList()