mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Expand the EventTimelineItem mock configuration
This commit is contained in:
@@ -18,6 +18,8 @@ struct EventTimelineItemSDKMockConfiguration {
|
|||||||
var forwarder: String?
|
var forwarder: String?
|
||||||
var forwarderProfile: ProfileDetails?
|
var forwarderProfile: ProfileDetails?
|
||||||
var isOwn = false
|
var isOwn = false
|
||||||
|
var isEditable = false
|
||||||
|
var canBeRepliedTo = false
|
||||||
var content: TimelineItemContent = .msgLike(content: .init(kind: .redacted,
|
var content: TimelineItemContent = .msgLike(content: .init(kind: .redacted,
|
||||||
reactions: [],
|
reactions: [],
|
||||||
inReplyTo: nil,
|
inReplyTo: nil,
|
||||||
@@ -27,6 +29,10 @@ struct EventTimelineItemSDKMockConfiguration {
|
|||||||
|
|
||||||
extension EventTimelineItem {
|
extension EventTimelineItem {
|
||||||
init(configuration: EventTimelineItemSDKMockConfiguration) {
|
init(configuration: EventTimelineItemSDKMockConfiguration) {
|
||||||
|
let lazyProvider = LazyTimelineItemProviderSDKMock()
|
||||||
|
lazyProvider.containsOnlyEmojisReturnValue = false
|
||||||
|
lazyProvider.getShieldsStrictReturnValue = ShieldState.none
|
||||||
|
lazyProvider.debugInfoReturnValue = .init(model: "", originalJson: nil, latestEditJson: nil)
|
||||||
self.init(isRemote: true,
|
self.init(isRemote: true,
|
||||||
eventOrTransactionId: .eventId(eventId: configuration.eventID),
|
eventOrTransactionId: .eventId(eventId: configuration.eventID),
|
||||||
sender: configuration.sender,
|
sender: configuration.sender,
|
||||||
@@ -34,16 +40,16 @@ extension EventTimelineItem {
|
|||||||
forwarder: configuration.forwarder,
|
forwarder: configuration.forwarder,
|
||||||
forwarderProfile: configuration.forwarderProfile,
|
forwarderProfile: configuration.forwarderProfile,
|
||||||
isOwn: configuration.isOwn,
|
isOwn: configuration.isOwn,
|
||||||
isEditable: false,
|
isEditable: configuration.isEditable,
|
||||||
content: configuration.content,
|
content: configuration.content,
|
||||||
eventTypeRaw: nil,
|
eventTypeRaw: nil,
|
||||||
timestamp: 0,
|
timestamp: UInt64(Date.mock.timeIntervalSince1970 * 1000),
|
||||||
localSendState: nil,
|
localSendState: nil,
|
||||||
localCreatedAt: nil,
|
localCreatedAt: nil,
|
||||||
readReceipts: [:],
|
readReceipts: [:],
|
||||||
origin: nil,
|
origin: nil,
|
||||||
canBeRepliedTo: false,
|
canBeRepliedTo: configuration.canBeRepliedTo,
|
||||||
lazyProvider: LazyTimelineItemProviderSDKMock())
|
lazyProvider: lazyProvider)
|
||||||
}
|
}
|
||||||
|
|
||||||
static var mockMessage: EventTimelineItem {
|
static var mockMessage: EventTimelineItem {
|
||||||
|
|||||||
Reference in New Issue
Block a user