Skip to content

Commit 8717837

Browse files
SergioEstevaojkmassel
authored andcommitted
Add unit test to detect in plain text is available when doing copy
1 parent dff493e commit 8717837

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

AztecTests/TextKit/TextViewTests.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2016,4 +2016,15 @@ class TextViewTests: XCTestCase {
20162016

20172017
XCTAssertEqual(output, expected)
20182018
}
2019+
2020+
// MARK: - Copy tests
2021+
2022+
func testCopyAndPasteToPlainText() {
2023+
let sourceTextView = TextViewStub(withHTML: "This is text with attributes: <strong>bold</strong>")
2024+
2025+
sourceTextView.selectedRange = NSRange(location: 0, length: sourceTextView.text.count)
2026+
sourceTextView.copy(nil)
2027+
2028+
XCTAssertEqual(UIPasteboard.general.string, "This is text with attributes: bold")
2029+
}
20192030
}

0 commit comments

Comments
 (0)