From 037ada0d3def694fa0333246ba86af40eb8a7846 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Mon, 13 Nov 2023 15:59:56 +0200 Subject: [PATCH] Update room summary provider mock room details and snapshots --- .../HomeScreen/View/HomeScreenRoomCell.swift | 4 - .../RoomSummary/MockRoomSummaryProvider.swift | 87 ++++++++++++++----- .../PreviewTests/test_homeScreen.Loaded.png | 4 +- .../test_homeScreenRoomCell.1.png | 4 +- .../test_messageForwardingScreen.1.png | 4 +- ...tificationSettingsEditScreenRoomCell.1.png | 4 +- 6 files changed, 74 insertions(+), 33 deletions(-) diff --git a/ElementX/Sources/Screens/HomeScreen/View/HomeScreenRoomCell.swift b/ElementX/Sources/Screens/HomeScreen/View/HomeScreenRoomCell.swift index 2511c2650..c401de68b 100644 --- a/ElementX/Sources/Screens/HomeScreen/View/HomeScreenRoomCell.swift +++ b/ElementX/Sources/Screens/HomeScreen/View/HomeScreenRoomCell.swift @@ -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) } } } diff --git a/ElementX/Sources/Services/Room/RoomSummary/MockRoomSummaryProvider.swift b/ElementX/Sources/Services/Room/RoomSummary/MockRoomSummaryProvider.swift index 7e2e7626e..a1e8f77ce 100644 --- a/ElementX/Sources/Services/Room/RoomSummary/MockRoomSummaryProvider.swift +++ b/ElementX/Sources/Services/Room/RoomSummary/MockRoomSummaryProvider.swift @@ -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 ] diff --git a/UnitTests/__Snapshots__/PreviewTests/test_homeScreen.Loaded.png b/UnitTests/__Snapshots__/PreviewTests/test_homeScreen.Loaded.png index 7399d277b..2635f5a49 100644 --- a/UnitTests/__Snapshots__/PreviewTests/test_homeScreen.Loaded.png +++ b/UnitTests/__Snapshots__/PreviewTests/test_homeScreen.Loaded.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:036b3bb2926f55e4a495fa361f086a9af17d119f528550f8c8015ca96005ad9d -size 161158 +oid sha256:5958eb51b8c3c3754bd88b3ee9bf35a50f7ae7926d732652fe891453bc7f5b15 +size 297345 diff --git a/UnitTests/__Snapshots__/PreviewTests/test_homeScreenRoomCell.1.png b/UnitTests/__Snapshots__/PreviewTests/test_homeScreenRoomCell.1.png index f5a0e7ec2..d5a2d141e 100644 --- a/UnitTests/__Snapshots__/PreviewTests/test_homeScreenRoomCell.1.png +++ b/UnitTests/__Snapshots__/PreviewTests/test_homeScreenRoomCell.1.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c8590e3d0c40592bb2611482a375756833a6ca0aff046a6239a5358fb1a68735 -size 125789 +oid sha256:144567bde78b790121261ea07309fb16470310564a23f38d91117b83034b07fc +size 243748 diff --git a/UnitTests/__Snapshots__/PreviewTests/test_messageForwardingScreen.1.png b/UnitTests/__Snapshots__/PreviewTests/test_messageForwardingScreen.1.png index 4fc629892..3c9cb34e8 100644 --- a/UnitTests/__Snapshots__/PreviewTests/test_messageForwardingScreen.1.png +++ b/UnitTests/__Snapshots__/PreviewTests/test_messageForwardingScreen.1.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7c1ca96074ce2549180efe3350a9fdf2e1a9654042b48975e0226222fb6a6c7e -size 103256 +oid sha256:0df3d63b8e54f9d6bef4515a687e319e06324ead88e17ef0e9522a426f6fd7fe +size 158624 diff --git a/UnitTests/__Snapshots__/PreviewTests/test_notificationSettingsEditScreenRoomCell.1.png b/UnitTests/__Snapshots__/PreviewTests/test_notificationSettingsEditScreenRoomCell.1.png index 539787585..699c839d2 100644 --- a/UnitTests/__Snapshots__/PreviewTests/test_notificationSettingsEditScreenRoomCell.1.png +++ b/UnitTests/__Snapshots__/PreviewTests/test_notificationSettingsEditScreenRoomCell.1.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9cc9343f623fb09fd83319baf1e0f8e2297a515528784345a69d152e4d524fb8 -size 74486 +oid sha256:dbcfe21315c3bd9da7c59b60e37e4c106f3a30a8a8e35a7c95cc4edad3594b08 +size 131223