mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Fixes #2320 - Implement support for (un)marking rooms as favourite from the room list and room detail screens
This commit is contained in:
@@ -36,14 +36,15 @@ class HomeScreenRoomTests: XCTestCase {
|
||||
avatarURL: nil,
|
||||
lastMessage: nil,
|
||||
lastMessageFormattedTimestamp: nil,
|
||||
isMarkedUnread: isMarkedUnread,
|
||||
unreadMessagesCount: unreadMessagesCount,
|
||||
unreadMentionsCount: unreadMentionsCount,
|
||||
unreadNotificationsCount: unreadNotificationsCount,
|
||||
notificationMode: notificationMode,
|
||||
canonicalAlias: nil,
|
||||
inviter: nil,
|
||||
hasOngoingCall: hasOngoingCall)
|
||||
hasOngoingCall: hasOngoingCall,
|
||||
isMarkedUnread: isMarkedUnread,
|
||||
isFavourite: false)
|
||||
}
|
||||
|
||||
func testNoBadge() {
|
||||
|
||||
@@ -35,8 +35,9 @@ class HomeScreenViewModelTests: XCTestCase {
|
||||
viewModel = HomeScreenViewModel(userSession: MockUserSession(clientProxy: clientProxy,
|
||||
mediaProvider: MockMediaProvider(),
|
||||
voiceMessageMediaManager: VoiceMessageMediaManagerMock()),
|
||||
selectedRoomPublisher: CurrentValueSubject<String?, Never>(nil).asCurrentValuePublisher(),
|
||||
analyticsService: ServiceLocator.shared.analytics,
|
||||
appSettings: ServiceLocator.shared.settings,
|
||||
selectedRoomPublisher: CurrentValueSubject<String?, Never>(nil).asCurrentValuePublisher(),
|
||||
userIndicatorController: ServiceLocator.shared.userIndicatorController)
|
||||
}
|
||||
|
||||
|
||||
@@ -229,14 +229,15 @@ class LoggingTests: XCTestCase {
|
||||
avatarURL: nil,
|
||||
lastMessage: AttributedString(lastMessage),
|
||||
lastMessageFormattedTimestamp: "Now",
|
||||
isMarkedUnread: false,
|
||||
unreadMessagesCount: 0,
|
||||
unreadMentionsCount: 0,
|
||||
unreadNotificationsCount: 0,
|
||||
notificationMode: nil,
|
||||
canonicalAlias: nil,
|
||||
inviter: nil,
|
||||
hasOngoingCall: false)
|
||||
hasOngoingCall: false,
|
||||
isMarkedUnread: false,
|
||||
isFavourite: false)
|
||||
|
||||
// When logging that value
|
||||
XCTAssert(MXLogger.logFiles.isEmpty)
|
||||
|
||||
@@ -36,6 +36,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase {
|
||||
viewModel = RoomDetailsScreenViewModel(accountUserID: "@owner:somewhere.com",
|
||||
roomProxy: roomProxyMock,
|
||||
mediaProvider: MockMediaProvider(),
|
||||
analyticsService: ServiceLocator.shared.analytics,
|
||||
userIndicatorController: ServiceLocator.shared.userIndicatorController,
|
||||
notificationSettingsProxy: notificationSettingsProxyMock,
|
||||
attributedStringBuilder: AttributedStringBuilder(permalinkBaseURL: ServiceLocator.shared.settings.permalinkBaseURL,
|
||||
@@ -50,6 +51,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase {
|
||||
viewModel = RoomDetailsScreenViewModel(accountUserID: "@owner:somewhere.com",
|
||||
roomProxy: roomProxyMock,
|
||||
mediaProvider: MockMediaProvider(),
|
||||
analyticsService: ServiceLocator.shared.analytics,
|
||||
userIndicatorController: ServiceLocator.shared.userIndicatorController,
|
||||
notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()),
|
||||
attributedStringBuilder: AttributedStringBuilder(permalinkBaseURL: ServiceLocator.shared.settings.permalinkBaseURL,
|
||||
@@ -71,6 +73,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase {
|
||||
viewModel = RoomDetailsScreenViewModel(accountUserID: "@owner:somewhere.com",
|
||||
roomProxy: roomProxyMock,
|
||||
mediaProvider: MockMediaProvider(),
|
||||
analyticsService: ServiceLocator.shared.analytics,
|
||||
userIndicatorController: ServiceLocator.shared.userIndicatorController,
|
||||
notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()),
|
||||
attributedStringBuilder: AttributedStringBuilder(permalinkBaseURL: ServiceLocator.shared.settings.permalinkBaseURL,
|
||||
@@ -93,6 +96,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase {
|
||||
viewModel = RoomDetailsScreenViewModel(accountUserID: "@owner:somewhere.com",
|
||||
roomProxy: roomProxyMock,
|
||||
mediaProvider: MockMediaProvider(),
|
||||
analyticsService: ServiceLocator.shared.analytics,
|
||||
userIndicatorController: ServiceLocator.shared.userIndicatorController,
|
||||
notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()),
|
||||
attributedStringBuilder: AttributedStringBuilder(permalinkBaseURL: ServiceLocator.shared.settings.permalinkBaseURL,
|
||||
@@ -145,6 +149,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase {
|
||||
viewModel = RoomDetailsScreenViewModel(accountUserID: "@owner:somewhere.com",
|
||||
roomProxy: roomProxyMock,
|
||||
mediaProvider: MockMediaProvider(),
|
||||
analyticsService: ServiceLocator.shared.analytics,
|
||||
userIndicatorController: ServiceLocator.shared.userIndicatorController,
|
||||
notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()),
|
||||
attributedStringBuilder: AttributedStringBuilder(permalinkBaseURL: ServiceLocator.shared.settings.permalinkBaseURL,
|
||||
@@ -171,6 +176,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase {
|
||||
viewModel = RoomDetailsScreenViewModel(accountUserID: "@owner:somewhere.com",
|
||||
roomProxy: roomProxyMock,
|
||||
mediaProvider: MockMediaProvider(),
|
||||
analyticsService: ServiceLocator.shared.analytics,
|
||||
userIndicatorController: ServiceLocator.shared.userIndicatorController,
|
||||
notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()),
|
||||
attributedStringBuilder: AttributedStringBuilder(permalinkBaseURL: ServiceLocator.shared.settings.permalinkBaseURL,
|
||||
@@ -206,6 +212,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase {
|
||||
viewModel = RoomDetailsScreenViewModel(accountUserID: "@owner:somewhere.com",
|
||||
roomProxy: roomProxyMock,
|
||||
mediaProvider: MockMediaProvider(),
|
||||
analyticsService: ServiceLocator.shared.analytics,
|
||||
userIndicatorController: ServiceLocator.shared.userIndicatorController,
|
||||
notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()),
|
||||
attributedStringBuilder: AttributedStringBuilder(permalinkBaseURL: ServiceLocator.shared.settings.permalinkBaseURL,
|
||||
@@ -242,6 +249,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase {
|
||||
viewModel = RoomDetailsScreenViewModel(accountUserID: "@owner:somewhere.com",
|
||||
roomProxy: roomProxyMock,
|
||||
mediaProvider: MockMediaProvider(),
|
||||
analyticsService: ServiceLocator.shared.analytics,
|
||||
userIndicatorController: ServiceLocator.shared.userIndicatorController,
|
||||
notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()),
|
||||
attributedStringBuilder: AttributedStringBuilder(permalinkBaseURL: ServiceLocator.shared.settings.permalinkBaseURL,
|
||||
@@ -277,6 +285,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase {
|
||||
viewModel = RoomDetailsScreenViewModel(accountUserID: "@owner:somewhere.com",
|
||||
roomProxy: roomProxyMock,
|
||||
mediaProvider: MockMediaProvider(),
|
||||
analyticsService: ServiceLocator.shared.analytics,
|
||||
userIndicatorController: ServiceLocator.shared.userIndicatorController,
|
||||
notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()),
|
||||
attributedStringBuilder: AttributedStringBuilder(permalinkBaseURL: ServiceLocator.shared.settings.permalinkBaseURL,
|
||||
@@ -311,6 +320,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase {
|
||||
viewModel = RoomDetailsScreenViewModel(accountUserID: "@owner:somewhere.com",
|
||||
roomProxy: roomProxyMock,
|
||||
mediaProvider: MockMediaProvider(),
|
||||
analyticsService: ServiceLocator.shared.analytics,
|
||||
userIndicatorController: ServiceLocator.shared.userIndicatorController,
|
||||
notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()),
|
||||
attributedStringBuilder: AttributedStringBuilder(permalinkBaseURL: ServiceLocator.shared.settings.permalinkBaseURL,
|
||||
@@ -327,6 +337,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase {
|
||||
viewModel = RoomDetailsScreenViewModel(accountUserID: "@owner:somewhere.com",
|
||||
roomProxy: roomProxyMock,
|
||||
mediaProvider: MockMediaProvider(),
|
||||
analyticsService: ServiceLocator.shared.analytics,
|
||||
userIndicatorController: ServiceLocator.shared.userIndicatorController,
|
||||
notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()),
|
||||
attributedStringBuilder: AttributedStringBuilder(permalinkBaseURL: ServiceLocator.shared.settings.permalinkBaseURL,
|
||||
@@ -360,6 +371,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase {
|
||||
viewModel = RoomDetailsScreenViewModel(accountUserID: "@owner:somewhere.com",
|
||||
roomProxy: roomProxyMock,
|
||||
mediaProvider: MockMediaProvider(),
|
||||
analyticsService: ServiceLocator.shared.analytics,
|
||||
userIndicatorController: ServiceLocator.shared.userIndicatorController,
|
||||
notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()),
|
||||
attributedStringBuilder: AttributedStringBuilder(permalinkBaseURL: ServiceLocator.shared.settings.permalinkBaseURL,
|
||||
@@ -380,6 +392,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase {
|
||||
viewModel = RoomDetailsScreenViewModel(accountUserID: "@owner:somewhere.com",
|
||||
roomProxy: roomProxyMock,
|
||||
mediaProvider: MockMediaProvider(),
|
||||
analyticsService: ServiceLocator.shared.analytics,
|
||||
userIndicatorController: ServiceLocator.shared.userIndicatorController,
|
||||
notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()),
|
||||
attributedStringBuilder: AttributedStringBuilder(permalinkBaseURL: ServiceLocator.shared.settings.permalinkBaseURL,
|
||||
@@ -400,6 +413,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase {
|
||||
viewModel = RoomDetailsScreenViewModel(accountUserID: "@owner:somewhere.com",
|
||||
roomProxy: roomProxyMock,
|
||||
mediaProvider: MockMediaProvider(),
|
||||
analyticsService: ServiceLocator.shared.analytics,
|
||||
userIndicatorController: ServiceLocator.shared.userIndicatorController,
|
||||
notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()),
|
||||
attributedStringBuilder: AttributedStringBuilder(permalinkBaseURL: ServiceLocator.shared.settings.permalinkBaseURL,
|
||||
@@ -420,6 +434,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase {
|
||||
viewModel = RoomDetailsScreenViewModel(accountUserID: "@owner:somewhere.com",
|
||||
roomProxy: roomProxyMock,
|
||||
mediaProvider: MockMediaProvider(),
|
||||
analyticsService: ServiceLocator.shared.analytics,
|
||||
userIndicatorController: ServiceLocator.shared.userIndicatorController,
|
||||
notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()),
|
||||
attributedStringBuilder: AttributedStringBuilder(permalinkBaseURL: ServiceLocator.shared.settings.permalinkBaseURL,
|
||||
@@ -439,6 +454,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase {
|
||||
viewModel = RoomDetailsScreenViewModel(accountUserID: "@owner:somewhere.com",
|
||||
roomProxy: roomProxyMock,
|
||||
mediaProvider: MockMediaProvider(),
|
||||
analyticsService: ServiceLocator.shared.analytics,
|
||||
userIndicatorController: ServiceLocator.shared.userIndicatorController,
|
||||
notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()),
|
||||
attributedStringBuilder: AttributedStringBuilder(permalinkBaseURL: ServiceLocator.shared.settings.permalinkBaseURL,
|
||||
@@ -456,6 +472,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase {
|
||||
viewModel = RoomDetailsScreenViewModel(accountUserID: "@owner:somewhere.com",
|
||||
roomProxy: roomProxyMock,
|
||||
mediaProvider: MockMediaProvider(),
|
||||
analyticsService: ServiceLocator.shared.analytics,
|
||||
userIndicatorController: ServiceLocator.shared.userIndicatorController,
|
||||
notificationSettingsProxy: notificationSettingsProxyMock,
|
||||
attributedStringBuilder: AttributedStringBuilder(permalinkBaseURL: ServiceLocator.shared.settings.permalinkBaseURL,
|
||||
|
||||
Reference in New Issue
Block a user