mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
Fixes #2618 - Allow dashes in room identifiers
This commit is contained in:
@@ -41,6 +41,7 @@ class MatrixEntityRegexTests: XCTestCase {
|
||||
|
||||
func testRoomId() {
|
||||
XCTAssertTrue(MatrixEntityRegex.isMatrixRoomIdentifier("!pMBteVpcoJRdCJxDmn:matrix.org"))
|
||||
XCTAssertTrue(MatrixEntityRegex.isMatrixRoomIdentifier("!pMBte-Vpco-JRdCJxDmn:matrix.org"))
|
||||
XCTAssertFalse(MatrixEntityRegex.isMatrixRoomIdentifier("pMBteVpcoJRdCJxDmn:matrix.org"))
|
||||
XCTAssertFalse(MatrixEntityRegex.isMatrixRoomIdentifier("!pMBteVpcoJRdCJxDmn.matrix.org"))
|
||||
}
|
||||
|
||||
@@ -57,6 +57,17 @@ class PermalinkBuilderTests: XCTestCase {
|
||||
}
|
||||
}
|
||||
|
||||
func testMautrixBridgePermalink() throws {
|
||||
let roomId = "!mautrix-signal-v6:maunium.net"
|
||||
|
||||
do {
|
||||
let permalink = try PermalinkBuilder.permalinkTo(roomIdentifier: roomId, baseURL: appSettings.permalinkBaseURL)
|
||||
XCTAssertEqual(permalink, URL(string: "\(appSettings.permalinkBaseURL)/#/!mautrix-signal-v6%3Amaunium.net"))
|
||||
} catch {
|
||||
XCTFail("Room identifier must be valid: \(error)")
|
||||
}
|
||||
}
|
||||
|
||||
func testInvalidRoomIdentifier() {
|
||||
do {
|
||||
_ = try PermalinkBuilder.permalinkTo(roomIdentifier: "This1sN0tV4lid!@#$%^&*()", baseURL: appSettings.permalinkBaseURL)
|
||||
|
||||
Reference in New Issue
Block a user