mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Event Permalink Tweaks (#2754)
* Handle errors focussing the timeline. * Add a test for focussing on an existing timeline item.
This commit is contained in:
@@ -241,11 +241,19 @@ enum RoomTimelineItemFixtures {
|
||||
static var outgoingPolls: [RoomTimelineItemProtocol] {
|
||||
[PollRoomTimelineItem.mock(poll: .disclosed(createdByAccountOwner: true), isOutgoing: true)]
|
||||
}
|
||||
|
||||
static var permalinkChunk: [RoomTimelineItemProtocol] {
|
||||
(1...20).map { index in
|
||||
TextRoomTimelineItem(id: .init(timelineID: "\(index)", eventID: "$\(index)"),
|
||||
text: "Message ID \(index)",
|
||||
senderDisplayName: index > 10 ? "Alice" : "Bob")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private extension TextRoomTimelineItem {
|
||||
init(text: String, senderDisplayName: String) {
|
||||
self.init(id: .random,
|
||||
init(id: TimelineItemIdentifier? = nil, text: String, senderDisplayName: String) {
|
||||
self.init(id: id ?? .random,
|
||||
timestamp: "10:47 am",
|
||||
isOutgoing: senderDisplayName == "Alice",
|
||||
isEditable: false,
|
||||
|
||||
Reference in New Issue
Block a user