Move editMessageLambda to the constructor.
This commit is contained in:
parent
69f6ea7641
commit
7182baf298
2 changed files with 6 additions and 7 deletions
|
|
@ -431,10 +431,9 @@ class MessageComposerPresenterTest {
|
||||||
}
|
}
|
||||||
val fakeMatrixRoom = FakeMatrixRoom(
|
val fakeMatrixRoom = FakeMatrixRoom(
|
||||||
liveTimeline = timeline,
|
liveTimeline = timeline,
|
||||||
typingNoticeResult = { Result.success(Unit) }
|
typingNoticeResult = { Result.success(Unit) },
|
||||||
).apply {
|
editMessageLambda = roomEditMessageLambda,
|
||||||
this.editMessageLambda = roomEditMessageLambda
|
)
|
||||||
}
|
|
||||||
val presenter = createPresenter(
|
val presenter = createPresenter(
|
||||||
this,
|
this,
|
||||||
fakeMatrixRoom,
|
fakeMatrixRoom,
|
||||||
|
|
|
||||||
|
|
@ -105,6 +105,7 @@ class FakeMatrixRoom(
|
||||||
private val setTopicResult: (String) -> Result<Unit> = { lambdaError() },
|
private val setTopicResult: (String) -> Result<Unit> = { lambdaError() },
|
||||||
private val updateAvatarResult: (String, ByteArray) -> Result<Unit> = { _, _ -> lambdaError() },
|
private val updateAvatarResult: (String, ByteArray) -> Result<Unit> = { _, _ -> lambdaError() },
|
||||||
private val removeAvatarResult: () -> Result<Unit> = { lambdaError() },
|
private val removeAvatarResult: () -> Result<Unit> = { lambdaError() },
|
||||||
|
private val editMessageLambda: (EventId, String, String?, List<Mention>) -> Result<Unit> = { _, _, _, _ -> lambdaError() },
|
||||||
private val sendMessageResult: (String, String?, List<Mention>) -> Result<Unit> = { _, _, _ -> lambdaError() },
|
private val sendMessageResult: (String, String?, List<Mention>) -> Result<Unit> = { _, _, _ -> lambdaError() },
|
||||||
private val updateUserRoleResult: () -> Result<Unit> = { lambdaError() },
|
private val updateUserRoleResult: () -> Result<Unit> = { lambdaError() },
|
||||||
private val toggleReactionResult: (String, EventId) -> Result<Unit> = { _, _ -> lambdaError() },
|
private val toggleReactionResult: (String, EventId) -> Result<Unit> = { _, _ -> lambdaError() },
|
||||||
|
|
@ -221,9 +222,8 @@ class FakeMatrixRoom(
|
||||||
return updateUserRoleResult()
|
return updateUserRoleResult()
|
||||||
}
|
}
|
||||||
|
|
||||||
var editMessageLambda: (EventId, String, String?, List<Mention>) -> Result<Unit> = { _, _, _, _ -> lambdaError() }
|
override suspend fun editMessage(eventId: EventId, body: String, htmlBody: String?, mentions: List<Mention>) = simulateLongTask {
|
||||||
override suspend fun editMessage(eventId: EventId, body: String, htmlBody: String?, mentions: List<Mention>): Result<Unit> {
|
editMessageLambda(eventId, body, htmlBody, mentions)
|
||||||
return editMessageLambda(eventId, body, htmlBody, mentions)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override suspend fun sendMessage(body: String, htmlBody: String?, mentions: List<Mention>) = simulateLongTask {
|
override suspend fun sendMessage(body: String, htmlBody: String?, mentions: List<Mention>) = simulateLongTask {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue