fix(community): 상세 잠금 반응과 댓글을 숨긴다
This commit is contained in:
+30
@@ -373,6 +373,36 @@ class CreatorChannelCommunityDetailViewModelTest {
|
||||
assertTrue(state.post.showPaywall)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `유료 미구매 게시물은 작성자가 아니면 reaction 현황과 댓글을 숨긴다`() {
|
||||
SharedPreferenceManager.userId = 10L
|
||||
stubDetail(
|
||||
detailResponse(
|
||||
isCommentAvailable = true,
|
||||
isLiked = true,
|
||||
likeCount = 3,
|
||||
price = 300,
|
||||
existOrdered = false,
|
||||
creatorId = 999L,
|
||||
commentIds = listOf(11L),
|
||||
commentsHasNext = true
|
||||
)
|
||||
)
|
||||
|
||||
viewModel.loadDetail(POST_ID)
|
||||
viewModel.updateCommentInput("hello")
|
||||
viewModel.submitComment()
|
||||
|
||||
val state = viewModel.detailStateLiveData.requireValue() as CreatorChannelCommunityDetailUiState.Content
|
||||
assertTrue(state.post.isLocked)
|
||||
assertFalse(state.post.showReaction)
|
||||
assertFalse(state.isCommentAvailable)
|
||||
assertFalse(state.isCommentInputVisible)
|
||||
assertTrue(state.comments.isEmpty())
|
||||
assertFalse(state.hasNextComment)
|
||||
verify(legacyRepository, never()).registerComment(any(), any(), any(), any(), any())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `채널 작성자는 유료 미구매 게시물도 이미지와 오디오 URL을 볼 수 있다`() {
|
||||
SharedPreferenceManager.userId = 999L
|
||||
|
||||
Reference in New Issue
Block a user