fix(widget): 캐릭터 채팅 썸네일 clipping을 Kotlin에서 설정한다
This commit is contained in:
@@ -10,7 +10,9 @@ import androidx.test.core.app.ApplicationProvider
|
||||
import kr.co.vividnext.sodalive.R
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertFalse
|
||||
import org.junit.Assert.assertNotNull
|
||||
import org.junit.Assert.assertSame
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.robolectric.RobolectricTestRunner
|
||||
@@ -51,6 +53,30 @@ class CharacterChatThumbnailViewTest {
|
||||
assertSame(view.findViewById<ImageView>(R.id.iv_character_chat_thumbnail_image), view.imageView())
|
||||
}
|
||||
|
||||
@Test
|
||||
@Config(sdk = [23])
|
||||
fun `card clipping is configured from Kotlin outline provider`() {
|
||||
val view = inflateView()
|
||||
|
||||
assertTrue(view.clipToOutline)
|
||||
assertNotNull(view.outlineProvider)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `layout does not declare xml clipToOutline`() {
|
||||
val context = ApplicationProvider.getApplicationContext<Context>()
|
||||
val parser = context.resources.getXml(R.layout.view_character_chat_thumbnail)
|
||||
while (parser.eventType != org.xmlpull.v1.XmlPullParser.START_TAG) {
|
||||
parser.next()
|
||||
}
|
||||
|
||||
val hasClipToOutline = (0 until parser.attributeCount).any { index ->
|
||||
parser.getAttributeName(index) == "clipToOutline"
|
||||
}
|
||||
|
||||
assertFalse(hasClipToOutline)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `setOnCharacterClick invokes listener with bound item`() {
|
||||
val view = inflateView()
|
||||
|
||||
Reference in New Issue
Block a user