mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
added a test to check if URLs work with RTL
This commit is contained in:
@@ -745,6 +745,22 @@ class AttributedStringBuilderTests: XCTestCase {
|
|||||||
XCTAssertEqual(link.absoluteString, "https://matrix.org")
|
XCTAssertEqual(link.absoluteString, "https://matrix.org")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func testValidLinkWithRTLOverride() {
|
||||||
|
let htmlString = "<a href=\"https://matrix.org\">\u{202E}https://matrix.org</a>"
|
||||||
|
|
||||||
|
guard let attributedString = attributedStringBuilder.fromHTML(htmlString) else {
|
||||||
|
XCTFail("Could not build the attributed string")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
guard let link = attributedString.runs.first(where: { $0.link != nil })?.link else {
|
||||||
|
XCTFail("Couldn't find the link")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
XCTAssertFalse(link.requiresConfirmation)
|
||||||
|
XCTAssertEqual(link.absoluteString, "https://matrix.org")
|
||||||
|
}
|
||||||
|
|
||||||
func testPhishingUserID() {
|
func testPhishingUserID() {
|
||||||
let htmlString = "Hey check the following user <a href=\"https://matrix.org\">@alice:matrix.org</a>"
|
let htmlString = "Hey check the following user <a href=\"https://matrix.org\">@alice:matrix.org</a>"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user