File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed
Tests/CodeEditTextViewTests Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,8 @@ final class STTextViewControllerTests: XCTestCase {
3232 language: . default,
3333 font: . monospacedSystemFont( ofSize: 11 , weight: . medium) ,
3434 theme: theme,
35- tabWidth: 4
35+ tabWidth: 4 ,
36+ overScrollLineCount: 5
3637 )
3738 }
3839
@@ -60,4 +61,25 @@ final class STTextViewControllerTests: XCTestCase {
6061 XCTAssertEqual ( color4, NSColor . textColor)
6162 }
6263
64+ func test_editorOverScroll( ) throws {
65+ let scrollView = try XCTUnwrap ( controller. view as? NSScrollView )
66+
67+ // overScrollLineCount: 5, lineHeight: 13
68+ XCTAssertEqual ( scrollView. contentInsets. bottom, 65 )
69+ }
70+
71+
72+ func test_editorOverScroll_AfterUpdate( ) throws {
73+ let scrollView = try XCTUnwrap ( controller. view as? NSScrollView )
74+
75+ // overScrollLineCount: 5, lineHeight: 13
76+ XCTAssertEqual ( scrollView. contentInsets. bottom, 65 )
77+
78+ controller. overScrollLineCount = 10
79+ controller. reloadUI ( )
80+
81+ // overScrollLineCount: 10, lineHeight: 13
82+ XCTAssertEqual ( scrollView. contentInsets. bottom, 130 )
83+ }
84+
6385}
You can’t perform that action at this time.
0 commit comments