-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: add some tests to personal team - WPB-15469 #2446
base: develop
Are you sure you want to change the base?
Conversation
…ingConversations()`
@@ -82,7 +82,7 @@ struct ConversationEventProcessor { | |||
try await renameEventProcessor.processEvent(event) | |||
|
|||
case let .typing(event): | |||
try await typingEventProcessor.processEvent(event) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixes warning
@@ -23,7 +23,7 @@ struct UserLegalholdDisableEventProcessor: UserLegalholdDisableEventProcessorPro | |||
let repository: any UserRepositoryProtocol | |||
|
|||
func processEvent(_: UserLegalholdDisableEvent) async throws { | |||
try await repository.disableUserLegalHold() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixes warning
@@ -23,7 +23,7 @@ struct UserUpdateEventProcessor: UserUpdateEventProcessorProtocol { | |||
let repository: any UserRepositoryProtocol | |||
|
|||
func processEvent(_ event: UserUpdateEvent) async throws { | |||
try await repository.updateUser(from: event) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixes warning
@@ -412,7 +412,7 @@ public final class ConversationRepository: ConversationRepositoryProtocol { | |||
removedUsers: Set<UserID>, | |||
reason: ConversationMemberLeaveReason | |||
) async { | |||
var systemMessageType: SystemMessageType = switch reason { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixes warning
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes in this file are just to fix warnings
@@ -151,7 +151,7 @@ extension AssetV3UploadRequestStrategy: ZMUpstreamTranscoder { | |||
"sending request for asset", | |||
attributes: [.nonce: message.nonce?.safeForLoggingDescription ?? "<nil>"] | |||
) | |||
var request: ZMTransportRequest? = if shouldUseBackgroundSession { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixes warning
@@ -121,7 +121,7 @@ extension ZMUserSession { | |||
|
|||
func errorFromFailedDeleteResponse(_ response: ZMTransportResponse!) -> NSError { | |||
|
|||
var errorCode: UserSessionErrorCode = switch response.result { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixes warning
@@ -39,7 +39,7 @@ final class AuthenticationEmailLoginUnknownErrorHandler: AuthenticationEventHand | |||
} | |||
|
|||
// We try to validate the fields to detect an error | |||
var detectedError: NSError = if !ZMUser.isValidEmailAddress(credentials.email) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixes warning
@@ -138,7 +138,7 @@ final class ValidatedTextField: AccessoryTextField, TextContainer { | |||
self.textFieldValidator = TextFieldValidator() | |||
self.kind = kind | |||
|
|||
var textFieldAttributes: Attributes = if setNewColors == false { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixes warning
@@ -77,7 +77,7 @@ final class LabelIndicator: UIView { | |||
} | |||
|
|||
private func setupViews() { | |||
var accessibilityString = switch context { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixes warning
@@ -155,7 +155,7 @@ final class ConversationNewDeviceSystemMessageCellDescription: ConversationMessa | |||
) | |||
let attributedText = attributedSenderNames | |||
|
|||
var linkTarget: View.LinkTarget = if let user = users.first, users.count == 1 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixes warning
@@ -291,7 +291,7 @@ extension ConversationContentViewController: SignatureObserver { | |||
} | |||
|
|||
private func presentDigitalSignatureErrorAlert(errorType: SignatureStatus.ErrorYpe) { | |||
var message: String? = switch errorType { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixes warning
@@ -343,7 +343,7 @@ final class ConversationContentViewController: UIViewController { | |||
return nil | |||
} | |||
|
|||
let message = dataSource.messages[indexPath.section] as? ZMMessage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixes warning
@@ -85,7 +85,7 @@ final class CameraKeyboardPermissionsCell: UICollectionViewCell { | |||
|
|||
func configure(deniedAuthorization: DeniedAuthorizationType) { | |||
typealias KeyboardPhotoAccessDeniedLocale = L10n.Localizable.KeyboardPhotosAccess.Denied.Keyboard | |||
var title: String = switch deniedAuthorization { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixes warning
@@ -27,7 +27,7 @@ extension MainCoordinator: ArchivedListViewControllerDelegate where Dependencies | |||
) { | |||
Task { @MainActor in | |||
await showConversationList(conversationFilter: .none) | |||
await showConversation(conversation: conversation, message: nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixes warning
@@ -28,7 +28,7 @@ extension MainCoordinator: ConversationCreationControllerDelegate | |||
) { | |||
Task { | |||
await showConversationList(conversationFilter: .none) | |||
await showConversation(conversation: conversation, message: nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixes warning
@@ -37,7 +37,7 @@ extension ZClientViewController: StartUIDelegate { | |||
// If the conversation exists, and is established (in case of mls), | |||
// then we open the conversation | |||
guard let conversation else { return } | |||
await mainCoordinator.showConversation(conversation: conversation, message: nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixes warning
@@ -57,7 +57,7 @@ extension ZClientViewController: StartUIDelegate { | |||
func startUIViewController(_ viewController: StartUIViewController, didSelect conversation: ZMConversation) { | |||
Task { | |||
await mainCoordinator.showConversationList(conversationFilter: .none) | |||
await mainCoordinator.showConversation(conversation: conversation, message: nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixes warning
Test Results 5 files 6 suites 10m 25s ⏱️ Results for commit 68f5a35. |
Datadog ReportBranch report: ✅ 0 Failed, 6645 Passed, 28 Skipped, 5m 11.17s Total Time |
This whole time I've been capitalizing my PR titles incorrectly 🤦 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
left a question before approving
} | ||
|
||
private func product<T, U>(_ aCollection: [T], _ bCollection: [U]) -> [(T, U)] { | ||
aCollection.flatMap { a in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does it require that aCollection and bCollection are same size ?
|
||
let conversations = await context.perform { [self] in | ||
product(connectionStatuses, conversationTypes).map { status, conversationType in | ||
makeConnection(status: status, type: conversationType) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: makeConversationWithConnection
_ = try await createConversations([ | ||
.init(.oneOnOne, .mls, team: nil, users: [selfUser, userA], name: nil), // <- 1:1 MLS with UserA | ||
.init(.oneOnOne, .mls, team: nil, users: [selfUser, userA], name: nil), // <- 1:1 MLS with UserA | ||
.init(.group, .proteus, team: team, users: [selfUser, userA], name: nil), // <- 1:1 proteus fake with UserA | ||
.init(.group, .proteus, team: team, users: [selfUser, userA], name: nil), // <- 1:1 proteus fake with UserA | ||
.init(.oneOnOne, .proteus, team: nil, users: [selfUser, userA], name: nil), // <- 1:1 proteus with UserA | ||
.init(.oneOnOne, .proteus, team: nil, users: [selfUser, userA], name: nil), // <- 1:1 proteus with UserA | ||
.init(.connection, .proteus, team: nil, users: [selfUser, userA], name: nil), // <- 1:1 prot. pending UserA | ||
.init(.connection, .proteus, team: nil, users: [selfUser, userA], name: nil) // <- 1:1 prot. pending UserA |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: there are all doubled here? not sure what we're trying to test?
Issue
This PR adds some tests to the personal to team bug fix (WPB-15275). Unfortunately it in no way covers everything but I have some other priorities right now.
It also fixes some easy to fix warnings that I found randomly.
Testing
Run tests
Checklist
[WPB-XXX]
.