change(invites) : fix compilation after last changes
This commit is contained in:
parent
d72cbffecc
commit
c3407250eb
3 changed files with 20 additions and 8 deletions
|
|
@ -121,9 +121,8 @@ class AcceptDeclineInvitePresenter @Inject constructor(
|
||||||
client.getPendingRoom(inviteData.roomId)?.use {
|
client.getPendingRoom(inviteData.roomId)?.use {
|
||||||
it.leave().getOrThrow()
|
it.leave().getOrThrow()
|
||||||
}
|
}
|
||||||
val senderId = inviteData.senderId
|
if (blockUser) {
|
||||||
if (blockUser && senderId != null) {
|
client.ignoreUser(inviteData.senderId).getOrThrow()
|
||||||
client.ignoreUser(senderId).getOrThrow()
|
|
||||||
}
|
}
|
||||||
notificationCleaner.clearMembershipNotificationForRoom(client.sessionId, inviteData.roomId)
|
notificationCleaner.clearMembershipNotificationForRoom(client.sessionId, inviteData.roomId)
|
||||||
inviteData.roomId
|
inviteData.roomId
|
||||||
|
|
|
||||||
|
|
@ -167,9 +167,9 @@ class JoinRoomPresenterTest {
|
||||||
|
|
||||||
awaitItem().also { state ->
|
awaitItem().also { state ->
|
||||||
state.eventSink(JoinRoomEvents.AcceptInvite)
|
state.eventSink(JoinRoomEvents.AcceptInvite)
|
||||||
state.eventSink(JoinRoomEvents.DeclineInvite)
|
state.eventSink(JoinRoomEvents.DeclineInvite(false))
|
||||||
|
|
||||||
val inviteData = state.contentState.toInviteData()!!
|
val inviteData = state.contentState.toInviteData()
|
||||||
|
|
||||||
assert(eventSinkRecorder)
|
assert(eventSinkRecorder)
|
||||||
.isCalledExactly(2)
|
.isCalledExactly(2)
|
||||||
|
|
|
||||||
|
|
@ -139,7 +139,7 @@ class JoinRoomViewTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `clicking on Accept invitation IsInvited room emits the expected Event`() {
|
fun `clicking on Accept when JoinAuthorisationStatus is IsInvited emits the expected Event`() {
|
||||||
val eventsRecorder = EventsRecorder<JoinRoomEvents>()
|
val eventsRecorder = EventsRecorder<JoinRoomEvents>()
|
||||||
rule.setJoinRoomView(
|
rule.setJoinRoomView(
|
||||||
aJoinRoomState(
|
aJoinRoomState(
|
||||||
|
|
@ -152,7 +152,7 @@ class JoinRoomViewTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `clicking on Decline invitation on IsInvited room emits the expected Event`() {
|
fun `clicking on Decline when JoinAuthorisationStatus is IsInvited emits the expected Event`() {
|
||||||
val eventsRecorder = EventsRecorder<JoinRoomEvents>()
|
val eventsRecorder = EventsRecorder<JoinRoomEvents>()
|
||||||
rule.setJoinRoomView(
|
rule.setJoinRoomView(
|
||||||
aJoinRoomState(
|
aJoinRoomState(
|
||||||
|
|
@ -161,7 +161,20 @@ class JoinRoomViewTest {
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
rule.clickOn(CommonStrings.action_decline)
|
rule.clickOn(CommonStrings.action_decline)
|
||||||
eventsRecorder.assertSingle(JoinRoomEvents.DeclineInvite)
|
eventsRecorder.assertSingle(JoinRoomEvents.DeclineInvite(false))
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun `clicking on Decline and block when JoinAuthorisationStatus is IsInvited emits the expected Event`() {
|
||||||
|
val eventsRecorder = EventsRecorder<JoinRoomEvents>()
|
||||||
|
rule.setJoinRoomView(
|
||||||
|
aJoinRoomState(
|
||||||
|
contentState = aLoadedContentState(joinAuthorisationStatus = JoinAuthorisationStatus.IsInvited(null)),
|
||||||
|
eventSink = eventsRecorder,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
rule.clickOn(R.string.screen_join_room_decline_and_block_button_title)
|
||||||
|
eventsRecorder.assertSingle(JoinRoomEvents.DeclineInvite(true))
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue