From 2396464eee9033c31fa1e205ab887d84ec80732c Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Wed, 22 Oct 2025 10:15:32 +0200 Subject: [PATCH] Fix tests. --- enterprise | 2 +- .../impl/DefaultEnterpriseServiceTest.kt | 27 +++++++------------ 2 files changed, 10 insertions(+), 19 deletions(-) diff --git a/enterprise b/enterprise index 70f85be002..dac93821a6 160000 --- a/enterprise +++ b/enterprise @@ -1 +1 @@ -Subproject commit 70f85be002edebf773c274f978cd706a36c090a8 +Subproject commit dac93821a6f9f9ad1494d3c69c115ef0696eb7ce diff --git a/features/enterprise/impl-foss/src/test/kotlin/io/element/android/features/enterprise/impl/DefaultEnterpriseServiceTest.kt b/features/enterprise/impl-foss/src/test/kotlin/io/element/android/features/enterprise/impl/DefaultEnterpriseServiceTest.kt index 5701aa6574..33bb8476db 100644 --- a/features/enterprise/impl-foss/src/test/kotlin/io/element/android/features/enterprise/impl/DefaultEnterpriseServiceTest.kt +++ b/features/enterprise/impl-foss/src/test/kotlin/io/element/android/features/enterprise/impl/DefaultEnterpriseServiceTest.kt @@ -7,12 +7,9 @@ package io.element.android.features.enterprise.impl -import app.cash.molecule.RecompositionMode -import app.cash.molecule.moleculeFlow import app.cash.turbine.test import com.google.common.truth.Truth.assertThat -import io.element.android.compound.tokens.generated.compoundColorsDark -import io.element.android.compound.tokens.generated.compoundColorsLight +import io.element.android.compound.colors.SemanticColorsLightDark import io.element.android.libraries.matrix.test.A_HOMESERVER_URL import io.element.android.libraries.matrix.test.A_SESSION_ID import kotlinx.coroutines.test.runTest @@ -44,28 +41,22 @@ class DefaultEnterpriseServiceTest { } @Test - fun `semanticColorsLight always emits the same value`() = runTest { + fun `semanticColorsFlow always emits the same value`() = runTest { val defaultEnterpriseService = DefaultEnterpriseService() - moleculeFlow(RecompositionMode.Immediate) { - defaultEnterpriseService.semanticColorsLight().value - }.test { + defaultEnterpriseService.semanticColorsFlow(null).test { val initialState = awaitItem() - assertThat(initialState).isEqualTo(compoundColorsLight) - defaultEnterpriseService.overrideBrandColor(A_SESSION_ID, "#87654321") - expectNoEvents() + assertThat(initialState).isEqualTo(SemanticColorsLightDark.default) + awaitComplete() } } @Test - fun `semanticColorsDark always emits the same value`() = runTest { + fun `semanticColorsFlow always emits the same value for a session`() = runTest { val defaultEnterpriseService = DefaultEnterpriseService() - moleculeFlow(RecompositionMode.Immediate) { - defaultEnterpriseService.semanticColorsDark().value - }.test { + defaultEnterpriseService.semanticColorsFlow(A_SESSION_ID).test { val initialState = awaitItem() - assertThat(initialState).isEqualTo(compoundColorsDark) - defaultEnterpriseService.overrideBrandColor(A_SESSION_ID, "#87654321") - expectNoEvents() + assertThat(initialState).isEqualTo(SemanticColorsLightDark.default) + awaitComplete() } } }