mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
fixed the room members flow coordinator tests
This commit is contained in:
@@ -14,7 +14,7 @@ import Combine
|
|||||||
class RoomMembersFlowCoordinatorTests: XCTestCase {
|
class RoomMembersFlowCoordinatorTests: XCTestCase {
|
||||||
var membersFlowCoordinator: RoomMembersFlowCoordinator!
|
var membersFlowCoordinator: RoomMembersFlowCoordinator!
|
||||||
var navigationStackCoordinator: NavigationStackCoordinator!
|
var navigationStackCoordinator: NavigationStackCoordinator!
|
||||||
let stateMachineFactory = PublishedStateMachineFactory()
|
var stateMachineFactory: PublishedStateMachineFactory!
|
||||||
|
|
||||||
func testClearRoute() async throws {
|
func testClearRoute() async throws {
|
||||||
try await setUp(entryPoint: .roomMembersList)
|
try await setUp(entryPoint: .roomMembersList)
|
||||||
@@ -41,11 +41,15 @@ class RoomMembersFlowCoordinatorTests: XCTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private func setUp(entryPoint: RoomMembersFlowCoordinatorEntryPoint) async throws {
|
private func setUp(entryPoint: RoomMembersFlowCoordinatorEntryPoint) async throws {
|
||||||
|
stateMachineFactory = .init()
|
||||||
navigationStackCoordinator = NavigationStackCoordinator()
|
navigationStackCoordinator = NavigationStackCoordinator()
|
||||||
navigationStackCoordinator.setRootCoordinator(PlaceholderScreenCoordinator(hideBrandChrome: false))
|
navigationStackCoordinator.setRootCoordinator(PlaceholderScreenCoordinator(hideBrandChrome: false))
|
||||||
navigationStackCoordinator.push(BlankFormCoordinator())
|
navigationStackCoordinator.push(BlankFormCoordinator())
|
||||||
|
|
||||||
|
let clientProxy = ClientProxyMock(.init())
|
||||||
|
clientProxy.directRoomForUserIDReturnValue = .success(nil)
|
||||||
|
|
||||||
let flowParameters = CommonFlowParameters(userSession: UserSessionMock(.init()),
|
let flowParameters = CommonFlowParameters(userSession: UserSessionMock(.init(clientProxy: clientProxy)),
|
||||||
bugReportService: BugReportServiceMock(.init()),
|
bugReportService: BugReportServiceMock(.init()),
|
||||||
elementCallService: ElementCallServiceMock(.init()),
|
elementCallService: ElementCallServiceMock(.init()),
|
||||||
timelineControllerFactory: TimelineControllerFactoryMock(.init()),
|
timelineControllerFactory: TimelineControllerFactoryMock(.init()),
|
||||||
@@ -60,6 +64,10 @@ class RoomMembersFlowCoordinatorTests: XCTestCase {
|
|||||||
stateMachineFactory: stateMachineFactory)
|
stateMachineFactory: stateMachineFactory)
|
||||||
|
|
||||||
let roomProxy = JoinedRoomProxyMock(.init())
|
let roomProxy = JoinedRoomProxyMock(.init())
|
||||||
|
roomProxy.getMemberUserIDClosure = { _ in
|
||||||
|
.success(RoomMemberProxyMock(with: .init(userID: "test", membership: .join)))
|
||||||
|
}
|
||||||
|
|
||||||
membersFlowCoordinator = RoomMembersFlowCoordinator(entryPoint: entryPoint,
|
membersFlowCoordinator = RoomMembersFlowCoordinator(entryPoint: entryPoint,
|
||||||
roomProxy: roomProxy,
|
roomProxy: roomProxy,
|
||||||
navigationStackCoordinator: navigationStackCoordinator,
|
navigationStackCoordinator: navigationStackCoordinator,
|
||||||
|
|||||||
Reference in New Issue
Block a user