diff --git a/app/src/main/java/kr/co/vividnext/sodalive/v2/creator/channel/CreatorChannelPagerAdapter.kt b/app/src/main/java/kr/co/vividnext/sodalive/v2/creator/channel/CreatorChannelPagerAdapter.kt index 8e876842..3bdbe976 100644 --- a/app/src/main/java/kr/co/vividnext/sodalive/v2/creator/channel/CreatorChannelPagerAdapter.kt +++ b/app/src/main/java/kr/co/vividnext/sodalive/v2/creator/channel/CreatorChannelPagerAdapter.kt @@ -4,6 +4,7 @@ import androidx.fragment.app.Fragment import androidx.fragment.app.FragmentActivity import androidx.viewpager2.adapter.FragmentStateAdapter import kr.co.vividnext.sodalive.v2.creator.channel.audio.CreatorChannelAudioFragment +import kr.co.vividnext.sodalive.v2.creator.channel.community.CreatorChannelCommunityFragment import kr.co.vividnext.sodalive.v2.creator.channel.live.CreatorChannelLiveFragment import kr.co.vividnext.sodalive.v2.creator.channel.model.CreatorChannelTab import kr.co.vividnext.sodalive.v2.creator.channel.series.CreatorChannelSeriesFragment @@ -23,6 +24,7 @@ class CreatorChannelPagerAdapter( CreatorChannelTab.Live -> CreatorChannelLiveFragment.newInstance(creatorId) CreatorChannelTab.Audio -> CreatorChannelAudioFragment.newInstance(creatorId) CreatorChannelTab.Series -> CreatorChannelSeriesFragment.newInstance(creatorId) + CreatorChannelTab.Community -> CreatorChannelCommunityFragment.newInstance(creatorId) else -> CreatorChannelPlaceholderFragment.newInstance(tab) } } diff --git a/app/src/test/java/kr/co/vividnext/sodalive/v2/creator/channel/CreatorChannelPagerAdapterTest.kt b/app/src/test/java/kr/co/vividnext/sodalive/v2/creator/channel/CreatorChannelPagerAdapterTest.kt index 9c3b46c5..83f40199 100644 --- a/app/src/test/java/kr/co/vividnext/sodalive/v2/creator/channel/CreatorChannelPagerAdapterTest.kt +++ b/app/src/test/java/kr/co/vividnext/sodalive/v2/creator/channel/CreatorChannelPagerAdapterTest.kt @@ -3,6 +3,7 @@ package kr.co.vividnext.sodalive.v2.creator.channel import android.app.Application import androidx.fragment.app.FragmentActivity import kr.co.vividnext.sodalive.v2.creator.channel.audio.CreatorChannelAudioFragment +import kr.co.vividnext.sodalive.v2.creator.channel.community.CreatorChannelCommunityFragment import kr.co.vividnext.sodalive.v2.creator.channel.live.CreatorChannelLiveFragment import kr.co.vividnext.sodalive.v2.creator.channel.model.CreatorChannelTab import kr.co.vividnext.sodalive.v2.creator.channel.series.CreatorChannelSeriesFragment @@ -19,7 +20,7 @@ import org.robolectric.annotation.Config class CreatorChannelPagerAdapterTest { @Test - fun `createFragment는 Home Live Audio Series를 실제 Fragment로 생성하고 나머지는 placeholder를 유지한다`() { + fun `createFragment는 Home Live Audio Series Community를 실제 Fragment로 생성하고 나머지는 placeholder를 유지한다`() { val activity = Robolectric.buildActivity(FragmentActivity::class.java).setup().get() val adapter = CreatorChannelPagerAdapter(activity, creatorId = 123L) @@ -27,12 +28,14 @@ class CreatorChannelPagerAdapterTest { assertTrue(adapter.createFragment(CreatorChannelTab.Live.ordinal) is CreatorChannelLiveFragment) assertTrue(adapter.createFragment(CreatorChannelTab.Audio.ordinal) is CreatorChannelAudioFragment) assertTrue(adapter.createFragment(CreatorChannelTab.Series.ordinal) is CreatorChannelSeriesFragment) + assertTrue(adapter.createFragment(CreatorChannelTab.Community.ordinal) is CreatorChannelCommunityFragment) CreatorChannelTab.entries .filterNot { it == CreatorChannelTab.Home || it == CreatorChannelTab.Live || it == CreatorChannelTab.Audio || - it == CreatorChannelTab.Series + it == CreatorChannelTab.Series || + it == CreatorChannelTab.Community } .forEach { tab -> assertTrue(adapter.createFragment(tab.ordinal) is CreatorChannelPlaceholderFragment)