fix call state presenter test
This commit is contained in:
@@ -41,6 +41,7 @@ class RoomCallStatePresenterTest {
|
|||||||
assertThat(initialState).isEqualTo(
|
assertThat(initialState).isEqualTo(
|
||||||
RoomCallState.StandBy(
|
RoomCallState.StandBy(
|
||||||
canStartCall = false,
|
canStartCall = false,
|
||||||
|
isDM = false
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -79,6 +80,28 @@ class RoomCallStatePresenterTest {
|
|||||||
assertThat(initialState).isEqualTo(
|
assertThat(initialState).isEqualTo(
|
||||||
RoomCallState.StandBy(
|
RoomCallState.StandBy(
|
||||||
canStartCall = true,
|
canStartCall = true,
|
||||||
|
isDM = false
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun `present - initial state - when is direct room`() = runTest {
|
||||||
|
val room = FakeJoinedRoom(
|
||||||
|
baseRoom = FakeBaseRoom(
|
||||||
|
initialRoomInfo = aRoomInfo(isDirect = true),
|
||||||
|
roomPermissions = roomPermissions(true),
|
||||||
|
)
|
||||||
|
)
|
||||||
|
val presenter = createRoomCallStatePresenter(joinedRoom = room)
|
||||||
|
presenter.test {
|
||||||
|
skipItems(1)
|
||||||
|
val initialState = awaitItem()
|
||||||
|
assertThat(initialState).isEqualTo(
|
||||||
|
RoomCallState.StandBy(
|
||||||
|
canStartCall = true,
|
||||||
|
isDM = true
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -98,6 +121,7 @@ class RoomCallStatePresenterTest {
|
|||||||
assertThat(awaitItem()).isEqualTo(
|
assertThat(awaitItem()).isEqualTo(
|
||||||
RoomCallState.OnGoing(
|
RoomCallState.OnGoing(
|
||||||
canJoinCall = false,
|
canJoinCall = false,
|
||||||
|
isAudioCall = false,
|
||||||
isUserInTheCall = false,
|
isUserInTheCall = false,
|
||||||
isUserLocallyInTheCall = false,
|
isUserLocallyInTheCall = false,
|
||||||
)
|
)
|
||||||
@@ -125,6 +149,7 @@ class RoomCallStatePresenterTest {
|
|||||||
assertThat(awaitItem()).isEqualTo(
|
assertThat(awaitItem()).isEqualTo(
|
||||||
RoomCallState.OnGoing(
|
RoomCallState.OnGoing(
|
||||||
canJoinCall = true,
|
canJoinCall = true,
|
||||||
|
isAudioCall = false,
|
||||||
isUserInTheCall = true,
|
isUserInTheCall = true,
|
||||||
isUserLocallyInTheCall = false,
|
isUserLocallyInTheCall = false,
|
||||||
)
|
)
|
||||||
@@ -155,6 +180,7 @@ class RoomCallStatePresenterTest {
|
|||||||
assertThat(awaitItem()).isEqualTo(
|
assertThat(awaitItem()).isEqualTo(
|
||||||
RoomCallState.OnGoing(
|
RoomCallState.OnGoing(
|
||||||
canJoinCall = true,
|
canJoinCall = true,
|
||||||
|
isAudioCall = false,
|
||||||
isUserInTheCall = true,
|
isUserInTheCall = true,
|
||||||
isUserLocallyInTheCall = true,
|
isUserLocallyInTheCall = true,
|
||||||
)
|
)
|
||||||
@@ -187,6 +213,7 @@ class RoomCallStatePresenterTest {
|
|||||||
assertThat(awaitItem()).isEqualTo(
|
assertThat(awaitItem()).isEqualTo(
|
||||||
RoomCallState.OnGoing(
|
RoomCallState.OnGoing(
|
||||||
canJoinCall = true,
|
canJoinCall = true,
|
||||||
|
isAudioCall = false,
|
||||||
isUserInTheCall = true,
|
isUserInTheCall = true,
|
||||||
isUserLocallyInTheCall = true,
|
isUserLocallyInTheCall = true,
|
||||||
)
|
)
|
||||||
@@ -195,6 +222,7 @@ class RoomCallStatePresenterTest {
|
|||||||
assertThat(awaitItem()).isEqualTo(
|
assertThat(awaitItem()).isEqualTo(
|
||||||
RoomCallState.OnGoing(
|
RoomCallState.OnGoing(
|
||||||
canJoinCall = true,
|
canJoinCall = true,
|
||||||
|
isAudioCall = false,
|
||||||
isUserInTheCall = true,
|
isUserInTheCall = true,
|
||||||
isUserLocallyInTheCall = false,
|
isUserLocallyInTheCall = false,
|
||||||
)
|
)
|
||||||
@@ -208,6 +236,7 @@ class RoomCallStatePresenterTest {
|
|||||||
assertThat(awaitItem()).isEqualTo(
|
assertThat(awaitItem()).isEqualTo(
|
||||||
RoomCallState.OnGoing(
|
RoomCallState.OnGoing(
|
||||||
canJoinCall = true,
|
canJoinCall = true,
|
||||||
|
isAudioCall = false,
|
||||||
isUserInTheCall = false,
|
isUserInTheCall = false,
|
||||||
isUserLocallyInTheCall = false,
|
isUserLocallyInTheCall = false,
|
||||||
)
|
)
|
||||||
@@ -221,6 +250,7 @@ class RoomCallStatePresenterTest {
|
|||||||
assertThat(awaitItem()).isEqualTo(
|
assertThat(awaitItem()).isEqualTo(
|
||||||
RoomCallState.StandBy(
|
RoomCallState.StandBy(
|
||||||
canStartCall = true,
|
canStartCall = true,
|
||||||
|
isDM = false
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user