fix(dm): 수신자 선택 라벨 표시를 정리한다
This commit is contained in:
+33
@@ -1,5 +1,6 @@
|
||||
package kr.co.vividnext.sodalive.v2.main.chat.recipient
|
||||
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertFalse
|
||||
import org.junit.Assert.assertSame
|
||||
import org.junit.Assert.assertTrue
|
||||
@@ -33,6 +34,18 @@ class DmRecipientPickerSourceTest {
|
||||
assertTrue(factory.contains("observeOn(AndroidSchedulers.mainThread())"))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `팔로워 라벨은 팔로워 모드이고 표시할 수신자가 있을 때만 보인다`() {
|
||||
val source = source("main/chat/recipient/DmRecipientPickerActivity.kt")
|
||||
|
||||
assertTrue(
|
||||
source.contains(
|
||||
"binding.tvFollowers.isVisible = " +
|
||||
"state.mode == DmRecipientPickerMode.FOLLOWERS && state.recipients.isNotEmpty()"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `수신자 선택은 공통 확인 팝업에서만 요청하고 취소는 부작용이 없다`() {
|
||||
val source = source("main/chat/recipient/DmRecipientPickerActivity.kt")
|
||||
@@ -86,6 +99,23 @@ class DmRecipientPickerSourceTest {
|
||||
assertSame(content, list.parentNode)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `팔로워와 검색결과 라벨은 같은 문구 크기를 쓰고 검색결과 숫자만 gray500으로 보인다`() {
|
||||
val document = DocumentBuilderFactory.newInstance().newDocumentBuilder()
|
||||
.parse(file("app/src/main/res/layout/activity_dm_recipient_picker.xml"))
|
||||
val followers = requireNotNull(document.findById("tv_followers"))
|
||||
val searchResultCount = requireNotNull(document.findById("tv_search_result_count"))
|
||||
val source = source("main/chat/recipient/DmRecipientPickerActivity.kt")
|
||||
|
||||
assertEquals(followers.attribute("style"), searchResultCount.attribute("style"))
|
||||
assertTrue(
|
||||
source.contains(
|
||||
"ForegroundColorSpan(ContextCompat.getColor(this@DmRecipientPickerActivity, R.color.gray_500))"
|
||||
)
|
||||
)
|
||||
assertTrue(source.contains("state.searchResultCount.toString()"))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `새 수신자 문구는 지원 언어 전체에 정의된다`() {
|
||||
val names = listOf(
|
||||
@@ -125,4 +155,7 @@ class DmRecipientPickerSourceTest {
|
||||
value == "@+id/$id" || value == "@id/$id"
|
||||
}
|
||||
}
|
||||
|
||||
private fun org.w3c.dom.Node.attribute(name: String): String =
|
||||
requireNotNull(attributes?.getNamedItem(name)?.nodeValue) { "missing $name" }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user