Fix moar ktlint issues
This commit is contained in:
parent
a831f05f6e
commit
5d086ad82d
528 changed files with 146 additions and 629 deletions
|
|
@ -19,6 +19,5 @@ package io.element.android.libraries.usersearch.api
|
|||
import kotlinx.coroutines.flow.Flow
|
||||
|
||||
interface UserRepository {
|
||||
|
||||
fun search(query: String): Flow<UserSearchResultState>
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,7 +36,6 @@ class MatrixUserRepository @Inject constructor(
|
|||
private val client: MatrixClient,
|
||||
private val dataSource: UserListDataSource
|
||||
) : UserRepository {
|
||||
|
||||
override fun search(query: String): Flow<UserSearchResultState> = flow {
|
||||
val shouldQueryProfile = MatrixPatterns.isUserId(query) && !client.isMe(UserId(query))
|
||||
val shouldFetchSearchResults = query.length >= MINIMUM_SEARCH_LENGTH
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ import kotlinx.coroutines.test.runTest
|
|||
import org.junit.Test
|
||||
|
||||
internal class MatrixUserListDataSourceTest {
|
||||
|
||||
@Test
|
||||
fun `search - returns users on success`() = runTest {
|
||||
val matrixClient = FakeMatrixClient()
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@ import org.junit.Test
|
|||
private val SESSION_ID = SessionId("@current-user:example.com")
|
||||
|
||||
internal class MatrixUserRepositoryTest {
|
||||
|
||||
@Test
|
||||
fun `search - emits nothing if the search query is too short`() = runTest {
|
||||
val dataSource = FakeUserListDataSource()
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ import io.element.android.libraries.matrix.api.user.MatrixUser
|
|||
import io.element.android.libraries.usersearch.api.UserListDataSource
|
||||
|
||||
class FakeUserListDataSource : UserListDataSource {
|
||||
|
||||
private var searchResult: List<MatrixUser> = emptyList()
|
||||
private var profile: MatrixUser? = null
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ import kotlinx.coroutines.flow.Flow
|
|||
import kotlinx.coroutines.flow.MutableSharedFlow
|
||||
|
||||
class FakeUserRepository : UserRepository {
|
||||
|
||||
var providedQuery: String? = null
|
||||
private set
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue