mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Adopt the lastest SDK APIs and refactor how we deal with user permissions.
This patch introduces a new RoomPowerLevelsProxy and its associated mock and adopts newer Rust APIs to make working with user power levels and permissions easier.
This commit is contained in:
committed by
Stefan Ceriu
parent
96e5ed06f5
commit
f522e15dac
@@ -167,8 +167,12 @@ class RoomScreenViewModelTests: XCTestCase {
|
||||
var configuration = JoinedRoomProxyMockConfiguration(id: "TestID", name: "StartingName", avatarURL: nil, hasOngoingCall: false)
|
||||
let infoSubject = CurrentValueSubject<RoomInfoProxy, Never>(.init(roomInfo: RoomInfo(configuration)))
|
||||
let roomProxyMock = JoinedRoomProxyMock(configuration)
|
||||
|
||||
let powerLevelsMock = RoomPowerLevelsProxyMock(configuration: .init())
|
||||
roomProxyMock.powerLevelsReturnValue = .success(powerLevelsMock)
|
||||
|
||||
// setup the room proxy actions publisher
|
||||
roomProxyMock.canUserJoinCallUserIDReturnValue = .success(false)
|
||||
powerLevelsMock.canUserJoinCallUserIDReturnValue = .success(false)
|
||||
roomProxyMock.underlyingInfoPublisher = infoSubject.asCurrentValuePublisher()
|
||||
let viewModel = RoomScreenViewModel(clientProxy: ClientProxyMock(),
|
||||
roomProxy: roomProxyMock,
|
||||
@@ -193,7 +197,7 @@ class RoomScreenViewModelTests: XCTestCase {
|
||||
configuration.name = "NewName"
|
||||
configuration.avatarURL = .mockMXCAvatar
|
||||
configuration.hasOngoingCall = true
|
||||
roomProxyMock.canUserJoinCallUserIDReturnValue = .success(true)
|
||||
powerLevelsMock.canUserJoinCallUserIDReturnValue = .success(true)
|
||||
|
||||
deferred = deferFulfillment(viewModel.context.$viewState) { viewState in
|
||||
viewState.roomTitle == "NewName" &&
|
||||
|
||||
Reference in New Issue
Block a user