feat(main): 홈 크리에이터 FAB를 추가한다
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
package kr.co.vividnext.sodalive.v2.main
|
||||
|
||||
import kr.co.vividnext.sodalive.settings.notification.MemberRole
|
||||
import org.junit.Assert.assertFalse
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
|
||||
class MainHomeFabVisibilityPolicyTest {
|
||||
|
||||
@Test
|
||||
fun `홈 탭 로그인 크리에이터이면 FAB를 표시한다`() {
|
||||
val shouldShow = MainHomeFabVisibilityPolicy.shouldShow(
|
||||
currentTab = MainV2Tab.HOME,
|
||||
isLoginAllowed = true,
|
||||
role = MemberRole.CREATOR.name
|
||||
)
|
||||
|
||||
assertTrue(shouldShow)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `홈 탭이어도 로그인하지 않았으면 FAB를 숨긴다`() {
|
||||
val shouldShow = MainHomeFabVisibilityPolicy.shouldShow(
|
||||
currentTab = MainV2Tab.HOME,
|
||||
isLoginAllowed = false,
|
||||
role = MemberRole.CREATOR.name
|
||||
)
|
||||
|
||||
assertFalse(shouldShow)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `홈 탭이어도 일반 유저이면 FAB를 숨긴다`() {
|
||||
val shouldShow = MainHomeFabVisibilityPolicy.shouldShow(
|
||||
currentTab = MainV2Tab.HOME,
|
||||
isLoginAllowed = true,
|
||||
role = MemberRole.USER.name
|
||||
)
|
||||
|
||||
assertFalse(shouldShow)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `크리에이터여도 홈 탭이 아니면 FAB를 숨긴다`() {
|
||||
val shouldShow = MainHomeFabVisibilityPolicy.shouldShow(
|
||||
currentTab = MainV2Tab.CONTENT,
|
||||
isLoginAllowed = true,
|
||||
role = MemberRole.CREATOR.name
|
||||
)
|
||||
|
||||
assertFalse(shouldShow)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user