Various test fixes (#873)

* Switch back to macos-12 and see if the tests work

* Fix unit tests, add default invited, joined and active member counts to the mock room proxy

* Try running UI tests on 14.3 but on an existing iPad simulator

* Revert "Try running UI tests on 14.3 but on an existing iPad simulator"

This reverts commit b075e7fa384330a9070dc35ed4dded57e0af26e1.
This commit is contained in:
Stefan Ceriu
2023-05-11 16:28:35 +03:00
committed by GitHub
parent 16eb3311f0
commit 3468ed2a02
8 changed files with 28 additions and 21 deletions
+1 -1
View File
@@ -9,7 +9,7 @@ on:
jobs:
integration_tests:
name: Integration Tests
runs-on: macos-13
runs-on: macos-12
concurrency:
# Only allow a single run of this workflow on each branch, automatically cancelling older runs.
+1 -1
View File
@@ -9,7 +9,7 @@ on:
jobs:
tests:
name: Tests
runs-on: macos-13
runs-on: macos-12
concurrency:
# When running on develop, use the sha to allow all runs of this workflow to run concurrently.
@@ -160,7 +160,7 @@ class AppCoordinator: AppCoordinatorProtocol {
case (.signingOut, .completedSigningOut(let isSoft), .signedOut):
self.presentSplashScreen(isSoftLogout: isSoft)
case (.signedIn, .clearCache, .initial):
clearCache()
self.clearCache()
default:
fatalError("Unknown transition: \(context)")
}
@@ -414,21 +414,21 @@ class RoomProxyMock: RoomProxyProtocol {
set(value) { underlyingMembersPublisher = value }
}
var underlyingMembersPublisher: AnyPublisher<[RoomMemberProxyProtocol], Never>!
var invitedMembersCount: UInt64 {
var invitedMembersCount: UInt {
get { return underlyingInvitedMembersCount }
set(value) { underlyingInvitedMembersCount = value }
}
var underlyingInvitedMembersCount: UInt64!
var joinedMembersCount: UInt64 {
var underlyingInvitedMembersCount: UInt!
var joinedMembersCount: UInt {
get { return underlyingJoinedMembersCount }
set(value) { underlyingJoinedMembersCount = value }
}
var underlyingJoinedMembersCount: UInt64!
var activeMembersCount: UInt64 {
var underlyingJoinedMembersCount: UInt!
var activeMembersCount: UInt {
get { return underlyingActiveMembersCount }
set(value) { underlyingActiveMembersCount = value }
}
var underlyingActiveMembersCount: UInt64!
var underlyingActiveMembersCount: UInt!
//MARK: - loadAvatarURLForUserId
@@ -33,6 +33,10 @@ struct RoomProxyMockConfiguration {
var hasUnreadNotifications = Bool.random()
var members: [RoomMemberProxyProtocol]?
var inviter: RoomMemberProxyMock?
var invitedMembersCount: UInt = 100
var joinedMembersCount: UInt = 50
var activeMembersCount: UInt = 25
}
extension RoomProxyMock {
@@ -52,6 +56,10 @@ extension RoomProxyMock {
canonicalAlias = configuration.canonicalAlias
alternativeAliases = configuration.alternativeAliases
hasUnreadNotifications = configuration.hasUnreadNotifications
invitedMembersCount = configuration.invitedMembersCount
joinedMembersCount = configuration.joinedMembersCount
activeMembersCount = configuration.activeMembersCount
if let members = configuration.members {
membersPublisher = Just(members).eraseToAnyPublisher()
@@ -44,9 +44,6 @@ class MediaUploadPreviewScreenViewModel: MediaUploadPreviewScreenViewModelType,
case .send:
Task {
startLoading()
defer {
stopLoading()
}
switch await mediaUploadingPreprocessor.processMedia(at: url) {
case .success(let mediaInfo):
@@ -58,9 +55,11 @@ class MediaUploadPreviewScreenViewModel: MediaUploadPreviewScreenViewModelType,
showError(label: L10n.screenMediaUploadPreviewErrorFailedSending)
}
stopLoading()
case .failure(let error):
MXLog.error("Failed processing media to upload with error: \(error)")
showError(label: L10n.screenMediaUploadPreviewErrorFailedProcessing)
stopLoading()
}
}
@@ -441,16 +441,16 @@ class RoomProxy: RoomProxyProtocol {
}
}
var invitedMembersCount: UInt64 {
room.invitedMembersCount()
var invitedMembersCount: UInt {
UInt(room.invitedMembersCount())
}
var joinedMembersCount: UInt64 {
room.joinedMembersCount()
var joinedMembersCount: UInt {
UInt(room.joinedMembersCount())
}
var activeMembersCount: UInt64 {
room.activeMembersCount()
var activeMembersCount: UInt {
UInt(room.activeMembersCount())
}
// MARK: - Private
@@ -105,11 +105,11 @@ protocol RoomProxyProtocol {
func fetchDetails(for eventID: String)
var invitedMembersCount: UInt64 { get }
var invitedMembersCount: UInt { get }
var joinedMembersCount: UInt64 { get }
var joinedMembersCount: UInt { get }
var activeMembersCount: UInt64 { get }
var activeMembersCount: UInt { get }
}
extension RoomProxyProtocol {