Navigation: fix test and update log.
This commit is contained in:
@@ -167,7 +167,7 @@ class DefaultAppNavigationStateService @Inject constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun logError(logPrefix: String) {
|
private fun logError(logPrefix: String) {
|
||||||
Timber.tag(loggerTag.value).w("$logPrefix must be call first, can't leave.")
|
Timber.tag(loggerTag.value).w("$logPrefix must be call first.")
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun NavigationState.assertOwner(owner: String): Boolean {
|
private fun NavigationState.assertOwner(owner: String): Boolean {
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ import io.element.android.services.appnavstate.test.A_THREAD_OWNER
|
|||||||
import io.element.android.tests.testutils.runCancellableScopeTest
|
import io.element.android.tests.testutils.runCancellableScopeTest
|
||||||
import kotlinx.coroutines.CoroutineScope
|
import kotlinx.coroutines.CoroutineScope
|
||||||
import kotlinx.coroutines.flow.first
|
import kotlinx.coroutines.flow.first
|
||||||
import org.junit.Assert.assertThrows
|
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
|
|
||||||
class DefaultNavigationStateServiceTest {
|
class DefaultNavigationStateServiceTest {
|
||||||
@@ -63,8 +62,8 @@ class DefaultNavigationStateServiceTest {
|
|||||||
@Test
|
@Test
|
||||||
fun testFailure() = runCancellableScopeTest { scope ->
|
fun testFailure() = runCancellableScopeTest { scope ->
|
||||||
val service = createStateService(scope)
|
val service = createStateService(scope)
|
||||||
|
service.onNavigateToSpace(A_SPACE_OWNER, A_SPACE_ID)
|
||||||
assertThrows(IllegalStateException::class.java) { service.onNavigateToSpace(A_SPACE_OWNER, A_SPACE_ID) }
|
assertThat(service.appNavigationState.value.navigationState).isEqualTo(NavigationState.Root)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun createStateService(
|
private fun createStateService(
|
||||||
|
|||||||
Reference in New Issue
Block a user