mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:06:00 +00:00
Removing dead code part 3 (#2264)
This commit is contained in:
@@ -134,10 +134,10 @@ class AnalyticsTests: XCTestCase {
|
||||
XCTAssertNil(client.pendingUserProperties, "No user properties should have been set yet.")
|
||||
|
||||
// When updating the user properties
|
||||
client.updateUserProperties(AnalyticsEvent.UserProperties(ftueUseCaseSelection: .PersonalMessaging,
|
||||
client.updateUserProperties(AnalyticsEvent.UserProperties(allChatsActiveFilter: nil,
|
||||
ftueUseCaseSelection: .PersonalMessaging,
|
||||
numFavouriteRooms: 4,
|
||||
numSpaces: 5,
|
||||
allChatsActiveFilter: nil))
|
||||
numSpaces: 5))
|
||||
|
||||
// Then the properties should be cached
|
||||
XCTAssertNotNil(client.pendingUserProperties, "The user properties should be cached.")
|
||||
@@ -149,10 +149,9 @@ class AnalyticsTests: XCTestCase {
|
||||
func testMergingUserProperties() {
|
||||
// Given a client with a cached use case user properties
|
||||
let client = PostHogAnalyticsClient()
|
||||
client.updateUserProperties(AnalyticsEvent.UserProperties(ftueUseCaseSelection: .PersonalMessaging,
|
||||
client.updateUserProperties(AnalyticsEvent.UserProperties(allChatsActiveFilter: nil, ftueUseCaseSelection: .PersonalMessaging,
|
||||
numFavouriteRooms: nil,
|
||||
numSpaces: nil,
|
||||
allChatsActiveFilter: nil))
|
||||
numSpaces: nil))
|
||||
|
||||
XCTAssertNotNil(client.pendingUserProperties, "The user properties should be cached.")
|
||||
XCTAssertEqual(client.pendingUserProperties?.ftueUseCaseSelection, .PersonalMessaging, "The use case selection should match.")
|
||||
@@ -160,10 +159,9 @@ class AnalyticsTests: XCTestCase {
|
||||
XCTAssertNil(client.pendingUserProperties?.numSpaces, "The number of spaces should not be set.")
|
||||
|
||||
// When updating the number of spaced
|
||||
client.updateUserProperties(AnalyticsEvent.UserProperties(ftueUseCaseSelection: nil,
|
||||
client.updateUserProperties(AnalyticsEvent.UserProperties(allChatsActiveFilter: nil, ftueUseCaseSelection: nil,
|
||||
numFavouriteRooms: 4,
|
||||
numSpaces: 5,
|
||||
allChatsActiveFilter: nil))
|
||||
numSpaces: 5))
|
||||
|
||||
// Then the new properties should be updated and the existing properties should remain unchanged
|
||||
XCTAssertNotNil(client.pendingUserProperties, "The user properties should be cached.")
|
||||
@@ -175,10 +173,9 @@ class AnalyticsTests: XCTestCase {
|
||||
func testSendingUserProperties() {
|
||||
// Given a client with user properties set
|
||||
let client = PostHogAnalyticsClient()
|
||||
client.updateUserProperties(AnalyticsEvent.UserProperties(ftueUseCaseSelection: .PersonalMessaging,
|
||||
client.updateUserProperties(AnalyticsEvent.UserProperties(allChatsActiveFilter: nil, ftueUseCaseSelection: .PersonalMessaging,
|
||||
numFavouriteRooms: nil,
|
||||
numSpaces: nil,
|
||||
allChatsActiveFilter: nil))
|
||||
numSpaces: nil))
|
||||
client.start(analyticsConfiguration: appSettings.analyticsConfiguration)
|
||||
|
||||
XCTAssertNotNil(client.pendingUserProperties, "The user properties should be cached.")
|
||||
|
||||
@@ -19,7 +19,7 @@ import UserNotifications
|
||||
import XCTest
|
||||
|
||||
extension UNNotification {
|
||||
static func with(userInfo: [AnyHashable: Any], actionIdentifier: String = UNNotificationDefaultActionIdentifier) throws -> UNNotification {
|
||||
static func with(userInfo: [AnyHashable: Any]) throws -> UNNotification {
|
||||
let content = UNMutableNotificationContent()
|
||||
content.userInfo = userInfo
|
||||
let request = UNNotificationRequest(identifier: "",
|
||||
|
||||
@@ -24,17 +24,12 @@ class RoomPollsHistoryScreenViewModelTests: XCTestCase {
|
||||
var interactionHandler: PollInteractionHandlerMock!
|
||||
var timelineController: MockRoomTimelineController!
|
||||
|
||||
var context: RoomPollsHistoryScreenViewModelType.Context {
|
||||
viewModel.context
|
||||
}
|
||||
|
||||
override func setUpWithError() throws {
|
||||
interactionHandler = PollInteractionHandlerMock()
|
||||
timelineController = MockRoomTimelineController()
|
||||
let roomProxyMockConfiguration = RoomProxyMockConfiguration(displayName: "Polls")
|
||||
roomProxyMockConfiguration.timeline.timelineStartReached = false
|
||||
viewModel = RoomPollsHistoryScreenViewModel(roomProxy: RoomProxyMock(with: roomProxyMockConfiguration),
|
||||
pollInteractionHandler: interactionHandler,
|
||||
viewModel = RoomPollsHistoryScreenViewModel(pollInteractionHandler: interactionHandler,
|
||||
roomTimelineController: timelineController,
|
||||
userIndicatorController: UserIndicatorControllerMock())
|
||||
}
|
||||
|
||||
@@ -20,10 +20,6 @@ import XCTest
|
||||
|
||||
@MainActor
|
||||
class ServerSelectionViewModelTests: XCTestCase {
|
||||
private enum Constants {
|
||||
static let counterInitialValue = 0
|
||||
}
|
||||
|
||||
var viewModel: ServerSelectionScreenViewModelProtocol!
|
||||
var context: ServerSelectionScreenViewModelType.Context!
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@ import XCTest
|
||||
class StaticLocationScreenViewModelTests: XCTestCase {
|
||||
var viewModel: StaticLocationScreenViewModelProtocol!
|
||||
|
||||
private let usersSubject = CurrentValueSubject<[UserProfileProxy], Never>([])
|
||||
private var cancellables = Set<AnyCancellable>()
|
||||
|
||||
var context: StaticLocationScreenViewModel.Context {
|
||||
|
||||
@@ -26,8 +26,6 @@ class VoiceMessageCacheTests: XCTestCase {
|
||||
private var fileManager: FileManager!
|
||||
|
||||
private let someURL = URL("/some/url")
|
||||
private let cachedFileURL = URL("/cache/file/url")
|
||||
private let audioOGGMimeType = "audio/ogg"
|
||||
private let testFilename = "test-file"
|
||||
private let mpeg4aacFileExtension = "m4a"
|
||||
private let testTemporaryDirectory = URL.temporaryDirectory.appendingPathComponent("test-voice-messsage-cache")
|
||||
|
||||
@@ -61,7 +61,6 @@ class VoiceMessageRecorderTests: XCTestCase {
|
||||
|
||||
voiceMessageRecorder = VoiceMessageRecorder(audioRecorder: audioRecorder,
|
||||
mediaPlayerProvider: mediaPlayerProvider,
|
||||
audioConverter: audioConverter,
|
||||
voiceMessageCache: voiceMessageCache)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user