Merge pull request #6171 from element-hq/feature/fga/enable_spaces_ff
Enable space feature flags by default
This commit is contained in:
commit
a1a89c02b5
3 changed files with 10 additions and 7 deletions
|
|
@ -219,6 +219,7 @@ class ConfigureRoomPresenterTest {
|
||||||
fun `present - when creating a room in a space if the room doesn't receive the power levels value it can't be added to the space`() = runTest {
|
fun `present - when creating a room in a space if the room doesn't receive the power levels value it can't be added to the space`() = runTest {
|
||||||
val addChildToSpaceResult = lambdaRecorder<RoomId, RoomId, Result<Unit>> { _, _ -> Result.success(Unit) }
|
val addChildToSpaceResult = lambdaRecorder<RoomId, RoomId, Result<Unit>> { _, _ -> Result.success(Unit) }
|
||||||
val spaceService = FakeSpaceService(
|
val spaceService = FakeSpaceService(
|
||||||
|
editableSpacesResult = { Result.success(emptyList()) },
|
||||||
addChildToSpaceResult = addChildToSpaceResult,
|
addChildToSpaceResult = addChildToSpaceResult,
|
||||||
)
|
)
|
||||||
val roomInfoFlow = MutableStateFlow<Optional<RoomInfo>>(Optional.empty())
|
val roomInfoFlow = MutableStateFlow<Optional<RoomInfo>>(Optional.empty())
|
||||||
|
|
@ -261,6 +262,7 @@ class ConfigureRoomPresenterTest {
|
||||||
fun `present - creating a room and adding it into a parent space works when all the data is available`() = runTest {
|
fun `present - creating a room and adding it into a parent space works when all the data is available`() = runTest {
|
||||||
val addChildToSpaceResult = lambdaRecorder<RoomId, RoomId, Result<Unit>> { _, _ -> Result.success(Unit) }
|
val addChildToSpaceResult = lambdaRecorder<RoomId, RoomId, Result<Unit>> { _, _ -> Result.success(Unit) }
|
||||||
val spaceService = FakeSpaceService(
|
val spaceService = FakeSpaceService(
|
||||||
|
editableSpacesResult = { Result.success(emptyList()) },
|
||||||
addChildToSpaceResult = addChildToSpaceResult,
|
addChildToSpaceResult = addChildToSpaceResult,
|
||||||
)
|
)
|
||||||
val roomInfoFlow = MutableStateFlow<Optional<RoomInfo>>(Optional.empty())
|
val roomInfoFlow = MutableStateFlow<Optional<RoomInfo>>(Optional.empty())
|
||||||
|
|
@ -522,7 +524,9 @@ class ConfigureRoomPresenterTest {
|
||||||
|
|
||||||
private fun createMatrixClient(
|
private fun createMatrixClient(
|
||||||
isAliasAvailable: Boolean = true,
|
isAliasAvailable: Boolean = true,
|
||||||
spaceService: FakeSpaceService = FakeSpaceService(),
|
spaceService: FakeSpaceService = FakeSpaceService(
|
||||||
|
editableSpacesResult = { Result.success(emptyList()) }
|
||||||
|
),
|
||||||
) = FakeMatrixClient(
|
) = FakeMatrixClient(
|
||||||
userIdServerNameLambda = { "matrix.org" },
|
userIdServerNameLambda = { "matrix.org" },
|
||||||
resolveRoomAliasResult = {
|
resolveRoomAliasResult = {
|
||||||
|
|
|
||||||
|
|
@ -809,14 +809,13 @@ class SecurityAndPrivacyPresenterTest {
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
// No spaces available, so isSpaceMemberSelectable should be false
|
// Room has SpaceMember access with existing space ID, so isSpaceMemberSelectable is true
|
||||||
val presenter = createSecurityAndPrivacyPresenter(room = room)
|
val presenter = createSecurityAndPrivacyPresenter(room = room)
|
||||||
presenter.test {
|
presenter.test {
|
||||||
skipItems(1)
|
skipItems(1)
|
||||||
with(awaitItem()) {
|
with(awaitItem()) {
|
||||||
assertThat(savedSettings.roomAccess).isInstanceOf(SecurityAndPrivacyRoomAccess.SpaceMember::class.java)
|
assertThat(savedSettings.roomAccess).isInstanceOf(SecurityAndPrivacyRoomAccess.SpaceMember::class.java)
|
||||||
assertThat(isSpaceMemberSelectable).isFalse()
|
assertThat(isSpaceMemberSelectable).isTrue()
|
||||||
// showSpaceMemberOption should still be true because savedSettings has SpaceMember
|
|
||||||
assertThat(showSpaceMemberOption).isTrue()
|
assertThat(showSpaceMemberOption).isTrue()
|
||||||
}
|
}
|
||||||
cancelAndIgnoreRemainingEvents()
|
cancelAndIgnoreRemainingEvents()
|
||||||
|
|
|
||||||
|
|
@ -74,21 +74,21 @@ enum class FeatureFlags(
|
||||||
key = "feature.createSpaces",
|
key = "feature.createSpaces",
|
||||||
title = "Create spaces",
|
title = "Create spaces",
|
||||||
description = "Allow creating spaces.",
|
description = "Allow creating spaces.",
|
||||||
defaultValue = { false },
|
defaultValue = { true },
|
||||||
isFinished = false,
|
isFinished = false,
|
||||||
),
|
),
|
||||||
SpaceSettings(
|
SpaceSettings(
|
||||||
key = "feature.spaceSettings",
|
key = "feature.spaceSettings",
|
||||||
title = "Space settings",
|
title = "Space settings",
|
||||||
description = "Allow managing space settings such as details, permissions and privacy.",
|
description = "Allow managing space settings such as details, permissions and privacy.",
|
||||||
defaultValue = { false },
|
defaultValue = { true },
|
||||||
isFinished = false,
|
isFinished = false,
|
||||||
),
|
),
|
||||||
RoomListSpaceFilters(
|
RoomListSpaceFilters(
|
||||||
key = "feature.roomListSpaceFilters",
|
key = "feature.roomListSpaceFilters",
|
||||||
title = "Room list space filters",
|
title = "Room list space filters",
|
||||||
description = "Allow filtering the room list by space.",
|
description = "Allow filtering the room list by space.",
|
||||||
defaultValue = { false },
|
defaultValue = { true },
|
||||||
isFinished = false,
|
isFinished = false,
|
||||||
),
|
),
|
||||||
PrintLogsToLogcat(
|
PrintLogsToLogcat(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue