mirror of
https://github.com/vector-im/riotX-android
synced 2025-10-05 15:52:47 +02:00
changed test for searching by incomplete word to expect correct answer, added test for searching by missing word
This commit is contained in:
@@ -76,7 +76,7 @@ class SearchMessagesTest : InstrumentedTest {
|
||||
|
||||
@Test
|
||||
fun sendTextMessageAndSearchPartOfItIncompleteWord() {
|
||||
doTest(expectedNumberOfResult = 0) { cryptoTestData ->
|
||||
doTest(expectedNumberOfResult = 2) { cryptoTestData ->
|
||||
cryptoTestData.firstSession
|
||||
.searchService()
|
||||
.search(
|
||||
@@ -92,6 +92,24 @@ class SearchMessagesTest : InstrumentedTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun sendTextMessageAndSearchMissingWord() {
|
||||
doTest(expectedNumberOfResult = 0) { cryptoTestData ->
|
||||
cryptoTestData.firstSession
|
||||
.searchService()
|
||||
.search(
|
||||
searchTerm = "Missing", /* missing word */
|
||||
roomId = cryptoTestData.roomId,
|
||||
limit = 10,
|
||||
includeProfile = true,
|
||||
afterLimit = 0,
|
||||
beforeLimit = 10,
|
||||
orderByRecent = true,
|
||||
nextBatch = null
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
private fun doTest(
|
||||
expectedNumberOfResult: Int = 2,
|
||||
block: suspend (CryptoTestData) -> SearchResult,
|
||||
|
Reference in New Issue
Block a user