fix(home): 최근 소식 상세 이동을 연결한다
This commit is contained in:
@@ -564,7 +564,14 @@ class HomeMainFragment : BaseFragment<FragmentV2MainHomeBinding>(
|
||||
|
||||
private fun onFollowingScheduleClick(item: HomeFollowingScheduleUiItem) = Unit
|
||||
|
||||
private fun onFollowingNewsClick(item: HomeFollowingNewsUiItem) = Unit
|
||||
private fun onFollowingNewsClick(item: HomeFollowingNewsUiItem) {
|
||||
val community = item as? HomeFollowingNewsUiItem.Community ?: return
|
||||
val postId = community.postId
|
||||
if (postId <= 0L) return
|
||||
ensureMainV2NavigationAllowed {
|
||||
startActivity(CreatorChannelCommunityDetailActivity.newIntent(requireContext(), postId))
|
||||
}
|
||||
}
|
||||
|
||||
private fun openFollowingCreatorAll() {
|
||||
ensureMainV2NavigationAllowed {
|
||||
|
||||
@@ -53,6 +53,30 @@ class HomeMainFragmentLoginGuardSourceTest {
|
||||
assertFalse(clickSource.contains("EXTRA_COMMUNITY_EXIST_ORDERED"))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `HomeMainFragment 팔로잉 최근 소식 COMMUNITY_POST는 커뮤니티 상세로 이동한다`() {
|
||||
val source = projectFile(
|
||||
"app/src/main/java/kr/co/vividnext/sodalive/v2/main/home/HomeMainFragment.kt"
|
||||
).readText()
|
||||
|
||||
val clickSource = source.substringFrom("private fun onFollowingNewsClick(item: HomeFollowingNewsUiItem)")
|
||||
assertTrue(clickSource.contains("val community = item as? HomeFollowingNewsUiItem.Community ?: return"))
|
||||
assertTrue(clickSource.contains("val postId = community.postId"))
|
||||
assertBefore(
|
||||
clickSource,
|
||||
"val community = item as? HomeFollowingNewsUiItem.Community ?: return",
|
||||
"ensureMainV2NavigationAllowed"
|
||||
)
|
||||
assertBefore(
|
||||
clickSource,
|
||||
"if (postId <= 0L) return",
|
||||
"ensureMainV2NavigationAllowed"
|
||||
)
|
||||
assertTrue(clickSource.contains("CreatorChannelCommunityDetailActivity.newIntent(requireContext(), postId)"))
|
||||
assertFalse(clickSource.contains("CreatorCommunityAllActivity"))
|
||||
assertFalse(clickSource.contains("EXTRA_COMMUNITY_POST_ID"))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `HomeMainFragment 팔로잉 탭 선택은 로그인 가드 통과 후 탭을 전환한다`() {
|
||||
val source = projectFile(
|
||||
|
||||
Reference in New Issue
Block a user