mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-04 00:48:40 +00:00
Fix tests.
This commit is contained in:
+1
-1
Submodule enterprise updated: 70f85be002...dac93821a6
+9
-18
@@ -7,12 +7,9 @@
|
|||||||
|
|
||||||
package io.element.android.features.enterprise.impl
|
package io.element.android.features.enterprise.impl
|
||||||
|
|
||||||
import app.cash.molecule.RecompositionMode
|
|
||||||
import app.cash.molecule.moleculeFlow
|
|
||||||
import app.cash.turbine.test
|
import app.cash.turbine.test
|
||||||
import com.google.common.truth.Truth.assertThat
|
import com.google.common.truth.Truth.assertThat
|
||||||
import io.element.android.compound.tokens.generated.compoundColorsDark
|
import io.element.android.compound.colors.SemanticColorsLightDark
|
||||||
import io.element.android.compound.tokens.generated.compoundColorsLight
|
|
||||||
import io.element.android.libraries.matrix.test.A_HOMESERVER_URL
|
import io.element.android.libraries.matrix.test.A_HOMESERVER_URL
|
||||||
import io.element.android.libraries.matrix.test.A_SESSION_ID
|
import io.element.android.libraries.matrix.test.A_SESSION_ID
|
||||||
import kotlinx.coroutines.test.runTest
|
import kotlinx.coroutines.test.runTest
|
||||||
@@ -44,28 +41,22 @@ class DefaultEnterpriseServiceTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `semanticColorsLight always emits the same value`() = runTest {
|
fun `semanticColorsFlow always emits the same value`() = runTest {
|
||||||
val defaultEnterpriseService = DefaultEnterpriseService()
|
val defaultEnterpriseService = DefaultEnterpriseService()
|
||||||
moleculeFlow(RecompositionMode.Immediate) {
|
defaultEnterpriseService.semanticColorsFlow(null).test {
|
||||||
defaultEnterpriseService.semanticColorsLight().value
|
|
||||||
}.test {
|
|
||||||
val initialState = awaitItem()
|
val initialState = awaitItem()
|
||||||
assertThat(initialState).isEqualTo(compoundColorsLight)
|
assertThat(initialState).isEqualTo(SemanticColorsLightDark.default)
|
||||||
defaultEnterpriseService.overrideBrandColor(A_SESSION_ID, "#87654321")
|
awaitComplete()
|
||||||
expectNoEvents()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `semanticColorsDark always emits the same value`() = runTest {
|
fun `semanticColorsFlow always emits the same value for a session`() = runTest {
|
||||||
val defaultEnterpriseService = DefaultEnterpriseService()
|
val defaultEnterpriseService = DefaultEnterpriseService()
|
||||||
moleculeFlow(RecompositionMode.Immediate) {
|
defaultEnterpriseService.semanticColorsFlow(A_SESSION_ID).test {
|
||||||
defaultEnterpriseService.semanticColorsDark().value
|
|
||||||
}.test {
|
|
||||||
val initialState = awaitItem()
|
val initialState = awaitItem()
|
||||||
assertThat(initialState).isEqualTo(compoundColorsDark)
|
assertThat(initialState).isEqualTo(SemanticColorsLightDark.default)
|
||||||
defaultEnterpriseService.overrideBrandColor(A_SESSION_ID, "#87654321")
|
awaitComplete()
|
||||||
expectNoEvents()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user