Add reset method to SpaceRoomList
This commit is contained in:
parent
692302df5c
commit
33eb848c94
4 changed files with 17 additions and 0 deletions
|
|
@ -26,6 +26,7 @@ class FakeSpaceRoomList(
|
|||
initialSpaceRoomsValue: List<SpaceRoom> = emptyList(),
|
||||
initialSpaceRoomList: SpaceRoomList.PaginationStatus = SpaceRoomList.PaginationStatus.Loading,
|
||||
private val paginateResult: () -> Result<Unit> = { lambdaError() },
|
||||
private val resetResult: () -> Result<Unit> = { lambdaError() },
|
||||
) : SpaceRoomList {
|
||||
private val currentSpaceMutableStateFlow: MutableStateFlow<Optional<SpaceRoom>> = MutableStateFlow(Optional.ofNullable(initialSpaceFlowValue))
|
||||
override val currentSpaceFlow: StateFlow<Optional<SpaceRoom>> = currentSpaceMutableStateFlow.asStateFlow()
|
||||
|
|
@ -52,6 +53,10 @@ class FakeSpaceRoomList(
|
|||
paginateResult()
|
||||
}
|
||||
|
||||
override suspend fun reset(): Result<Unit> = simulateLongTask {
|
||||
resetResult()
|
||||
}
|
||||
|
||||
override fun destroy() {
|
||||
// No op
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue