Skip to content

Commit

Permalink
Merge pull request #4219 from element-hq/feature/bma/encryptionBadge
Browse files Browse the repository at this point in the history
Always display encryption badge
  • Loading branch information
bmarty authored Jan 30, 2025
2 parents 73c66dd + e214345 commit 22795af
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,10 @@ data class RoomDetailsState(
val eventSink: (RoomDetailsEvent) -> Unit
) {
val roomBadges = buildList {
if (isEncrypted || isPublic) {
if (isEncrypted) {
add(RoomBadge.ENCRYPTED)
} else {
add(RoomBadge.NOT_ENCRYPTED)
}
if (isEncrypted) {
add(RoomBadge.ENCRYPTED)
} else {
add(RoomBadge.NOT_ENCRYPTED)
}
if (isPublic) {
add(RoomBadge.PUBLIC)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ import org.junit.Test

class RoomDetailsStateTest {
@Test
fun `room not public not encrypted should have no badges`() {
fun `room not public not encrypted should have not encrypted badge`() {
val sut = aRoomDetailsState(
isPublic = false,
isEncrypted = false,
)
assertThat(sut.roomBadges).isEmpty()
assertThat(sut.roomBadges).isEqualTo(
persistentListOf(RoomBadge.NOT_ENCRYPTED)
)
}

@Test
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 22795af

Please sign in to comment.