mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 12:07:55 +00:00
Observe room info updates and automatically dismiss the room if meanwhile left or banned (#4122)
* Fix #3302 - Observe room info updates and automatically dismiss the room if meanwhile left or banned.
This commit is contained in:
@@ -268,6 +268,31 @@ class RoomFlowCoordinatorTests: XCTestCase {
|
||||
XCTAssertNil(navigationStackCoordinator.sheetCoordinator, "The media upload sheet shouldn't be shown when sharing text.")
|
||||
}
|
||||
|
||||
func testLeavingRoom() async throws {
|
||||
await setupRoomFlowCoordinator()
|
||||
|
||||
var configuration = JoinedRoomProxyMockConfiguration()
|
||||
let roomProxy = JoinedRoomProxyMock(configuration)
|
||||
|
||||
let roomInfoSubject = CurrentValueSubject<RoomInfoProxy, Never>(.init(roomInfo: .init(configuration)))
|
||||
roomProxy.infoPublisher = roomInfoSubject.asCurrentValuePublisher()
|
||||
|
||||
clientProxy.roomForIdentifierClosure = { _ in
|
||||
.joined(roomProxy)
|
||||
}
|
||||
|
||||
try await process(route: .room(roomID: "1", via: []))
|
||||
|
||||
let fulfillment = deferFulfillment(roomFlowCoordinator.actions) { action in
|
||||
action == .finished
|
||||
}
|
||||
|
||||
configuration.membership = .left
|
||||
roomInfoSubject.send(.init(roomInfo: .init(configuration)))
|
||||
|
||||
try await fulfillment.fulfill()
|
||||
}
|
||||
|
||||
// MARK: - Private
|
||||
|
||||
private func process(route: AppRoute) async throws {
|
||||
|
||||
Reference in New Issue
Block a user