mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-10-31 08:15:24 +00:00
disable creation and enabling of e2ee if remote preference for disabling it is true
This commit is contained in:
@@ -434,13 +434,24 @@ final class SecurityAndPrivacyScreenViewModelTests {
|
||||
try await deferred.fulfill()
|
||||
}
|
||||
|
||||
@Test
|
||||
func encryptionOptionAvailability() {
|
||||
setupViewModel(joinedParentSpaces: [], joinRule: .public)
|
||||
#expect(context.viewState.canEnableEncryption)
|
||||
|
||||
setupViewModel(joinedParentSpaces: [], joinRule: .public, forceDisableE2EE: true)
|
||||
#expect(!context.viewState.canEnableEncryption)
|
||||
}
|
||||
|
||||
// MARK: - Helpers
|
||||
|
||||
private func setupViewModel(joinedParentSpaces: [SpaceServiceRoom],
|
||||
topLevelSpaces: [SpaceServiceRoom] = [],
|
||||
joinRule: ElementX.JoinRule) {
|
||||
joinRule: ElementX.JoinRule,
|
||||
forceDisableE2EE: Bool = false) {
|
||||
let appSettings = AppSettings.volatile()
|
||||
appSettings.knockingEnabled = true
|
||||
appSettings.forceDisableE2EE.applyRemoteValue(forceDisableE2EE)
|
||||
roomProxy = JoinedRoomProxyMock(.init(isEncrypted: false,
|
||||
canonicalAlias: "#room:matrix.org",
|
||||
members: .allMembersAsCreator,
|
||||
|
||||
Reference in New Issue
Block a user