feat(content): 랭킹 변동 표시 옵션을 추가한다
This commit is contained in:
@@ -12,7 +12,8 @@ data class ContentRankingItem(
|
||||
val contentName: String,
|
||||
val creatorName: String,
|
||||
val imageUrl: String,
|
||||
val isBlocked: Boolean
|
||||
val isBlocked: Boolean,
|
||||
val showRankChange: Boolean = true
|
||||
) {
|
||||
init {
|
||||
require(rank >= 1) { "rank must be greater than or equal to 1." }
|
||||
|
||||
@@ -24,6 +24,20 @@ class ContentRankingItemTest {
|
||||
assertTrue(item.isTouchable)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `showRankChange default is true`() {
|
||||
val item = sampleItem()
|
||||
|
||||
assertTrue(item.showRankChange)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `showRankChange false item does not show rank change`() {
|
||||
val item = sampleItem(showRankChange = false)
|
||||
|
||||
assertFalse(item.showRankChange)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `top ten blocked item hides content and creator names`() {
|
||||
val item = sampleItem(rank = 10, isBlocked = true)
|
||||
@@ -76,7 +90,8 @@ class ContentRankingItemTest {
|
||||
rank: Int = 1,
|
||||
contentName: String = "콘텐츠 이름",
|
||||
creatorName: String = "크리에이터 이름",
|
||||
isBlocked: Boolean = false
|
||||
isBlocked: Boolean = false,
|
||||
showRankChange: Boolean = true
|
||||
) = ContentRankingItem(
|
||||
contentId = "content-1",
|
||||
creatorId = "creator-1",
|
||||
@@ -87,6 +102,7 @@ class ContentRankingItemTest {
|
||||
contentName = contentName,
|
||||
creatorName = creatorName,
|
||||
imageUrl = "https://example.com/image.png",
|
||||
isBlocked = isBlocked
|
||||
isBlocked = isBlocked,
|
||||
showRankChange = showRankChange
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user