Skip to content

Commit 80c367c

Browse files
committed
Fixed unit tests
1 parent 9c7ae0b commit 80c367c

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

ChatLayout/Classes/Core/Model/StateController.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1623,4 +1623,8 @@ final class StateController<Layout: ChatLayoutRepresentation> {
16231623
return ItemPath(item: itemIndex, section: sectionIndex)
16241624
}
16251625
}
1626+
1627+
func _resetLayoutForTests() {
1628+
layoutAfterUpdate = nil
1629+
}
16261630
}

Example/Tests/PerformanceTests.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ final class PerformanceTests: XCTestCase {
112112
}
113113
measure {
114114
layout.controller.process(changeItems: changeItems)
115+
layout.controller._resetLayoutForTests()
115116
}
116-
layout.controller.commitUpdates()
117117
}
118118

119119
func testReloadPerformance() {
@@ -126,8 +126,8 @@ final class PerformanceTests: XCTestCase {
126126
}
127127
measure {
128128
layout.controller.process(changeItems: changeItems)
129+
layout.controller._resetLayoutForTests()
129130
}
130-
layout.controller.commitUpdates()
131131
}
132132

133133
func testDeletePerformance() {
@@ -140,8 +140,8 @@ final class PerformanceTests: XCTestCase {
140140
}
141141
measure {
142142
layout.controller.process(changeItems: changeItems)
143+
layout.controller._resetLayoutForTests()
143144
}
144-
layout.controller.commitUpdates()
145145
}
146146

147147
func testItemUpdatePerformance() {

0 commit comments

Comments
 (0)