Update room summary provider mock room details and snapshots

This commit is contained in:
Stefan Ceriu
2023-11-13 15:59:56 +02:00
committed by Stefan Ceriu
parent 03b73a1605
commit 037ada0d3d
6 changed files with 74 additions and 33 deletions

View File

@@ -216,10 +216,6 @@ struct HomeScreenRoomCell_Previews: PreviewProvider, TestablePreview {
HomeScreenRoomCell(room: .placeholder(), context: viewModel.context, isSelected: false)
.redacted(reason: .placeholder)
HomeScreenRoomCell(room: .placeholder(), context: viewModel.context, isSelected: false)
.redacted(reason: .placeholder)
HomeScreenRoomCell(room: .placeholder(), context: viewModel.context, isSelected: false)
.redacted(reason: .placeholder)
}
}
}

View File

@@ -77,37 +77,82 @@ class MockRoomSummaryProvider: RoomSummaryProviderProtocol {
extension Array where Element == RoomSummary {
static let mockRooms: [Element] = [
.filled(details: RoomSummaryDetails(id: "1", name: "First room",
.filled(details: RoomSummaryDetails(id: "1",
name: "Foundation 🔭🪐🌌",
isDirect: true,
avatarURL: nil,
lastMessage: AttributedString("Prosciutto beef ribs pancetta filet mignon kevin hamburger, chuck ham venison picanha. Beef ribs chislic turkey biltong tenderloin."),
lastMessageFormattedTimestamp: "Now",
lastMessage: AttributedString("I do not wish to take the trouble to understand mysticism"),
lastMessageFormattedTimestamp: "14:56",
unreadNotificationCount: 0,
notificationMode: .allMessages,
canonicalAlias: nil,
inviter: nil,
hasOngoingCall: false)),
.filled(details: RoomSummaryDetails(id: "2",
name: "Foundation and Empire",
isDirect: true,
avatarURL: URL.picturesDirectory,
lastMessage: AttributedString("How do you see the Emperor then? You think he keeps office hours?"),
lastMessageFormattedTimestamp: "2:56 PM",
unreadNotificationCount: 2,
notificationMode: .mute,
canonicalAlias: nil,
inviter: nil,
hasOngoingCall: false)),
.filled(details: RoomSummaryDetails(id: "3",
name: "Second Foundation",
isDirect: true,
avatarURL: nil,
lastMessage: try? AttributedString(markdown: "He certainly seemed no *mental genius* to me"),
lastMessageFormattedTimestamp: "Some time ago",
unreadNotificationCount: 3,
notificationMode: .mentionsAndKeywordsOnly,
canonicalAlias: nil,
inviter: nil,
hasOngoingCall: false)),
.filled(details: RoomSummaryDetails(id: "4",
name: "Foundation's Edge",
isDirect: true,
avatarURL: nil,
lastMessage: AttributedString("There's an archaic measure of time that's called the month"),
lastMessageFormattedTimestamp: "Just now",
unreadNotificationCount: 4,
notificationMode: .allMessages,
canonicalAlias: nil,
inviter: RoomMemberProxyMock.mockCharlie,
hasOngoingCall: true)),
.filled(details: RoomSummaryDetails(id: "2",
name: "Second room",
isDirect: true,
avatarURL: URL.picturesDirectory,
lastMessage: nil,
lastMessageFormattedTimestamp: nil,
unreadNotificationCount: 1,
notificationMode: .mentionsAndKeywordsOnly,
canonicalAlias: nil,
inviter: RoomMemberProxyMock.mockCharlie,
inviter: nil,
hasOngoingCall: false)),
.filled(details: RoomSummaryDetails(id: "3",
name: "Third room",
.filled(details: RoomSummaryDetails(id: "5",
name: "Foundation and Earth",
isDirect: true,
avatarURL: nil,
lastMessage: try? AttributedString(markdown: "**@mock:client.com**: T-bone beef ribs bacon"),
lastMessageFormattedTimestamp: "Later",
unreadNotificationCount: 0,
lastMessage: AttributedString("Clearly, if Earth is powerful enough to do that, it might also be capable of adjusting minds in order to force belief in its radioactivity"),
lastMessageFormattedTimestamp: "1986",
unreadNotificationCount: 5,
notificationMode: .allMessages,
canonicalAlias: nil,
inviter: nil,
hasOngoingCall: true)),
.filled(details: RoomSummaryDetails(id: "6",
name: "Prelude to Foundation",
isDirect: true,
avatarURL: nil,
lastMessage: AttributedString("Are you groping for the word 'paranoia'?"),
lastMessageFormattedTimestamp: "きょうはじゅういちがつじゅういちにちです",
unreadNotificationCount: 6,
notificationMode: .mute,
canonicalAlias: nil,
inviter: RoomMemberProxyMock.mockCharlie,
inviter: nil,
hasOngoingCall: true)),
.filled(details: RoomSummaryDetails(id: "0",
name: "Unknown",
isDirect: false,
avatarURL: nil,
lastMessage: nil,
lastMessageFormattedTimestamp: nil,
unreadNotificationCount: 0,
notificationMode: nil,
canonicalAlias: nil,
inviter: nil,
hasOngoingCall: false)),
.empty
]

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:036b3bb2926f55e4a495fa361f086a9af17d119f528550f8c8015ca96005ad9d
size 161158
oid sha256:5958eb51b8c3c3754bd88b3ee9bf35a50f7ae7926d732652fe891453bc7f5b15
size 297345

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c8590e3d0c40592bb2611482a375756833a6ca0aff046a6239a5358fb1a68735
size 125789
oid sha256:144567bde78b790121261ea07309fb16470310564a23f38d91117b83034b07fc
size 243748

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7c1ca96074ce2549180efe3350a9fdf2e1a9654042b48975e0226222fb6a6c7e
size 103256
oid sha256:0df3d63b8e54f9d6bef4515a687e319e06324ead88e17ef0e9522a426f6fd7fe
size 158624

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9cc9343f623fb09fd83319baf1e0f8e2297a515528784345a69d152e4d524fb8
size 74486
oid sha256:dbcfe21315c3bd9da7c59b60e37e4c106f3a30a8a8e35a7c95cc4edad3594b08
size 131223