Skip to content

Commit

Permalink
Add unit test to detect in plain text is available when doing copy
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioEstevao authored and jkmassel committed May 24, 2019
1 parent dff493e commit 8717837
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions AztecTests/TextKit/TextViewTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2016,4 +2016,15 @@ class TextViewTests: XCTestCase {

XCTAssertEqual(output, expected)
}

// MARK: - Copy tests

func testCopyAndPasteToPlainText() {
let sourceTextView = TextViewStub(withHTML: "This is text with attributes: <strong>bold</strong>")

sourceTextView.selectedRange = NSRange(location: 0, length: sourceTextView.text.count)
sourceTextView.copy(nil)

XCTAssertEqual(UIPasteboard.general.string, "This is text with attributes: bold")
}
}

0 comments on commit 8717837

Please sign in to comment.