Merge pull request #324 from vector-im/feature/fre/create_room
Handle create room action
This commit is contained in:
commit
13f1ca3a60
17 changed files with 213 additions and 97 deletions
|
|
@ -46,6 +46,7 @@ class FakeMatrixClient(
|
|||
private val notificationService: FakeNotificationService = FakeNotificationService(),
|
||||
) : MatrixClient {
|
||||
|
||||
private var createRoomResult: Result<RoomId> = Result.success(A_ROOM_ID)
|
||||
private var createDmResult: Result<RoomId> = Result.success(A_ROOM_ID)
|
||||
private var createDmFailure: Throwable? = null
|
||||
private var findDmResult: MatrixRoom? = FakeMatrixRoom()
|
||||
|
|
@ -61,7 +62,7 @@ class FakeMatrixClient(
|
|||
|
||||
override suspend fun createRoom(createRoomParams: CreateRoomParameters): Result<RoomId> {
|
||||
delay(100)
|
||||
return Result.success(A_ROOM_ID)
|
||||
return createRoomResult
|
||||
}
|
||||
|
||||
override suspend fun createDM(userId: UserId): Result<RoomId> {
|
||||
|
|
@ -119,6 +120,10 @@ class FakeMatrixClient(
|
|||
logoutFailure = failure
|
||||
}
|
||||
|
||||
fun givenCreateRoomResult(result: Result<RoomId>) {
|
||||
createRoomResult = result
|
||||
}
|
||||
|
||||
fun givenCreateDmResult(result: Result<RoomId>) {
|
||||
createDmResult = result
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue