0.10.6
This commit is contained in:
commit
92660a4ba0
228 files changed
+24496
No files matched your search
@@ -0,0 +1,29 @@
|
||||
import XCTest
|
||||
@testable import Luma
|
||||
|
||||
final class ChatScrollPositionPolicyTests: XCTestCase {
|
||||
func testBottomSentinelCrossesOnlyTheTelegramButtonThreshold() {
|
||||
XCTAssertTrue(ChatScrollPositionPolicy.isNearBottom(
|
||||
bottomY: 796,
|
||||
viewportHeight: 700
|
||||
))
|
||||
XCTAssertFalse(ChatScrollPositionPolicy.isNearBottom(
|
||||
bottomY: 797,
|
||||
viewportHeight: 700
|
||||
))
|
||||
}
|
||||
|
||||
func testInvalidFirstLayoutDoesNotFlashTheButton() {
|
||||
XCTAssertTrue(ChatScrollPositionPolicy.isNearBottom(
|
||||
bottomY: 0,
|
||||
viewportHeight: 0
|
||||
))
|
||||
}
|
||||
|
||||
func testNativeScrollDistanceCanHideAndRestoreButtonRepeatedly() {
|
||||
XCTAssertFalse(ChatScrollPositionPolicy.isNearBottom(distanceFromBottom: 180))
|
||||
XCTAssertTrue(ChatScrollPositionPolicy.isNearBottom(distanceFromBottom: 0))
|
||||
XCTAssertFalse(ChatScrollPositionPolicy.isNearBottom(distanceFromBottom: 220))
|
||||
XCTAssertTrue(ChatScrollPositionPolicy.isNearBottom(distanceFromBottom: -12))
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user