FFs can now be toggled in release builds too (#3101)
- Removed `StaticFeatureFlagProvider`. - Always provide `PreferencesFeatureFlagProvider`. - For the default values of feature flags, use a lambda with a `BuildMeta` parameter so we can customize the return value based on its data.
This commit is contained in:
parent
4757aac8b8
commit
32a374d836
19 changed files with 118 additions and 118 deletions
|
|
@ -745,7 +745,7 @@ class MessagesPresenterTest {
|
|||
|
||||
private suspend fun <T> ReceiveTurbine<T>.awaitFirstItem(): T {
|
||||
// Skip 2 item if Mentions feature is enabled, else 1
|
||||
skipItems(if (FeatureFlags.Mentions.defaultValue) 2 else 1)
|
||||
skipItems(if (FeatureFlags.Mentions.defaultValue(aBuildMeta())) 2 else 1)
|
||||
return awaitItem()
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -63,6 +63,7 @@ import io.element.android.libraries.matrix.test.A_USER_ID
|
|||
import io.element.android.libraries.matrix.test.A_USER_ID_2
|
||||
import io.element.android.libraries.matrix.test.A_USER_ID_3
|
||||
import io.element.android.libraries.matrix.test.A_USER_ID_4
|
||||
import io.element.android.libraries.matrix.test.core.aBuildMeta
|
||||
import io.element.android.libraries.matrix.test.permalink.FakePermalinkBuilder
|
||||
import io.element.android.libraries.matrix.test.permalink.FakePermalinkParser
|
||||
import io.element.android.libraries.matrix.test.room.FakeMatrixRoom
|
||||
|
|
@ -828,7 +829,6 @@ class MessageComposerPresenterTest {
|
|||
|
||||
// If room is a DM, `RoomMemberSuggestion.Room` is not returned
|
||||
room.givenCanTriggerRoomNotification(Result.success(true))
|
||||
room.isDirect
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1300,7 +1300,7 @@ class MessageComposerPresenterTest {
|
|||
|
||||
private suspend fun <T> ReceiveTurbine<T>.awaitFirstItem(): T {
|
||||
// Skip 2 item if Mentions feature is enabled, else 1
|
||||
skipItems(if (FeatureFlags.Mentions.defaultValue) 2 else 1)
|
||||
skipItems(if (FeatureFlags.Mentions.defaultValue(aBuildMeta())) 2 else 1)
|
||||
return awaitItem()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,13 +35,18 @@ class OnBoardingPresenterTest {
|
|||
|
||||
@Test
|
||||
fun `present - initial state`() = runTest {
|
||||
val buildMeta = aBuildMeta(
|
||||
applicationName = "A",
|
||||
productionApplicationName = "B",
|
||||
desktopApplicationName = "C",
|
||||
)
|
||||
val featureFlagService = FakeFeatureFlagService(
|
||||
initialState = mapOf(FeatureFlags.QrCodeLogin.key to true),
|
||||
buildMeta = buildMeta,
|
||||
)
|
||||
val presenter = OnBoardingPresenter(
|
||||
buildMeta = aBuildMeta(
|
||||
applicationName = "A",
|
||||
productionApplicationName = "B",
|
||||
desktopApplicationName = "C",
|
||||
),
|
||||
featureFlagService = FakeFeatureFlagService(initialState = mapOf(FeatureFlags.QrCodeLogin.name to true)),
|
||||
buildMeta = buildMeta,
|
||||
featureFlagService = featureFlagService,
|
||||
)
|
||||
moleculeFlow(RecompositionMode.Immediate) {
|
||||
presenter.present()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue