Query instance for toot character limit (#571)
* Query instance for toot character limit Fixes #393 * Move maximumTootCharacters to instance field * Add caching for maximum toot characters, expanding on the emoji list storage * Update formatting per review feedback * Fix compose activity tests * Rename mastodon api point for nicer interaction with kotlin * Default emoji list to empty list instead of null, to appease json converters in failure cases * Use empty list helper * Fix database migration
This commit is contained in:
parent
797132a643
commit
e2adddf7b8
8 changed files with 154 additions and 41 deletions
|
@ -20,6 +20,7 @@ import android.widget.EditText
|
|||
import com.keylesspalace.tusky.db.AccountEntity
|
||||
import com.keylesspalace.tusky.db.AccountManager
|
||||
import com.keylesspalace.tusky.entity.Emoji
|
||||
import com.keylesspalace.tusky.entity.Instance
|
||||
import com.keylesspalace.tusky.network.MastodonApi
|
||||
import okhttp3.Request
|
||||
import org.junit.Assert.assertFalse
|
||||
|
@ -103,6 +104,28 @@ class ComposeActivityTest {
|
|||
|
||||
override fun enqueue(callback: Callback<List<Emoji>>?) {}
|
||||
})
|
||||
`when`(apiMock.instance).thenReturn(object: Call<Instance> {
|
||||
override fun isExecuted(): Boolean {
|
||||
return false
|
||||
}
|
||||
override fun clone(): Call<Instance> {
|
||||
throw Error("not implemented")
|
||||
}
|
||||
override fun isCanceled(): Boolean {
|
||||
throw Error("not implemented")
|
||||
}
|
||||
override fun cancel() {
|
||||
throw Error("not implemented")
|
||||
}
|
||||
override fun execute(): Response<Instance> {
|
||||
throw Error("not implemented")
|
||||
}
|
||||
override fun request(): Request {
|
||||
throw Error("not implemented")
|
||||
}
|
||||
|
||||
override fun enqueue(callback: Callback<Instance>?) {}
|
||||
})
|
||||
|
||||
activity.mastodonApi = apiMock
|
||||
activity.accountManager = accountManagerMock
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue