mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
allow copying blocked user id
This commit is contained in:
@@ -10,6 +10,7 @@ import Combine
|
||||
@testable import ElementX
|
||||
import Foundation
|
||||
import Testing
|
||||
import UIKit
|
||||
|
||||
@MainActor
|
||||
struct BlockedUsersScreenViewModelTests {
|
||||
@@ -42,4 +43,22 @@ struct BlockedUsersScreenViewModelTests {
|
||||
#expect(!viewModel.context.viewState.blockedUsers.isEmpty)
|
||||
#expect(clientProxy.profileForCalled)
|
||||
}
|
||||
|
||||
@Test
|
||||
func copyUserID() throws {
|
||||
let clientProxy = ClientProxyMock(.init(userID: RoomMemberProxyMock.mockMe.userID))
|
||||
let userIndicatorController = UserIndicatorControllerMock()
|
||||
|
||||
let viewModel = BlockedUsersScreenViewModel(hideProfiles: true,
|
||||
userSession: UserSessionMock(.init(clientProxy: clientProxy)),
|
||||
userIndicatorController: userIndicatorController)
|
||||
|
||||
let user = try #require(viewModel.context.viewState.blockedUsers.first)
|
||||
UIPasteboard.general.string = ""
|
||||
|
||||
viewModel.context.send(viewAction: .copyUserID(user))
|
||||
|
||||
#expect(UIPasteboard.general.string == user.id)
|
||||
#expect(userIndicatorController.submitIndicatorDelayReceivedArguments?.indicator.title == L10n.commonCopiedToClipboard)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user