mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Run SwiftFormat.
This commit is contained in:
@@ -12,7 +12,7 @@ import Testing
|
||||
|
||||
struct TimelineStateTests {
|
||||
// MARK: - Read marker
|
||||
|
||||
|
||||
@Test("Read marker unique ID is captured when present in the timeline")
|
||||
func readMarkerUniqueIDPresent() {
|
||||
var state = TimelineState()
|
||||
@@ -20,22 +20,22 @@ struct TimelineStateTests {
|
||||
state.itemsDictionary[.init("read-marker")] = makeReadMarkerViewState(uniqueID: "read-marker")
|
||||
state.itemsDictionary[.init("msg2")] = makeTextViewState(uniqueID: "msg2")
|
||||
state.recomputeReadMarkerUniqueID()
|
||||
|
||||
|
||||
#expect(state.readMarkerUniqueID == .init("read-marker"))
|
||||
}
|
||||
|
||||
|
||||
@Test("Read marker unique ID is nil when no marker exists")
|
||||
func readMarkerUniqueIDAbsent() {
|
||||
var state = TimelineState()
|
||||
state.itemsDictionary[.init("msg1")] = makeTextViewState(uniqueID: "msg1")
|
||||
state.itemsDictionary[.init("msg2")] = makeTextViewState(uniqueID: "msg2")
|
||||
state.recomputeReadMarkerUniqueID()
|
||||
|
||||
|
||||
#expect(state.readMarkerUniqueID == nil)
|
||||
}
|
||||
|
||||
|
||||
// MARK: - Helpers
|
||||
|
||||
|
||||
private func makeTextViewState(uniqueID: String) -> RoomTimelineItemViewState {
|
||||
let item = TextRoomTimelineItem(id: .virtual(uniqueID: .init(uniqueID)),
|
||||
timestamp: .mock,
|
||||
@@ -46,7 +46,7 @@ struct TimelineStateTests {
|
||||
content: .init(body: "Test message"))
|
||||
return RoomTimelineItemViewState(type: .text(item), groupStyle: .single)
|
||||
}
|
||||
|
||||
|
||||
private func makeReadMarkerViewState(uniqueID: String) -> RoomTimelineItemViewState {
|
||||
let item = ReadMarkerRoomTimelineItem(id: .virtual(uniqueID: .init(uniqueID)))
|
||||
return RoomTimelineItemViewState(type: .readMarker(item), groupStyle: .single)
|
||||
|
||||
Reference in New Issue
Block a user