Skip to content

Commit 36d3077

Browse files
committed
Update test to reflect initial selection behavior in STTextView
A newly created STTextView now has a non-nil, empty selectedTextRange (caret at start). Updated the test to assert this expected behavior.
1 parent 0cf953a commit 36d3077

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Tests/STTextViewUIKitTests/TextViewTests.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66

77
func testInitialState() {
88
let textView = STTextView()
9-
XCTAssertNil(textView.selectedTextRange)
9+
// A newly created STTextView has a zero-length selection (caret) at the document start
10+
XCTAssertNotNil(textView.selectedTextRange)
11+
XCTAssertTrue(textView.selectedTextRange?.isEmpty == true)
1012
}
1113

1214
func testTextDelegate1() {

0 commit comments

Comments
 (0)