Fix tests after ff enabled
This commit is contained in:
parent
22e9e8d9bd
commit
1600d68f4b
2 changed files with 7 additions and 4 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()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue