mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Send Intentional Mentions (#1929)
* updated sdks * fix waveform * implementation completed * intentional mentions test * removed unused var * suggestion
This commit is contained in:
@@ -160,4 +160,25 @@ class ComposerToolbarViewModelTests: XCTestCase {
|
||||
let attachment = wysiwygViewModel.textView.attributedText.attribute(.attachment, at: 0, effectiveRange: nil) as? PillTextAttachment
|
||||
XCTAssertEqual(attachment?.pillData?.type, .allUsers)
|
||||
}
|
||||
|
||||
func testIntentionalMentions() async throws {
|
||||
wysiwygViewModel.setHtmlContent(
|
||||
"""
|
||||
<p>Hello @room \
|
||||
and especially hello to <a href=\"https://matrix.to/#/@test:matrix.org\">Test</a></p>
|
||||
"""
|
||||
)
|
||||
|
||||
let deferred = deferFulfillment(viewModel.actions) { action in
|
||||
switch action {
|
||||
case let .sendMessage(_, _, _, intentionalMentions):
|
||||
return intentionalMentions == IntentionalMentions(userIDs: ["@test:matrix.org"], atRoom: true)
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
viewModel.context.send(viewAction: .sendMessage)
|
||||
|
||||
try await deferred.fulfill()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user